IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
Represents the LU decomposition of a square matrix. More...
Public Member Functions | |
double | Determinant () |
Computes the determinant of the original matrix. More... | |
ColumnVector | Solve (IList< double > rhs) |
Solves A x = b. More... | |
SquareMatrix | Inverse () |
Computes the the inverse of the original matrix. More... | |
SquareMatrix | LMatrix () |
Gets the L factor. More... | |
SquareMatrix | UMatrix () |
Gets the U factor. More... | |
SquareMatrix | PMatrix () |
Gets the permutation matrix. More... | |
Properties | |
int | Dimension [get] |
Gets the dimension of the system. More... | |
Private Attributes | |
double[] | luStore |
int[] | permutation |
int | parity |
int | dimension |
Represents the LU decomposition of a square matrix.
An LU decomposition is a representation of a matrix M as the product of a lower-left-triagular matrix L and and an upper-right-triangular matrix U. To reduce numerical instabilities, we actually decompose a row-wise permutation of a matrix, so that we have P A = L U, where P is a permutation matrix.
For example, here is an LU decomposition of a permutation of a simple 3 X 3 matrix:
Given an LU decomposition of a permutation A, we can solve systems of linear equations or compute the determinant or inverse of A. LU decomposition is the fastest way to solve an arbitrary system of linear equations. It is much faster, and less subject to rounding errors, to solve Ax=b by LU decomposition than than by inverting A and multiplying A-1b.
You can use the SquareMatrix.LUDecomposition method to obtain the LU decomposition of any non-singular square matrix.
|
inline |
Computes the determinant of the original matrix.
Referenced by Test.SquareMatrixTest.SquareUnitMatrixLUDecomposition(), and Test.SquareMatrixTest.SquareVandermondeMatrixLUDecomposition().
|
inline |
Solves A x = b.
rhs | The right-hand side vector b. |
ArgumentNullException | rhs is null . |
DimensionMismatchException | The dimension of rhs is not the same as the dimension of the matrix. |
Referenced by Meta.Numerics.Analysis.FunctionMath.FindZero(), Test.SparseSquareMatrixTest.SparseSquareMatrixSolutionAgreement(), Test.SquareMatrixTest.SquareRandomMatrixLUDecomposition(), and Test.SquareMatrixTest.SquareVandermondeMatrixLUDecomposition().
|
inline |
Computes the the inverse of the original matrix.
Referenced by Test.SquareMatrixTest.SquareRandomMatrixLUDecomposition(), Test.SquareMatrixTest.SquareUnitMatrixLUDecomposition(), and Test.SquareMatrixTest.SquareVandermondeMatrixLUDecomposition().
|
inline |
Gets the L factor.
The pivoted LU decomposition algorithm guarantees that the diagonal entries of this matrix are all one, and that the magnitudes of the sub-diagonal entries are all less than or equal to one.
Referenced by Test.SquareMatrixTest.SquareRandomMatrixLUDecomposition(), and Test.SquareMatrixTest.SquareVandermondeMatrixLUDecomposition().
|
inline |
Gets the U factor.
Referenced by Test.SquareMatrixTest.SquareRandomMatrixLUDecomposition(), and Test.SquareMatrixTest.SquareVandermondeMatrixLUDecomposition().
|
inline |
Gets the permutation matrix.
A permutation matrix is just a "scrambled" identity matrix: 1 appears exactly once in each row and column, but not necessarily in the diagonal position.
Referenced by Test.SquareMatrixTest.SquareRandomMatrixLUDecomposition(), and Test.SquareMatrixTest.SquareVandermondeMatrixLUDecomposition().
|
private |
|
private |
|
private |
|
private |
|
get |
Gets the dimension of the system.
Referenced by Test.SquareMatrixTest.SquareRandomMatrixLUDecomposition().