Details of the LinearAlgebra Package - Maple Help

Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra/Details

Details of the LinearAlgebra Package

Basic Information

 • This help page contains complete information about the LinearAlgebra package. For basic information on the LinearAlgebra package, see the LinearAlgebra help page.

Description

 • The LinearAlgebra package is an efficient and robust suite of commands for performing computational linear algebra.
 • LinearAlgebra routines operate on three principal data structures: Matrices, Vectors, and scalars.  For more information, see the Construct a Matrix, Construct a Vector, and About Data Structures in the LinearAlgebra Package help pages.
 • Full rectangular and sparse matrices are fully supported at the data structure level, as well as upper and lower triangular matrices, unit triangular matrices, banded matrices, and a variety of others. Further, symmetric, skew-symmetric, hermitian, and skew-hermitian are known qualifiers that are used appropriately to reduce storage and select amongst algorithms.  For more information, see the Shapes and Storage Modes for Matrices and Vectors help page.
 • The following data types are handled efficiently: hardware floating-point numbers (both real and complex), hardware integers of various sizes, arbitrary-precision floating-point numbers (both real and complex), and general symbolic expressions. For increased compatibility with external routines, matrices can be stored in either C or Fortran order.
 • The LinearAlgebra package includes a subpackage, Modular, which provides a highly efficient suite of programmer tools for performing dense linear algebra computations in Z/m, the integers modulo m over the positive range.  For more information, see LinearAlgebra[Modular].
 • The LinearAlgebra package includes a subpackage, Generic, for computing with generic implementations of algorithms for linear algebra over fields, Euclidean domains, integral domains and rings. For more information, see LinearAlgebra[Generic].
 • The LinearAlgebra and VectorCalculus packages supersede the deprecated linalg package. For information illustrating the differences between these packages, see the Linear Algebra Computations in Maple help page.  For an example worksheet on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.

Accessing LinearAlgebra Package Commands

 • Each command in the LinearAlgebra package can be accessed by using either the long form or the short form of the command name in the command calling sequence.
 As the underlying implementation of the LinearAlgebra package is a module, it is also possible to use the form LinearAlgebra:-command to access a command from the package. For more information,  see Module Members.

List of LinearAlgebra Package Commands

 The following is a list of available commands.

 To display the help page for a particular LinearAlgebra command, see Getting Help with a Command in a Package.

Examples

 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$

Construct a Matrix using shortcut notation

 > $⟨⟨1|2|3⟩,⟨4|5|6⟩⟩$
 $\left[\begin{array}{rrr}{1}& {2}& {3}\\ {4}& {5}& {6}\end{array}\right]$ (1)

Construct a Matrix with optional construction parameters

 > $\mathrm{Matrix}\left(\left[\left[1,2,3\right],\left[4,5,6\right]\right],\mathrm{readonly}=\mathrm{true}\right)$
 $\left[\begin{array}{rrr}{1}& {2}& {3}\\ {4}& {5}& {6}\end{array}\right]$ (2)

Create a random Matrix.

 > $A≔\mathrm{RandomMatrix}\left(2,3\right)$
 ${A}{:=}\left[\begin{array}{rrr}{99}& {44}& {-}{31}\\ {29}& {92}& {67}\end{array}\right]$ (3)

The inplace option saves memory and prevents creating new variable names for intermediate results.

 > $\mathrm{RowOperation}\left(A,\left[1,2\right],\mathrm{inplace}\right)$
 $\left[\begin{array}{rrr}{29}& {92}& {67}\\ {99}& {44}& {-}{31}\end{array}\right]$ (4)
 > $A$
 $\left[\begin{array}{rrr}{29}& {92}& {67}\\ {99}& {44}& {-}{31}\end{array}\right]$ (5)

Create an upper triangular Matrix.

 > $M≔\mathrm{RandomMatrix}\left(5,\mathrm{outputoptions}=\left[\mathrm{shape}={\mathrm{triangular}}_{\mathrm{upper}}\right]\right)$
 ${M}{:=}\left[\begin{array}{rrrrr}{69}& {8}& {27}& {-}{4}& {-}{74}\\ {0}& {-}{32}& {-}{2}& {-}{72}& {-}{76}\\ {0}& {0}& {-}{93}& {27}& {57}\\ {0}& {0}& {0}& {-}{77}& {-}{98}\\ {0}& {0}& {0}& {0}& {33}\end{array}\right]$ (6)

Define two matrices.

 > $A≔\mathrm{Matrix}\left(\left[\left[2,5\right],\left[1,3\right]\right]\right):$
 > $B≔\mathrm{Matrix}\left(\left[\left[6,11\right],\left[9,21\right]\right]\right):$

Performing calculations in a casual usage scenario accepts optional arguments in any order.

 > $\mathrm{MatrixAdd}\left(A,B,1,-1\right)$
 $\left[\begin{array}{rr}{-}{4}& {-}{6}\\ {-}{8}& {-}{18}\end{array}\right]$ (7)