| IGLib 1.6.0 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
IG.Num.LUDecomposition Class Reference

LU decomposition of a matrix. More...

Inheritance diagram for IG.Num.LUDecomposition:
[legend]
Collaboration diagram for IG.Num.LUDecomposition:
[legend]

## Public Member Functions
| LUDecomposition (Matrix_MathNetNumerics A)
| Constructor. More...
| LUDecomposition (Matrix A)
| Constructor. More...
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. More...
IMatrix | GetProduct ()
| Calculates and returns the product (i.e. the original matrix of coefficients of a linear system of equations) of the current decomposition. More...
void | Inverse (ref IMatrix inv)
| Calculates inverse of the decomposed matrix represented by the current object, and stores it in the specified matrix. More...
IMatrix | Inverse ()
| Calculates and returns inverse of the decomposed matrix represented by the current object. More...
Public Member Functions inherited from IG.Num.LinearSolverBase
virtual void | Solve (IMatrix B, ref IMatrix X)
| Solves A*X = B (a set of linear systems of equations), where B is the matrix whose colums are right-hand sides of equations to be solved. Solutions are stored to the specified matrix. More...
IMatrix | Solve (IMatrix B)
| Solves A*X = B (a set of linear systems of equations), where B is the matrix whose colums are right-hand sides of equations to be solved, and returns a matrix whose columns are solutions of the specified systems of equations. More...
virtual void | Solve (IVector b, ref IVector x)
| Solves a system of linear equations A*x=b, and stores the solution in the specified vector. More...
IVector | Solve (IVector b)
| Solves a system of linear equations A*x=b, and returns the solution. More...
Public Member Functions inherited from IG.Num.ILinearSolver
void | Solve (IMatrix B, ref IMatrix X)
| Solves A*X = B (a set of linear systems of equations), where B is the matrix whose colums are right-hand sides of equations to be solved. Solutions are stored to the specified matrix. More...
IMatrix | Solve (IMatrix B)
| Solves A*X = B (a set of linear systems of equations), where B is the matrix whose colums are right-hand sides of equations to be solved, and returns a matrix whose columns are solutions of the specified systems of equations. More...
void | Solve (IVector b, ref IVector x)
| Solves a system of linear equations A*x=b, and stores the solution in the specified vector. More...
IVector | Solve (IVector b)
| Solves a system of linear equations A*x=b, and returns the solution. More...

## 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. More...
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. More...

## Protected Attributes
int[] | _pivot
double | _determinant
bool | _determinantCalculated = false
Protected Attributes inherited from IG.Num.LinearSolverBase
MatrixBase_MathNetNumerics | _matrixSolution_MathNetNumerics
Matrix_MathNetNumerics | _matrixRighthandSides_MathNetNumerics
VectorBase_MathNetNumerics | _vectorSolution_MathNetNumerics
Vector_MathNetNumerics | _vectorRighthandSides_MathNetNumerics
IVector | auxB = null
IVector | auxX = null

## Properties
bool | IsNonSingular`[get]`
| Indicates whether the matrix of coefficients of a linear system is nonsingular. More...
Matrix | L`[get]`
| Returns the lower triangular factor. More...
Matrix | U`[get]`
| Returns the upper triangular factor. More...
int[] | Pivot`[get]`
| Returns the integer pivot permutation vector of LU decomposition. More...
double | Determinant`[get]`
| Returns the determinant. More...
Properties inherited from IG.Num.LinearSolverBase
object | Lock`[get]`
| This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. More...
Properties inherited from IG.Num.ILinearSolver
bool | IsNonSingular`[get]`
| Indicates whether the matrix of coefficients of a linear system represented by the current decomposition object, is nonsingular. More...
Properties inherited from IG.Lib.ILockable
object | Lock`[get]`

## Detailed Description

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;

## Constructor & Destructor Documentation

IG.Num.LUDecomposition.LUDecomposition | ( | Matrix_MathNetNumerics | A | ) |
| inline

Constructor.

Parameters

  A | Matrix to be decomposed.

IG.Num.LUDecomposition.LUDecomposition | ( | Matrix | A | ) |
| inline

Constructor.

Parameters

  A | Matrix to be decomposed.

## Member Function Documentation

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.

Parameters

  product | Matrix where re-calculated product of the decomposed matrix is stored.

Implements IG.Num.ILinearSolver.

References IG.Num.Matrix.Copy().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesLU_IGLib().

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.

Parameters

  inv | Matrix where calculated inverse is stored.

Implements IG.Num.ILinearSolver.

References IG.Num.Matrix.Copy().

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.

Parameters

  righthandSides | Matrix that contains right-hand sides of the linear equations to be solved as its columns.

Returns
  The Math.Net Numerics matrix whose columns contains solutions to the systems of linear equations whose right-hand sides are specified by yhe righthandSides parameter.

Reimplemented from IG.Num.LinearSolverBase.

References IG.Num.Matrix.Copy().

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.

Parameters

  righthandSides | Vector of right-hand sides of the linear equations to be solved.

Returns
  The Math.Net Numerics vector whose columns contains solutions to the systems of linear equations whose right-hand sides are specified by yhe righthandSides parameter.

Reimplemented from IG.Num.LinearSolverBase.

References IG.Num.VectorBase.Copy().

## Member Data Documentation

int [] IG.Num.LUDecomposition._pivot
| protected

double IG.Num.LUDecomposition._determinant
| protected

bool IG.Num.LUDecomposition._determinantCalculated = false
| protected

## Property Documentation

bool IG.Num.LUDecomposition.IsNonSingular
| get

Indicates whether the matrix of coefficients of a linear system is nonsingular.

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

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

Returns the determinant.

Returns
  det(A)

Exceptions

  System.ArgumentException | Matrix must be square.

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

- igbase/numeric/MatrixDecompositions.cs