Maven module :un.api : api-math :
Class : un.impl.math.malgebra.LUDecomposition
Extends/Implements : -
Subclasses : -

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.

Origin : JAMA http://math.nist.gov/javanumerics/jama/ placed in public domain.



Variables : -
Functions : LUDecomposition, isNonsingular, getL, getU, getPivot, getDoublePivot, det, solve




LU Decomposition
param  A Rectangular matrix
Structure to access L, U and piv.
public void LUDecomposition (Matrix A)


Is the matrix nonsingular?
return  true if U, and hence A, is nonsingular.
public boolean isNonsingular ()


Return lower triangular factor
return  L
public DefaultMatrix getL ()


Return upper triangular factor
return  U
public DefaultMatrix getU ()


Return pivot permutation vector
return  piv
public int[] getPivot ()


Return pivot permutation vector as a one-dimensional double array
return  (double) piv
public double[] getDoublePivot ()


Determinant
return  det(A)
exception  IllegalArgumentException Matrix must be square
public double det ()


Solve A*X = B
param  B A Matrix with as many rows as A and any number of columns.
return  X so that L*U*X = B(piv,:)
exception  IllegalArgumentException Matrix row dimensions must agree.
exception  RuntimeException Matrix is singular.
public MatrixRW solve (Matrix B)