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
DotNetMatrix.LUDecomposition Class Reference

LU Decomposition. For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n unit lower triangular matrix L, an n-by-n upper triangular matrix U, and a permutation vector piv of length m so that A(piv,:) = L*U. More...

+ Inheritance diagram for DotNetMatrix.LUDecomposition:
+ Collaboration diagram for DotNetMatrix.LUDecomposition:

Public Member Functions

 LUDecomposition (GeneralMatrix A)
 LU Decomposition More...
 
virtual double Determinant ()
 Determinant More...
 
virtual GeneralMatrix Solve (GeneralMatrix B)
 Solve A*X = B More...
 
 LUDecomposition (GeneralMatrix A)
 LU Decomposition More...
 
virtual double Determinant ()
 Determinant More...
 
virtual GeneralMatrix Solve (GeneralMatrix B)
 Solve A*X = B More...
 

Properties

virtual bool IsNonSingular [get]
 Is the matrix nonsingular? More...
 
virtual GeneralMatrix L [get]
 Return lower triangular factor More...
 
virtual GeneralMatrix U [get]
 Return upper triangular factor More...
 
virtual int[] Pivot [get]
 Return pivot permutation vector More...
 
virtual double[] DoublePivot [get]
 Return pivot permutation vector as a one-dimensional double array More...
 

Private Member Functions

void ISerializable. GetObjectData (SerializationInfo info, StreamingContext context)
 
void ISerializable. GetObjectData (SerializationInfo info, StreamingContext context)
 

Private Attributes

double[][] LU
 Array for internal storage of decomposition. internal array storage. More...
 
int m
 Row and column dimensions, and pivot sign. column dimension. row dimension. pivot sign. More...
 
int n
 
int pivsign
 
int[] piv
 Internal storage of pivot vector. pivot vector. More...
 

Detailed Description

LU Decomposition. For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n unit lower triangular matrix L, an n-by-n upper triangular matrix U, and a permutation vector piv of length m so that A(piv,:) = L*U.

If m < n, then L is m-by-m and U is m-by-n. The LU decompostion with pivoting always exists, even if the matrix is singular, so the constructor will never fail. The primary use of the LU decomposition is in the solution of square systems of simultaneous linear equations. This will fail if IsNonSingular() returns false.

Constructor & Destructor Documentation

DotNetMatrix.LUDecomposition.LUDecomposition ( GeneralMatrix  A)
inline
DotNetMatrix.LUDecomposition.LUDecomposition ( GeneralMatrix  A)
inline

Member Function Documentation

virtual double DotNetMatrix.LUDecomposition.Determinant ( )
inlinevirtual

Determinant

Returns
det(A)
Exceptions
System.ArgumentExceptionMatrix must be square

References DotNetMatrix.LUDecomposition.n.

Referenced by DotNetMatrix.GeneralMatrix.Determinant().

virtual GeneralMatrix DotNetMatrix.LUDecomposition.Solve ( GeneralMatrix  B)
inlinevirtual

Solve A*X = B

Parameters
BA Matrix with as many rows as A and any number of columns.
Returns
X so that L*U*X = B(piv,:)
Exceptions
System.ArgumentExceptionMatrix row dimensions must agree.
System.SystemExceptionMatrix is singular.

References DotNetMatrix.GeneralMatrix.Array, DotNetMatrix.GeneralMatrix.ColumnDimension, DotNetMatrix.GeneralMatrix.GetMatrix(), DotNetMatrix.LUDecomposition.IsNonSingular, DotNetMatrix.LUDecomposition.n, and DotNetMatrix.GeneralMatrix.RowDimension.

void ISerializable. DotNetMatrix.LUDecomposition.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
inlineprivate
virtual double DotNetMatrix.LUDecomposition.Determinant ( )
inlinevirtual

Determinant

Returns
det(A)
Exceptions
System.ArgumentExceptionMatrix must be square

References DotNetMatrix.LUDecomposition.n.

virtual GeneralMatrix DotNetMatrix.LUDecomposition.Solve ( GeneralMatrix  B)
inlinevirtual

Solve A*X = B

Parameters
BA Matrix with as many rows as A and any number of columns.
Returns
X so that L*U*X = B(piv,:)
Exceptions
System.ArgumentExceptionMatrix row dimensions must agree.
System.SystemExceptionMatrix is singular.

References DotNetMatrix.GeneralMatrix.Array, DotNetMatrix.GeneralMatrix.ColumnDimension, DotNetMatrix.GeneralMatrix.GetMatrix(), DotNetMatrix.LUDecomposition.IsNonSingular, DotNetMatrix.LUDecomposition.n, and DotNetMatrix.GeneralMatrix.RowDimension.

void ISerializable. DotNetMatrix.LUDecomposition.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
inlineprivate

Member Data Documentation

double [][] DotNetMatrix.LUDecomposition.LU
private

Array for internal storage of decomposition. internal array storage.

int DotNetMatrix.LUDecomposition.m
private

Row and column dimensions, and pivot sign. column dimension. row dimension. pivot sign.

Referenced by DotNetMatrix.LUDecomposition.LUDecomposition().

int DotNetMatrix.LUDecomposition.pivsign
private
int [] DotNetMatrix.LUDecomposition.piv
private

Internal storage of pivot vector. pivot vector.

Property Documentation

bool DotNetMatrix.LUDecomposition.IsNonSingular
get

Is the matrix nonsingular?

Returns
true if U, and hence A, is nonsingular.

Referenced by DotNetMatrix.LUDecomposition.Solve().

GeneralMatrix DotNetMatrix.LUDecomposition.L
get

Return lower triangular factor

Returns
L

Referenced by DotNetMatrix.test.TestMatrix.Main(), and DotNetMatrix.examples.MagicSquareExample.Main().

GeneralMatrix DotNetMatrix.LUDecomposition.U
get

Return upper triangular factor

Returns
U

Referenced by DotNetMatrix.test.TestMatrix.Main(), and DotNetMatrix.examples.MagicSquareExample.Main().

virtual int [] DotNetMatrix.LUDecomposition.Pivot
get

Return pivot permutation vector

Returns
piv

Referenced by DotNetMatrix.test.TestMatrix.Main(), and DotNetMatrix.examples.MagicSquareExample.Main().

virtual double [] DotNetMatrix.LUDecomposition.DoublePivot
get

Return pivot permutation vector as a one-dimensional double array

Returns
(double) piv

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