public class CholeskyDecomposition extends Object implements Destroyable
This class inspired by class from Apache Common Math with similar name.
Modifier and Type | Field and Description |
---|---|
static double |
DFLT_ABS_POSITIVITY_THRESHOLD
Default threshold below which diagonal elements are considered null
and matrix not positive definite.
|
static double |
DFLT_REL_SYMMETRY_THRESHOLD
Default threshold above which off-diagonal elements are considered too different
and matrix not symmetric.
|
Constructor and Description |
---|
CholeskyDecomposition(Matrix mtx)
Calculates the Cholesky decomposition of the given matrix.
|
CholeskyDecomposition(Matrix mtx,
double relSymmetryThreshold,
double absPositivityThreshold)
Calculates the Cholesky decomposition of the given matrix.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys object if managed outside of JVM.
|
double |
getDeterminant()
Return the determinant of the matrix
|
Matrix |
getL()
Returns the matrix L of the decomposition.
|
Matrix |
getLT()
Returns the transpose of the matrix L of the decomposition.
|
Matrix |
solve(Matrix b)
Solve the linear equation A × X = B for matrices A.
|
Vector |
solve(Vector b)
Solve the linear equation A × X = B for matrices A.
|
public static final double DFLT_REL_SYMMETRY_THRESHOLD
public static final double DFLT_ABS_POSITIVITY_THRESHOLD
public CholeskyDecomposition(Matrix mtx)
Calling this constructor is equivalent to call CholeskyDecomposition(Matrix, double, double)
with the
thresholds set to the default values DFLT_REL_SYMMETRY_THRESHOLD
and
DFLT_ABS_POSITIVITY_THRESHOLD
.
mtx
- the matrix to decompose.CardinalityException
- if matrix is not square.CholeskyDecomposition(Matrix, double, double)
,
DFLT_REL_SYMMETRY_THRESHOLD
,
DFLT_ABS_POSITIVITY_THRESHOLD
public CholeskyDecomposition(Matrix mtx, double relSymmetryThreshold, double absPositivityThreshold)
mtx
- the matrix to decompose.relSymmetryThreshold
- threshold above which off-diagonal elements are considered too different and matrix
not symmetricabsPositivityThreshold
- threshold below which diagonal elements are considered null and matrix not positive
definiteCholeskyDecomposition(Matrix)
,
DFLT_REL_SYMMETRY_THRESHOLD
,
DFLT_ABS_POSITIVITY_THRESHOLD
public void destroy()
destroy
in interface Destroyable
public Matrix getL()
L is an lower-triangular matrix
public Matrix getLT()
LT is an upper-triangular matrix
public double getDeterminant()
public Vector solve(Vector b)
b
- right-hand side of the equation A × X = BCardinalityException
- if the vectors dimensions do not matchpublic Matrix solve(Matrix b)
b
- right-hand side of the equation A × X = BCardinalityException
- if the matrices dimensions do not match
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018