Generated by DocFX

Class LuDecomposition

LU decomposition of a multidimensional rectangular matrix.

Inheritance
System.Object
LuDecomposition
Implements
ISolverMatrixDecomposition<System.Double>
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 Source

LuDecomposition(Double[,])

Constructs a new LU decomposition.

Declaration
public LuDecomposition(double[, ] value)
Parameters
Type Name Description
System.Double[,] value

The matrix A to be decomposed.

View Source

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.

View Source

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 value matrix rather than on a copy of it. If true, the matrix will be destroyed during the decomposition. Default is false.

Properties

View Source

Determinant

Returns the determinant of the matrix.

Declaration
public double Determinant { get; }
Property Value
Type Description
System.Double
View Source

LogDeterminant

Returns the log-determinant of the matrix.

Declaration
public double LogDeterminant { get; }
Property Value
Type Description
System.Double
View Source

LowerTriangularFactor

Returns the lower triangular factor L with A=LU.

Declaration
public double[, ] LowerTriangularFactor { get; }
Property Value
Type Description
System.Double[,]
View Source

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.

View Source

PivotPermutationVector

Returns the pivot permutation vector.

Declaration
public int[] PivotPermutationVector { get; }
Property Value
Type Description
System.Int32[]
View Source

UpperTriangularFactor

Returns the lower triangular factor L with A=LU.

Declaration
public double[, ] UpperTriangularFactor { get; }
Property Value
Type Description
System.Double[,]

Methods

View Source

Clone()

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.

View Source

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 methods.

Declaration
public double[, ] GetInformationMatrix()
Returns
Type Description
System.Double[,]
View Source

Inverse()

Solves a set of equation systems of type A * X = I.

Declaration
public double[, ] Inverse()
Returns
Type Description
System.Double[,]
View Source

Reverse()

Reverses the decomposition, reconstructing the original matrix X.

Declaration
public double[, ] Reverse()
Returns
Type Description
System.Double[,]
View Source

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 A.

Returns
Type Description
System.Double[]

Matrix X so that L * U * X = B.

View Source

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 A and any number of columns.

Returns
Type Description
System.Double[,]

Matrix X so that L * U * X = B.

View Source

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 A and any number of rows.

Returns
Type Description
System.Double[,]

Matrix X so that X * L * U = A.

Implements

ISolverMatrixDecomposition<T>

Extension Methods

Matrix.Replace<T>(T, Object, Object)
Matrix.IsEqual(Object, Object, Decimal, Decimal)
EntityBaseExtensions.HasProperty(Object, String)
ArrayExtensions.Concatenate<T>(T, T[])
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>, Func<TSource, Boolean>)
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>)
ObjectExtensions.Clone<T>(T)
ObjectExtensions.To<T>(Object)
ObjectExtensions.To(Object, Type)
ObjectExtensions.HasMethod(Object, String)
ObjectExtensions.AddressOf<T>(T)
ReflectionExtensions.GetIdentityValue<T>(T)
ReflectionExtensions.GetIdentityValue<T, TResult>(T)
ReflectionExtensions.GetIdentityProperty<T>(T)
ReflectionExtensions.HasIdentityProperty<T>(T)
ReflectionExtensions.GetPropertyValue<T, TResult>(T, String, TResult)
ReflectionExtensions.GetPropertyInfo<T, TValue>(T, Expression<Func<T, TValue>>)
ReflectionExtensions.GetTitleValue<T>(T)
ReflectionExtensions.HasParentIdentityProperty<T>(T)
ReflectionExtensions.GetParentIdentityProperty<T>(T)
ReflectionExtensions.IsFreeApplication<T>(T)