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 LowerTriangularMatrix
L()
Get the lower triangular matrix L as in the LU decomposition.PermutationMatrix
P()
Get the permutation matrix P as in P * A = L * U.UpperTriangularMatrix
U()
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:LUDecomposition
Get the lower triangular matrix L as in the LU decomposition.- Specified by:
L
in interfaceLUDecomposition
- Returns:
- L
-
U
public UpperTriangularMatrix U()
Description copied from interface:LUDecomposition
Get the upper triangular matrix U as in the LU decomposition.- Specified by:
U
in interfaceLUDecomposition
- Returns:
- U
-
P
public PermutationMatrix P()
Description copied from interface:LUDecomposition
Get the permutation matrix P as in P * A = L * U.- Specified by:
P
in interfaceLUDecomposition
- Returns:
- P
-
-