public class LUDecomposition extends Object implements AutoCloseable
This class is inspired by class from Apache Common Math with similar name.
Constructor and Description |
---|
LUDecomposition(Matrix matrix)
Calculates the LU-decomposition of the given matrix.
|
LUDecomposition(Matrix matrix,
double singularityThreshold)
Calculates the LUP-decomposition of the given matrix.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Destroys decomposition components and other internal components of decomposition.
|
double |
determinant()
Return the determinant of the matrix.
|
Matrix |
getL()
Returns the matrix L of the decomposition.
|
Matrix |
getP()
Returns the P rows permutation matrix.
|
Vector |
getPivot()
Returns the pivot permutation vector.
|
Matrix |
getU()
Returns the matrix U of the decomposition.
|
Matrix |
solve(Matrix b) |
Vector |
solve(Vector b) |
public LUDecomposition(Matrix matrix)
matrix
- Matrix to decompose.CardinalityException
- if matrix is not square.public LUDecomposition(Matrix matrix, double singularityThreshold)
matrix
- Matrix to decompose.singularityThreshold
- threshold (based on partial row norm).CardinalityException
- if matrix is not square.public void close()
close
in interface AutoCloseable
public Matrix getL()
L is a lower-triangular matrix
public Matrix getU()
U is an upper-triangular matrix
public Matrix 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
.
getPivot()
public Vector getPivot()
getP()
public double determinant()
public Vector solve(Vector b)
b
- Vector to solve using this decomposition.
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024