Next: Functions and Graphics Up: Maple: An Introduction Previous: Data Structures

The Linear Algebra Package

In Maple a vector is represented as a one-dimensional array, and a matrix is represented as a two-dimensional array. See ?vector and ?matrix for detailed help on vectors and matrices.

In Maple there are many packages for special applications. The linalg package contains many functions from linear algebra for computing with vectors and matrices. In order to use a package, you must load the package using the with command, e.g.


> with(linalg);
Warning: new definition for   norm
Warning: new definition for   trace
[BlockDiagonal, GramSchmidt, JordanBlock, add, addcol, addrow, adj, adjoint,
    angle, augment, backsub, band, basis, bezout, charmat, charpoly, col,
    coldim, colspace, colspan, companion, concat, cond, copyinto, crossprod,
    curl, definite, delcols, delrows, det, diag, diverge, dotprod, eigenvals,
    eigenvects, equal, exponential, extend, ffgausselim, fibonacci, frobenius,
    gausselim, gaussjord, genmatrix, grad, hadamard, hermite, hessian,
    hilbert, htranspose, ihermite, indexfunc, innerprod, intbasis, inverse,
    ismith, iszero, jacobian, jordan, kernel, laplacian, leastsqrs, linsolve,
    matrix, minor, minpoly, mulcol, mulrow, multiply, norm, nullspace, orthog,
    permanent, pivot, potential, randmatrix, range, rank, row, rowdim,
    rowspace, rowspan, rref, scalarmul, singularvals, smith, stack, submatrix,
    subvector, sumbasis, swapcol, swaprow, sylvester, toeplitz, trace,
    transpose, vandermonde, vecpotent, vectdim, vector]
You can now use any of the functions listed. The matrix command can be used to input a matrix. In the next example the inverse and determinant of a 3 by 3 matrix is computed.

> A := matrix([[x-1,2,3],[0,x-2,2],[2,1,x-3]]);


> det(A);

> inverse(A);

If you type ?packages you will get a list of all the known packages to Maple and what they are. In particular, this includes


bondaren@thsun1.jinr.ru