Student[NumericalAnalysis][MatrixDecomposition] - factor a matrix
|
Calling Sequence
|
|
MatrixDecomposition(A, opts)
|
|
Parameters
|
|
A
|
-
|
Matrix; a square matrix
|
opts
|
-
|
(optional) equation(s) of the form keyword=value, where keyword is one of digits, method, output, showsteps; the options for factoring the matrix A
|
|
|
|
|
Description
|
|
•
|
Matrix decomposition is used to reduce the general linear system A.x=b to more manageable triangular systems.
|
•
|
The MatrixDecomposition command can perform the following decompositions: LU, PLU, LU Tridiagonal, PLU Scaled, LDU, LDLt and Cholesky.
|
|
|
Options
|
|
|
The number of digits of precision in which the computations will be performed. By default, digits will be set to the environment variable Digits.
|
•
|
method = LU, PLU, LU[tridiagonal], PLU[scaled], LDU, LDLt, Cholesky
|
|
The type of decomposition to perform.
|
|
By default, method = PLU. See the output option below for a description of the possible return value(s) for each method.
|
|
The return value for the function. L represents the lower-triangular matrix, U represents the upper-triangular matrix and D represents the diagonal matrix.
|
–
|
If method = LU then output can be one or more of L, U, Mmatrices, where output = Mmatrices returns a list of Gaussian transformation matrices. By default, output = [L, U].
|
–
|
If method = PLU then output can be one or more of P, L, U, Mmatrices, Ematrices, where output = Mmatrices returns a list of Gaussian transformation matrices and output = Ematrices returns a list of permutation matrices. By default, output = [P, L, U].
|
–
|
If method = LU[tridiagonal] then output can be one or more of L, U. By default, output = [L, U].
|
–
|
If method = PLU[scaled] then output can be one or more of P, L, U, Mmatrices, Ematrices, where output = Mmatrices returns a list of Gaussian transformation matrices and output = Ematrices returns a list of permutation matrices. By default, output = [P, L, U].
|
–
|
If method = LDU then output can be one or more of L, D, U. By default, output = [L, D, U].
|
–
|
If method = LDLt then output can be one or more of L, D, Lt, where output = Lt returns the unit upper-triangular matrix. By default, output = [L, D, Lt].
|
–
|
If method = Cholesky then output can be one or more of R, Rt, where output = R returns the lower-triangular matrix and output = Rt returns the transpose of the lower-triangular matrix. By default, output = [R, Rt].
|
•
|
showsteps = true or false
|
|
Whether to print helpful statements into the interface as the command executes. This option is only available when output = LU, PLU or PLU[scaled]. By default, showsteps = false.
|
|
|
Notes
|
|
•
|
Matrix decomposition is also sometimes referred to as matrix factorization. The terms are interchangeable.
|
•
|
When the method is set to either LU or LDU, this procedure operates symbolically; that is, the inputs are not automatically evaluated to floating-point quantities, and computations proceed symbolically and exactly whenever possible. To obtain floating-point results, it is necessary to supply floating-point inputs.
|
•
|
Otherwise, this procedure operates numerically; that is, if the inputs are not already numeric, they are first evaluated to floating-point quantities before computations proceed. The outputs will be numeric as well. Note that exact rationals are considered numeric and are preserved whenever possible throughout the computation; therefore, one must specify floating-point inputs instead of exact rationals to obtain floating-point outputs.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
Try an LU decomposition
>
|
|
| (2) |
>
|
|
| (3) |
Check that
>
|
|
| (4) |
>
|
|
| (5) |
Try a PLU decomposition
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
>
|
|
| (9) |
Perform a Cholesky decomposition
>
|
|
| (10) |
First check that A is positive definite
>
|
|
| (11) |
>
|
|
| (12) |
|
|