Class LU
- java.lang.Object
-
- dev.nm.algebra.linear.matrix.doubles.factorization.triangle.LU
-
- All Implemented Interfaces:
LUDecomposition
public class LU extends Object implements LUDecomposition
LU decomposition decomposes an n x n matrix A so that P * A = L * U. P is an n x n permutation matrix. L is an n x n lower triangular matrix. U is an n x n upper triangular matrix. That is,P.multiply(A) == L.multiply(U)- See Also:
- Wikipedia: LU decomposition
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LowerTriangularMatrixL()Get the lower triangular matrix L as in the LU decomposition.PermutationMatrixP()Get the permutation matrix P as in P * A = L * U.UpperTriangularMatrixU()Get the upper triangular matrix U as in the LU decomposition.
-
-
-
Constructor Detail
-
LU
public LU(Matrix A, double epsilon)
Run the LU decomposition on a square matrix.- Parameters:
A- a square matrixepsilon- a precision parameter: when a number |x| ≤ ε, it is considered 0
-
LU
public LU(Matrix A)
Run the LU decomposition on a square matrix.- Parameters:
A- a matrix
-
-
Method Detail
-
L
public LowerTriangularMatrix L()
Description copied from interface:LUDecompositionGet the lower triangular matrix L as in the LU decomposition.- Specified by:
Lin interfaceLUDecomposition- Returns:
- L
-
U
public UpperTriangularMatrix U()
Description copied from interface:LUDecompositionGet the upper triangular matrix U as in the LU decomposition.- Specified by:
Uin interfaceLUDecomposition- Returns:
- U
-
P
public PermutationMatrix P()
Description copied from interface:LUDecompositionGet the permutation matrix P as in P * A = L * U.- Specified by:
Pin interfaceLUDecomposition- Returns:
- P
-
-