Close
Close window
Migration into Linear Algebra - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


Home : Support : Online Help : Mathematics : Linear Algebra : Examples : Migration into Linear Algebra
[フレーム] [フレーム]

Migrating linalg commands to LinearAlgebra and VectorCalculus

The LinearAlgebra and VectorCalculus modules together supersede the linalg package. This document shows how to translate common linalg command sequences to LinearAlgebra and VectorCalculus.

Introduction

The LinearAlgebra package (introduced in Maple 6) is a robust and efficient suite of routines for performing computational linear algebra. Together with the VectorCalculus package (introduced in Maple 8), LinearAlgebra provides more complete and efficient functionality than the older linalg package.

It is recommended that you use LinearAlgebra and VectorCalculus instead of linalg.

Advantages of LinearAlgebra and VectorCalculus over linalg include:

The numerical routines in LinearAlgebra for floating-point computation are far more efficient. They make calls to compiled C routines from the NAG library, whereas numerical evaluation in linalg relies solely on the built-in Maple numerics. You can therefore work with very large and/or very sparse Matrices efficiently.

The new matrix and vector constructors (called Matrix and Vector) are more intuitive and flexible. For example, LinearAlgebra provides built-in commands for constructing identity Matrices, zero Vectors, unit basis Vectors and many other structured Matrices. Furthermore, both constructors have options for output formatting, datatype of the entries, and more.

Matrices and Vectors in LinearAlgebra are new data structures, separate from arrays and lists. These data structures were designed explicitly for efficient linear algebra computations, whereas in linalg, matrices and vectors are stored as general arrays or lists. When creating Matrices and Vectors, you can optionally specify the datatype of their entries (for example, floating-point or complex), the shape (for example, triangular or symmetric), the storage method (for example, sparse or rectangular), and more. The LinearAlgebra routines you call on those matrices can then apply algorithms that take advantage of the matrices' structure.

The syntax for Matrix arithmetic is simpler. For example, LinearAlgebra avoids both the syntactic and computational overhead of evalm. You can apply the binary operators +, -, . and ^ directly.

LinearAlgebra offers two modes of use, one for maximal numeric efficiency, the other for maximal ease-of-use and readability.

The set of commands for vector calculus in the VectorCalculus package is more comprehensive than that in linalg. (For example, it includes an augmented int routine that makes multiple integration over complicated geometric regions extremely simple. It also has routines for differential geometry.)

VectorCalculus displays vectors as linear combinations of the basis vectors of the coordinate system you specify. This provides more useful information than a simple list of coordinate values, as linalgdoes.

Unlike linalg, VectorCalculus distinguishes constant vectors from vector fields. This reduces the risk of confusion about the types of the mathematical objects you create.

Constructing Matrices and Vectors

Entering matrices by data entry

linalg

>

A:=matrix3,3,1,2,3,3,1,2,2,3,1

>

Bmatrix3,3,a,b,c,c,a,b,b,c,a

>

v:=vector3,5.05,6.125,2.980

A:=123312231

B:=abccabbca

v:=5.056.1252.980

(2.1.1)

LinearAlgebra

>

PMatrix1,2,3,3,1,2,2,3,1

>

QMatrixa,b,c,c,a,b,b,c,a

>

wVector5.05,6.125,2.980

>

w2:=Vector8,fill=π+2

P123312231

Qabccabbca

w5.056.1252.980

w2π+2π+2π+2π+2π+2π+2π+2π+2

(2.1.2)

For small Vectors and Matrices, the <..> and <<..>> constructor shortcuts may be more convenient.

>

x&verbar;y&verbar;z&comma;a&verbar;b&verbar;c

>

x&comma;y&comma;z

Extending a given Matrix or Vector

The linalg package has routines stackmatrix and augment (or concat) that can extend matrices or conjoin them.

>

m:=matrix2&comma;3&comma;i&comma;j&rarr;i&plus;j

>

nmatrix2&comma;2&comma;i&comma;j&pi;

>

linalgaugmentm&comma;n

m:=234345

n:=&pi;&pi;&pi;&pi;

234&pi;&pi;345&pi;&pi;

(2.2.1)
>

m:=matrix3&comma;2&comma;i&comma;ji&plus;j

>

n:=matrix2&comma;2&comma;i&comma;j&pi;

>

linalgstackmatrixm&comma;n

m:=233445

n:=&pi;&pi;&pi;&pi;

233445&pi;&pi;&pi;&pi;

(2.2.2)

These operations can be done directly using either the Matrix and Vector constructors or their shortcuts.

>

m:=Matrix2&comma;3&comma;i&comma;j&rarr;i&plus;j

>

n:=Matrix2&comma;2&comma;fill&equals;&pi;

>

Matrixm&comma;n

>

m&verbar;n

>

mMatrix3&comma;2&comma;i&comma;ji&plus;j

>

nMatrix2&comma;2&comma;fill&equals;&pi;

>

Matrixm&comma;n

>

m&comma;n

The linalg routine blockmatrix assembles blocks of matrices together, which can also be accomplished directly using the Matrix constructor without having to specify the number of blocks.

>

m:=matrix3&comma;3&comma;i&comma;j&rarr;ij&colon;n:=matrix3&comma;3&comma;i&comma;jij2&colon; r:=matrix3&comma;3&comma;0&colon; linalgblockmatrix2&comma;3&comma;m&comma;n&comma;r&comma;n&comma;r&comma;m

012014000101101000210410000014000012101000101410000210

(2.2.3)
>

interfacertablesize&equals;20&colon;

>

M:=Matrix3&comma;3&comma;i&comma;j&rarr;ij&colon;N:=Matrix3&comma;3&comma;i&comma;jij2&colon; R:=Matrix3&comma;3&comma;0&colon; MatrixM&comma;N&comma;R&comma;N&comma;R&comma;M

012014000101101000210410000014000012101000101410000210

(2.2.4)

The Matrix constructor reproduces the functionality of the linalg routine extend.

>

m:=matrix3&comma;3&comma;i&comma;j&rarr;ij

>

linalgextendm&comma;1&comma;4&comma;&pi;

>

M:=Matrix3&comma;3&comma;i&comma;j&rarr;ij

>

Matrix4&comma;7&comma;M&comma;fill&equals;&pi;

m:=012101210

012&pi;&pi;&pi;&pi;101&pi;&pi;&pi;&pi;210&pi;&pi;&pi;&pi;&pi;&pi;&pi;&pi;&pi;&pi;&pi;

The functionality of the linalg routine copyinto can also be accomplished with Matrices.

>

m:=matrix6&comma;6&comma;i&comma;j&rarr;ij&colon;n:=matrix2&comma;2&comma;i&comma;j&rarr;&pi;&colon;linalgcopyinton&comma;m&comma;3&comma;3

01234510123421&pi;&pi;2332&pi;&pi;12432101543210

(2.2.5)
>

M:=Matrix6&comma;6&comma;i&comma;j&rarr;ij&colon;N:=Matrix2&comma;2&comma;fill&equals;&pi;&colon;NewM:=copyM&colon; NewM3..5&comma;3..5N&colon;NewM

Specially structured matrices and vectors

linalg

>

array1..3&comma;1..3&comma;identity

>

array1..5&comma;seq0&comma;i&equals;1..5

>

array1..3&comma;1..3&comma;diagonal

>

linalgband1&comma;2&comma;3&comma;6

>

linalghilbert3

>

linalgvandermonde1&comma;2&comma;3&comma;4

100010001

00000

`?`1&comma;1000`?`2&comma;2000`?`3&comma;3

230000123000012300001230000123000012

11213121314131415

1111124813927141664

(2.3.1)

LinearAlgebra
The naming convention for LinearAlgebra routines is to spell the operation name completely, beginning each word with an uppercase letter.

>

LinearAlgebraIdentityMatrix3

>

LinearAlgebraZeroVector5

>

LinearAlgebraDiagonalMatrixa&comma;b&comma;c&semi;LinearAlgebraBandMatrix1&comma;2&comma;3&comma;1&comma;6

>

LinearAlgebraHilbertMatrix3&semi;LinearAlgebraVandermondeMatrix1&comma;2&comma;3&comma;4

A strength of LinearAlgebra is its ability to work with very large Matrices efficiently. Here, we create a 3000-dimensional unit Vector with a 1 in the 17th position.

>

e2LinearAlgebraUnitVector17&comma;3000

>

e217

>

e2229

1

0

(2.3.2)

Here is a 100x100 band Matrix.

>

NLinearAlgebraBandMatrix1&comma;2&comma;3&comma;1&comma;100

>

N47&comma;47

>

N47&comma;48

>

N47&comma;49

2

3

0

(2.3.3)

Maple prints large Vectors and Matrices (one or both dimensions > 10) in the form of a data structure summary. To browse the contents of the vector or matrix , double-click the matrix output. Below is the interface for the 100x100 banded matrix created above.

Matrix Arithmetic

Binary operations

linalg

>

evalmA&plus;B

>

evalmAB

>

evalmA &* B

>

evalmA &* v

>

evalmA2.7

1&plus;a2&plus;b3&plus;c3&plus;c1&plus;a2&plus;b2&plus;b3&plus;c1&plus;a

1a2b3c3c1a2b2b3c1a

a&plus;2c&plus;3bb&plus;2a&plus;3cc&plus;2b&plus;3ac&plus;2b&plus;3aa&plus;2c&plus;3bb&plus;2a&plus;3cb&plus;2a&plus;3cc&plus;2b&plus;3aa&plus;2c&plus;3b

26.24027.23531.455

2.75.48.18.12.75.45.48.12.7

(3.1.1)

LinearAlgebra

For maximal simplicity, you can use +, -, ., and ^ for binary operations.

>

P &plus; Q

>

P &period; 9 Q &period; 18

>

P &period; Q

>

P &period; w

>

P &period; 2.7

>

Q2

For maximal computational efficiency, use the named routines, which demand specific types for the operands (that is, Vector, Matrix, or scalar). These routines save computation time because, unlike the + and . operators, they do not need to determine the operand types.

>

LinearAlgebra:-MatrixAddQ&comma; P

>

LinearAlgebra:-MatrixAddQ&comma; P&comma;9&comma;18

>

LinearAlgebra:-MatrixMatrixMultiplyQ&comma; P

>

LinearAlgebra:-MatrixVectorMultiplyP&comma; w

>

LinearAlgebra:-ScalarMultiplyP&comma; 2.7

Unary operations and matrix properties

linalg

>

linalgtransposeA

>

linalginverseA

>

linalgcharpolyA&comma;&lambda;

>

linalgeigenvaluesA

>

linalgeigenvectorsA

>

linalgdetA

>

linalgtraceA

>

linalgnullspacematrix2&comma;2&comma;a&comma;b&comma;a&comma;b

132213321

518718118118518718718118518

&lambda;33&lambda;215&lambda;18

6&comma;32&plus;12I3&comma;3212I3

32&plus;12I3&comma;1&comma;12&plus;12I311212I3&comma;3212I3&comma;1&comma;1212I3112&plus;12I3&comma;6&comma;1&comma;111

18

3

ba1

(3.2.1)

Note that linalgkernel computes the same result as linalgnullspace.

>

linalgnormx&comma;y&comma;z&comma;2

>

linalgnormx&comma;y&comma;z

>

linalgnormalizex&comma;y&comma;z

>

linalganglex&comma;y&comma;z&comma;a&comma;b&comma;c

x2&plus;y2&plus;z2

maxx&comma;y&comma;z

xx2&plus;y2&plus;z2yx2&plus;y2&plus;z2zx2&plus;y2&plus;z2

arccosxa&plus;yb&plus;zcx2&plus;y2&plus;z2a2&plus;b2&plus;c2

(3.2.2)

LinearAlgebra

These operations and others are also available through the context menus.To use them, click a matrix and select the desired operation from the options that appear in the Context Panel .

>

LinearAlgebra:-TransposeP

>

LinearAlgebra:-MatrixInverseP

>

LinearAlgebra:-CharacteristicPolynomialP&comma;&lambda;

>

LinearAlgebra:-EigenvaluesP

>

LinearAlgebra:-EigenvectorsP

>

LinearAlgebra:-DeterminantP

>

LinearAlgebra:-TraceP

>

LinearAlgebra:-NullSpacea&verbar;b&comma;a&verbar;b

>

LinearAlgebra:-Norma&comma;b&comma;c&comma;2

>

LinearAlgebra:-Norma&comma;b&comma;c

>

LinearAlgebra:-Normalizea&comma;b&comma;c&comma;2

>

LinearAlgebra:-VectorAnglea&comma;b&comma;c&comma;d&comma;e&comma;f

18&plus;&lambda;33&lambda;215&lambda;

18

3

a2&plus;b2&plus;c2

maxa&comma;b&comma;c

arccosa&conjugate0;d&plus;b&conjugate0;e&plus;c&conjugate0;fa2&plus;b2&plus;c2d2&plus;e2&plus;f2

(3.2.3)

Row and Column Operations

>

evalmB

>

linalgcoldimB

>

linalgrowdimB

>

linalgvectdimv

>

linalgcolB&comma;2

>

linalgrowB&comma;3

>

linalgdelcolsB&comma;2..2

>

linalgswaprowB&comma;1&comma;3

>

linalgswapcolB&comma;1&comma;3

>

linalgmulrowB&comma;1&comma;s

>

linalgmulcolB&comma;1&comma;s

abccabbca

3

3

3

bac

bca

accbba

bcacababc

cbabacacb

sasbsccabbca

sabcscabsbca

(4.1)

LinearAlgebra

Note: Inside a procedure, you can invoke LinearAlgebra commands (or those from any module), with the use <module names> in <module routine calls> end use; construction. This eliminates the need to invoke with(LinearAlgebra) or prepend LinearAlgebra:- to the names of the routines. The use statement is illustrated below.

>

useLinearAlgebrain ColumnDimensionP&semi; RowDimensionP&semi; DimensionP&semi; Dimensionw&semi; ColumnP&comma;2&semi; RowP&comma;2&semi; DeleteColumnP&comma;2..2 end use

3

3

3&comma;3

3

Use the RowOperation and ColumnOperation routines for any general operation of Gaussian elimination (swapping rows/columns, multiplying rows/columns by scalars, or adding multiples of one row to another). You can overwrite the Matrix with the transformed one by including the option inplace=true, or simply inplace, at the end of the command.

>

useLinearAlgebrain RowOperationQ&comma;1&comma;s&semi; RowOperationQ&comma;1&comma;3&semi; RowOperationQ&comma;1&comma;3&comma;7&comma;inplace&equals;true end use

Another simple syntax is available to manipulate rows, columns, or subblocks of Matrices and Vectors.

>

M:=Matrix3&comma;3&comma;1&comma;2&comma;3&comma;4&comma;5&comma;6&comma;7&comma;8&comma;9

>

M1&comma;1..3M2&comma;1..3

>

M

>

M3&comma;1..12 M2&comma;1..3

>

M&semi;

>

M2..3&comma;2..3Matrix2&comma;2&comma;&pi;&comma;&pi;&comma;sinx&comma;cosy

>

M

Solving Systems of Linear Equations

linalg

>

eqnslinalggeneqnsA&comma;x&comma;y&comma;z

>

eqns2linalggeneqnsA&comma;x&comma;y&comma;z&comma;v

eqns:=x&plus;2y&plus;3z&equals;0&comma;2x&plus;3y&plus;z&equals;0&comma;3x&plus;y&plus;2z&equals;0

eqns2:=x&plus;2y&plus;3z&equals;5.05&comma;2x&plus;3y&plus;z&equals;2.980&comma;3x&plus;y&plus;2z&equals;6.125

(5.1)
>

linalggenmatrixeqns2&comma;x&comma;y&comma;z

>

linalggenmatrixeqns2&comma;x&comma;y&comma;z&comma;flag

123231312

1235.052312.9803126.125

(5.2)
>

linalglinsolveA&comma;v

>

linalglinsolveA&comma;B

1.1447222230.26194444511.476388889

118b&plus;718c518a718a518b&plus;118c518c&plus;718b&plus;118a518c&plus;718b&plus;118a118b&plus;718c518a718a518b&plus;118c718a518b&plus;118c518c&plus;718b&plus;118a118b&plus;718c518a

(5.3)

LinearAlgebra

>

eqns3:=LinearAlgebra:-GenerateEquationsP&comma;x&comma;y&comma;z

>

eqns4:=LinearAlgebra:-GenerateEquationsP&comma;x&comma;y&comma;z&comma;w

eqns3:=x&plus;2y&plus;3z&equals;0&comma;3x&plus;y&plus;2z&equals;0&comma;2x&plus;3y&plus;z&equals;0

eqns4:=x&plus;2y&plus;3z&equals;5.05&comma;3x&plus;y&plus;2z&equals;6.125&comma;2x&plus;3y&plus;z&equals;2.980

(5.4)
>

LinearAlgebra:-GenerateMatrixeqns4&comma;x&comma;y&comma;z

>

LinearAlgebra:-GenerateMatrixeqns4&comma;x&comma;y&comma;z&comma;augmented

>

LinearAlgebra:-LinearSolveP&comma;w

>

LinearAlgebra:-LinearSolveP&comma;Q

Matrix Reductions and Decompositions

linalg

>

AvlinalgaugmentA&comma;linalgvector1&comma;2&comma;1

Av:=123131222311

(6.1)
>

linalggausselimAv

>

linalgffgausselimAv

>

linalggaussjordAv

>

linalgfrobeniusAv

>

linalgjordanA

123105710018545

1231057100184

100590101900129

00181015013

60003212I300032&plus;12I3

(6.2)
>

ATA:=evalmlinalgtransposeA &* A

ATA:=141111111411111114

(6.3)
>

linalgdefiniteATA&comma;positive_def

>

linalgcholeskyATA

true

1400111414514420111414117042653

(6.4)
>

linalgLUdecompA

>

linalgQRdecompA

12305700185

1411141411141405144211704200653

(6.5)

LinearAlgebra

>

useLinearAlgebrainPv:=P&verbar;1&comma;2&comma;1&semi;GaussianEliminationPv&semi;LUDecompositionPv&comma;method&equals;FractionFree&semi;ReducedRowEchelonFormPv&semi;FrobeniusFormP&semi;JordanFormP&semi;HessenbergFormPend use

>

useLinearAlgebrain PTPTransposeP &period; P&semi; IsDefinitePTP&semi; LUDecompositionPTP&comma;method&equals;Cholesky&semi; P1&comma;P2QRDecompositionP end use

true

Vector Calculus

>

restart

linalg

>

v1:=x&comma;y&comma;z&colon;v2a&comma;b&comma;c&colon;

>

linalgdotprodv1&comma;v2

>

linalginnerprodv1&comma;v2

>

linalgcrossprodv1&comma;v2

xa&conjugate0;&plus;yb&conjugate0;&plus;zc&conjugate0;

xa&plus;yb&plus;zc

yczbzaxcxbya

(7.1)
>

f:=x2&plus;xzy2z&plus;sint&colon;

>

linalggradf&comma;x&comma;y&comma;z

>

linalglaplacianf&comma;x&comma;y&comma;z

>

linalglaplaciangr&comma;θ&comma;φ&comma;r&comma;θ&comma;φ&comma;coords&equals;cylindrical

>

linalghessianf&comma;x&comma;y&comma;z

2x&plus;z2yzxy2

22z

rgr&comma;&theta;&comma;&phi;&plus;r2r2gr&comma;&theta;&comma;&phi;&plus;2&theta;2gr&comma;&theta;&comma;&phi;r&plus;r2&phi;2gr&comma;&theta;&comma;&phi;r

20102z2y12y0

(7.2)
>

F:=x2&comma;xz&comma;y2z&colon;

>

linalgcurlF&comma;x&comma;y&comma;z

>

linalgdivergeF&comma;x&comma;y&comma;z

>

linalgjacobianF&comma;x&comma;y

2yzx0z

2x&plus;y2

2x0z002yz

(7.3)

VectorCalculus

The VectorCalculus package outputs vectors and vector fields as linear combinations of basis vectors. For example, in Cartesian coordinates, the standard basis vectors are ex&equals;1&comma;0&comma;0&comma;ey&equals;0&comma;1&comma;0, and ez&equals;0&comma;0&comma;1. Set the coordinate system to work in using the SetCoordinates routine.

>

v1:=x&comma;y&comma;z&colon;v2:=a&comma;b&comma;c&colon;

>

useVectorCalculus&comma;LinearAlgebrainSetCoordinatescartesianx&comma;y&comma;z&semi;DotProductv1&comma;v2&semi;BilinearFormv1&comma;v2&semi;end use

cartesianx,y,z

xa+yb+zc

x&conjugate0;a+y&conjugate0;b+z&conjugate0;c

(7.4)
>

useVectorCalculusin SetCoordinates&apos;cartesian&apos;&semi; Gradientf&comma;x&comma;y&comma;z&semi; Laplacianf&comma;x&comma;y&comma;z&semi; Laplacianur&comma;&theta;&comma;&phi;&comma;cylindricalr&comma;&theta;&comma;&phi;&semi; Hessianf&comma;x&comma;y&comma;zend use

cartesian

0

rur&comma;θ&comma;φ+r2r2ur&comma;θ&comma;φ+2θ2ur&comma;θ&comma;φr+r2φ2ur&comma;θ&comma;φr

000000000

(7.5)

Making a function out of a vector derivative, in this case, the Hessian matrix computed immediately above.

>

H:=unapply&comma;x&comma;y&comma;z&colon;

>

H1&comma;1&comma;s&plus;t

000000000

(7.6)

In VectorCalculus, a vector field is a different data structure from a vector. Vector fields have their own constructor, VectorField. To evaluate the vector field at a particular vector, use the evalVF routine.

>

useVectorCalculusinF:=VectorFieldx2&comma;xz&comma;y2z&comma;cartesianx&comma;y&comma;z&colon;evalVFF&comma;3&comma;3&comma;3&semi;DivergenceF&semi;CurlF&semi;JacobianF&comma;x&comma;y&comma;zend use

9927

y2+2x

2x00z0x02yzy2

(7.7)

VectorCalculus provides far more functionality than what is possible using linalg. For a full overview, see the demonstration The Vector Calculus Package on the Maple Application Center .

Programming Hints

Package use

Both LinearAlgebra and linalg are implemented as Maple packages. Using with to load these packages results in their individual component routines' names becoming available for use directly.

>

m:=matrix2&comma;2&comma;1&comma;2&comma;3&comma;5&colon;

>

withlinalg&colon;

>

adjointm

>

inversem

5231

5231

(8.1.1)
>

M:=Matrix2&comma;2&comma;1&comma;2&comma;3&comma;5&colon;

>

withLinearAlgebra&colon;

>

AdjointM

>

MatrixInverseM

The LinearAlgebra and linalg packages are implemented as modules. Since both are Maple packages, they share the following long-form calling syntax in the case that neither package has been loaded. The component routines can always be called directly.

>

m:=matrix2&comma;2&comma;1&comma;2&comma;3&comma;5&colon;

>

linalgadjointm

5231

(8.1.2)
>

M:=Matrix2&comma;2&comma;1&comma;2&comma;3&comma;5&colon;

>

LinearAlgebraAdjointM

Since the LinearAlgebra package is a module, it also offers another long-form syntax for calling a routine directly.

>

LinearAlgebra:-AdjointM

Basic arithmetic involving matrix and vector objects, as used by linalg, can be accomplished through use of evalm.

>

evalmm&plus;m &* m

8142136

(8.1.3)

Such arithmetic is available for Matrix and Vector objects, as used by LinearAlgebra, directly.

>

M&plus;M&period;M

Use of evalm when performing operations with Matrix and Vector objects is not advised; it introduces unnecessary inefficiency to the operations.

Evaluation

The matrix and vector objects used in the linalg package have last name evaluation. Assignment chains involving these objects are only normally evaluated to the last name in the chain. Here are some examples.

>

v&apos;v&apos;&colon; u&apos;u&apos;&colon;

>

vu

>

u:=vector2&comma;1&comma;2

v:=u

u:=12

(8.2.1)
>

v

>

u

>

evalu

>

evalv

u

u

12

12

(8.2.2)
>

v17

>

u213

>

evalu

>

evalv

v1:=7

u2:=13

713

713

(8.2.3)

The Matrix and Vector objects in the LinearAlgebra package do not follow last name evaluation. As a result, you do not need to specify a full evaluation, at the Maple top-level, to display the entries.

>

V:=&apos;V&apos;&colon;U&apos;U&apos;&colon;

>

VU

V:=U

(8.2.4)
>

UVector2&comma;1&comma;2

>

V

>

U

>

V17

>

U213

>

U

>

V

V1:=7

U2:=13

Output objects versus side-effects

Several linalg routines make use of side-effects on names to assign auxiliary results.

Here, QRdecomp has made an assignment to q as a side-effect of the operation that computed r.

>

r&apos;r&apos;&colon;q&apos;q&apos;&colon;

>

mmatrix2&comma;2&comma;1&comma;2&comma;3&comma;5&semi;

>

rlinalgQRdecompm&comma;&apos;Q&apos;&equals;&apos;q&apos;&semi;

>

evalq

m:=1235

r:=10171010011010

11010310103101011010

(8.3.1)

The routines in the LinearAlgebra package use multiple-assignment instead of side-effects in order to assign auxiliary results.

>

R:=&apos;R&apos;&colon;Q&apos;Q&apos;&colon;

>

MMatrix2&comma;2&comma;1&comma;2&comma;3&comma;5&semi;

>

R&comma;QLinearAlgebraQRDecompositionM&comma;&apos;output&apos;&equals;&apos;R&apos;&comma;&apos;Q&apos;

>

See Also

Return to Index for Example Worksheets


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /