IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.
|
LU decomposition of a matrix. Objects of this class are immutable. Decomposition is calculated at initialization, and the decomposed matrix can not be replaced later. More...
Public Member Functions | |
LUDecomposition (Matrix_MathNetNumerics A) | |
Constructor. | |
LUDecomposition (Matrix A) | |
Constructor. | |
void | GetProduct (ref IMatrix product) |
Calculates the product (i.e. the original matrix of coefficients of a linear system of equations) of the current decomposition, and stores it to the specified matrix. | |
IMatrix | GetProduct () |
Calculates and returns the product (i.e. the original matrix of coefficients of a linear system of equations) of the current decomposition. | |
void | Inverse (ref IMatrix inv) |
Calculates inverse of the decomposed matrix represented by the current object, and stores it in the specified matrix. | |
IMatrix | Inverse () |
Calculates and returns inverse of the decomposed matrix represented by the current object. | |
Protected Member Functions | |
override MatrixBase_MathNetNumerics | SolveMathNetNumerics (IMatrix righthandSides) |
Solves systems of linear equations with the specified right-hand sides and the current matrix decomposition by using the Math.Net Numerics library, and returns the result in Math.Net matrix form. | |
override VectorBase_MathNetNumerics | SolveMathNetNumerics (IVector rightHandSides) |
Solves the system of linear equations with the specified right-hand sides and the current matrix decomposition by using the Math.Net Numerics library, and returns the result in Math.Net matrix form. | |
Protected Attributes | |
internal LUDecomposition_MathNetNumerics | Base = null |
int[] | _pivot |
double | _determinant |
bool | _determinantCalculated = false |
Properties | |
bool | IsNonSingular [get] |
Indicates whether the matrix of coefficients of a linear system is nonsingular. | |
Matrix | L [get] |
Returns the lower triangular factor. | |
Matrix | U [get] |
Returns the upper triangular factor. | |
int[] | Pivot [get] |
Returns the integer pivot permutation vector of LU decomposition. | |
double | Determinant [get] |
Returns the determinant. |
LU decomposition of a matrix.
Objects of this class are immutable. Decomposition is calculated at initialization, and the decomposed matrix can not be replaced later.
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 pivot 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 IsNonSingular() returns false.
$A Igor Nov08 Apr12;
IG::Num::LUDecomposition::LUDecomposition | ( | Matrix_MathNetNumerics | A | ) | [inline] |
Constructor.
A | Matrix to be decomposed. |
IG::Num::LUDecomposition::LUDecomposition | ( | Matrix | A | ) | [inline] |
Constructor.
A | Matrix to be decomposed. |
void IG::Num::LUDecomposition::GetProduct | ( | ref IMatrix | product | ) | [inline] |
Calculates the product (i.e. the original matrix of coefficients of a linear system of equations) of the current decomposition, and stores it to the specified matrix.
product | Matrix where re-calculated product of the decomposed matrix is stored. |
Implements IG::Num::ILinearSolver.
IMatrix IG::Num::LUDecomposition::GetProduct | ( | ) | [inline] |
Calculates and returns the product (i.e. the original matrix of coefficients of a linear system of equations) of the current decomposition.
Implements IG::Num::ILinearSolver.
void IG::Num::LUDecomposition::Inverse | ( | ref IMatrix | inv | ) | [inline] |
Calculates inverse of the decomposed matrix represented by the current object, and stores it in the specified matrix.
inv | Matrix where calculated inverse is stored. |
Implements IG::Num::ILinearSolver.
IMatrix IG::Num::LUDecomposition::Inverse | ( | ) | [inline] |
Calculates and returns inverse of the decomposed matrix represented by the current object.
Implements IG::Num::ILinearSolver.
override MatrixBase_MathNetNumerics IG::Num::LUDecomposition::SolveMathNetNumerics | ( | IMatrix | righthandSides | ) | [inline, protected, virtual] |
Solves systems of linear equations with the specified right-hand sides and the current matrix decomposition by using the Math.Net Numerics library, and returns the result in Math.Net matrix form.
righthandSides | Matrix that contains right-hand sides of the linear equations to be solved as its columns. |
Reimplemented from IG::Num::LinearSolverBase.
override VectorBase_MathNetNumerics IG::Num::LUDecomposition::SolveMathNetNumerics | ( | IVector | rightHandSides | ) | [inline, protected, virtual] |
Solves the system of linear equations with the specified right-hand sides and the current matrix decomposition by using the Math.Net Numerics library, and returns the result in Math.Net matrix form.
righthandSides | Vector of right-hand sides of the linear equations to be solved. |
Reimplemented from IG::Num::LinearSolverBase.
internal LUDecomposition_MathNetNumerics IG::Num::LUDecomposition::Base = null [protected] |
int [] IG::Num::LUDecomposition::_pivot [protected] |
double IG::Num::LUDecomposition::_determinant [protected] |
bool IG::Num::LUDecomposition::_determinantCalculated = false [protected] |
bool IG::Num::LUDecomposition::IsNonSingular [get] |
Indicates whether the matrix of coefficients of a linear system is nonsingular.
true
if U, and hence A, is nonsingular.Implements IG::Num::ILinearSolver.
Matrix IG::Num::LUDecomposition::L [get] |
Returns the lower triangular factor.
Matrix IG::Num::LUDecomposition::U [get] |
Returns the upper triangular factor.
int [] IG::Num::LUDecomposition::Pivot [get] |
Returns the integer pivot permutation vector of LU decomposition.
double IG::Num::LUDecomposition::Determinant [get] |