Class LuDecomposition
LU decomposition of a multidimensional rectangular matrix.
Inheritance
Implements
Namespace: ISynergy.Framework.Mathematics.Decompositions
Assembly: ISynergy.Framework.Mathematics.dll
Syntax
public sealed class LuDecomposition : ICloneable, ISolverMatrixDecomposition<double>
Remarks
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 decomposition 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 Nonsingular returns false.
If you need to compute a LU decomposition for matrices with data types other than double. If you need to compute a LU decomposition for a jagged matrix. />.
Constructors
View SourceLuDecomposition(Double[,])
Constructs a new LU decomposition.
Declaration
public LuDecomposition(double[, ] value)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | value | The matrix A to be decomposed. |
LuDecomposition(Double[,], Boolean)
Constructs a new LU decomposition.
Declaration
public LuDecomposition(double[, ] value, bool transpose)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | value | The matrix A to be decomposed. |
System.Boolean | transpose | True if the decomposition should be performed on the transpose of A rather than A itself, false otherwise. Default is false. |
LuDecomposition(Double[,], Boolean, Boolean)
Constructs a new LU decomposition.
Declaration
public LuDecomposition(double[, ] value, bool transpose, bool inPlace)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | value | The matrix A to be decomposed. |
System.Boolean | transpose | True if the decomposition should be performed on the transpose of A rather than A itself, false otherwise. Default is false. |
System.Boolean | inPlace | True if the decomposition should be performed over the
|
Properties
View SourceDeterminant
Returns the determinant of the matrix.
Declaration
public double Determinant { get; }
Property Value
Type | Description |
---|---|
System.Double |
LogDeterminant
Returns the log-determinant of the matrix.
Declaration
public double LogDeterminant { get; }
Property Value
Type | Description |
---|---|
System.Double |
LowerTriangularFactor
Returns the lower triangular factor L
with A=LU
.
Declaration
public double[, ] LowerTriangularFactor { get; }
Property Value
Type | Description |
---|---|
System.Double[,] |
Nonsingular
Returns if the matrix is non-singular (i.e. invertible). Please see remarks for important information regarding numerical stability when using this method.
Declaration
public bool Nonsingular { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Please keep in mind this is not one of the most reliable methods for checking singularity of a matrix. For a more reliable method, please use IsSingular(Double[,]) or the SingularValueDecomposition.
PivotPermutationVector
Returns the pivot permutation vector.
Declaration
public int[] PivotPermutationVector { get; }
Property Value
Type | Description |
---|---|
System.Int32[] |
UpperTriangularFactor
Returns the lower triangular factor L
with A=LU
.
Declaration
public double[, ] UpperTriangularFactor { get; }
Property Value
Type | Description |
---|---|
System.Double[,] |
Methods
View SourceClone()
Creates a new object that is a copy of the current instance.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object | A new object that is a copy of this instance. |
GetInformationMatrix()
Computes (Xt * X)^1
(the inverse of the covariance matrix). This
matrix can be used to determine standard errors for the coefficients when
solving a linear set of equations through any of the
Declaration
public double[, ] GetInformationMatrix()
Returns
Type | Description |
---|---|
System.Double[,] |
Inverse()
Solves a set of equation systems of type A * X = I
.
Declaration
public double[, ] Inverse()
Returns
Type | Description |
---|---|
System.Double[,] |
Reverse()
Reverses the decomposition, reconstructing the original matrix X
.
Declaration
public double[, ] Reverse()
Returns
Type | Description |
---|---|
System.Double[,] |
Solve(Double[])
Solves a set of equation systems of type A * X = B
.
Declaration
public double[] Solve(double[] value)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | value | Right hand side column vector with as many rows as |
Returns
Type | Description |
---|---|
System.Double[] | Matrix |
Solve(Double[,])
Solves a set of equation systems of type A * X = B
.
Declaration
public double[, ] Solve(double[, ] value)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | value | Right hand side matrix with as many rows as |
Returns
Type | Description |
---|---|
System.Double[,] | Matrix |
SolveTranspose(Double[,])
Solves a set of equation systems of type X * A = B
.
Declaration
public double[, ] SolveTranspose(double[, ] value)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | value | Right hand side matrix with as many columns as |
Returns
Type | Description |
---|---|
System.Double[,] | Matrix |