IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Meta.Numerics.Matrices.LUDecomposition Class Reference

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
 

Detailed Description

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.

See also
SquareMatrix

Member Function Documentation

double Meta.Numerics.Matrices.LUDecomposition.Determinant ( )
inline

Computes the determinant of the original matrix.

Returns
The determinant of the original matrix.

Referenced by Test.SquareMatrixTest.SquareUnitMatrixLUDecomposition(), and Test.SquareMatrixTest.SquareVandermondeMatrixLUDecomposition().

ColumnVector Meta.Numerics.Matrices.LUDecomposition.Solve ( IList< double >  rhs)
inline

Solves A x = b.

Parameters
rhsThe right-hand side vector b.
Returns
The solution vector x.
Exceptions
ArgumentNullExceptionrhs is null.
DimensionMismatchExceptionThe 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().

SquareMatrix Meta.Numerics.Matrices.LUDecomposition.Inverse ( )
inline

Computes the the inverse of the original matrix.

Returns
The independent inverse of the original matrix.

Referenced by Test.SquareMatrixTest.SquareRandomMatrixLUDecomposition(), Test.SquareMatrixTest.SquareUnitMatrixLUDecomposition(), and Test.SquareMatrixTest.SquareVandermondeMatrixLUDecomposition().

SquareMatrix Meta.Numerics.Matrices.LUDecomposition.LMatrix ( )
inline

Gets the L factor.

Returns
The lower-left trangular factor L of the LU decomposition.

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().

SquareMatrix Meta.Numerics.Matrices.LUDecomposition.UMatrix ( )
inline

Gets the U factor.

Returns
The upper-right triangular factor U of the LU decomposition.

Referenced by Test.SquareMatrixTest.SquareRandomMatrixLUDecomposition(), and Test.SquareMatrixTest.SquareVandermondeMatrixLUDecomposition().

SquareMatrix Meta.Numerics.Matrices.LUDecomposition.PMatrix ( )
inline

Gets the permutation matrix.

Returns
The permutation matrix P in the PA = LU decomposition.

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().

Member Data Documentation

double [] Meta.Numerics.Matrices.LUDecomposition.luStore
private
int [] Meta.Numerics.Matrices.LUDecomposition.permutation
private
int Meta.Numerics.Matrices.LUDecomposition.parity
private
int Meta.Numerics.Matrices.LUDecomposition.dimension
private

Property Documentation

int Meta.Numerics.Matrices.LUDecomposition.Dimension
get

Gets the dimension of the system.

Referenced by Test.SquareMatrixTest.SquareRandomMatrixLUDecomposition().


The documentation for this class was generated from the following file: