public class LUDecompositionImpl extends java.lang.Object implements LUDecomposition
The LUP-decomposition of a matrix A consists of three matrices L, U and P that satisfy: PA = LU, L is lower triangular, and U is upper triangular and P is a permutation matrix. All matrices are m×m.
As shown by the presence of the P matrix, this decomposition is implemented using partial pivoting.
| Constructor and Description |
|---|
LUDecompositionImpl(RealMatrix matrix)
Calculates the LU-decomposition of the given matrix.
|
LUDecompositionImpl(RealMatrix matrix,
double singularityThreshold)
Calculates the LU-decomposition of the given matrix.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getDeterminant()
Return the determinant of the matrix
|
RealMatrix |
getL()
Returns the matrix L of the decomposition.
|
RealMatrix |
getP()
Returns the P rows permutation matrix.
|
int[] |
getPivot()
Returns the pivot permutation vector.
|
DecompositionSolver |
getSolver()
Get a solver for finding the A × X = B solution in exact linear sense.
|
RealMatrix |
getU()
Returns the matrix U of the decomposition.
|
public LUDecompositionImpl(RealMatrix matrix) throws InvalidMatrixException
matrix - The matrix to decompose.InvalidMatrixException - if matrix is not squarepublic LUDecompositionImpl(RealMatrix matrix, double singularityThreshold) throws NonSquareMatrixException
matrix - The matrix to decompose.singularityThreshold - threshold (based on partial row norm)
under which a matrix is considered singularNonSquareMatrixException - if matrix is not squarepublic RealMatrix getL()
L is an lower-triangular matrix
getL in interface LUDecompositionpublic RealMatrix getU()
U is an upper-triangular matrix
getU in interface LUDecompositionpublic RealMatrix getP()
P is a sparse matrix with exactly one element set to 1.0 in each row and each column, all other elements being set to 0.0.
The positions of the 1 elements are given by the pivot permutation vector.
getP in interface LUDecompositionLUDecomposition.getPivot()public int[] getPivot()
getPivot in interface LUDecompositionLUDecomposition.getP()public double getDeterminant()
getDeterminant in interface LUDecompositionpublic DecompositionSolver getSolver()
getSolver in interface LUDecompositionCopyright © 2010 - 2023 Adobe. All Rights Reserved