public class CholeskyDecompositionImpl extends java.lang.Object implements CholeskyDecomposition
The Cholesky decomposition of a real symmetric positive-definite matrix A consists of a lower triangular matrix L with same size that satisfy: A = LLTQ = I). In a sense, this is the square root of A.
Modifier and Type | Class and Description |
---|---|
private static class |
CholeskyDecompositionImpl.Solver
Specialized solver.
|
Modifier and Type | Field and Description |
---|---|
private RealMatrix |
cachedL
Cached value of L.
|
private RealMatrix |
cachedLT
Cached value of LT.
|
static double |
DEFAULT_ABSOLUTE_POSITIVITY_THRESHOLD
Default threshold below which diagonal elements are considered null
and matrix not positive definite.
|
static double |
DEFAULT_RELATIVE_SYMMETRY_THRESHOLD
Default threshold above which off-diagonal elements are considered too different
and matrix not symmetric.
|
private double[][] |
lTData
Row-oriented storage for LT matrix data.
|
Constructor and Description |
---|
CholeskyDecompositionImpl(RealMatrix matrix)
Calculates the Cholesky decomposition of the given matrix.
|
CholeskyDecompositionImpl(RealMatrix matrix,
double relativeSymmetryThreshold,
double absolutePositivityThreshold)
Calculates the Cholesky 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 |
getLT()
Returns the transpose of the matrix L of the decomposition.
|
DecompositionSolver |
getSolver()
Get a solver for finding the A × X = B solution in least square sense.
|
public static final double DEFAULT_RELATIVE_SYMMETRY_THRESHOLD
public static final double DEFAULT_ABSOLUTE_POSITIVITY_THRESHOLD
private double[][] lTData
private RealMatrix cachedL
private RealMatrix cachedLT
public CholeskyDecompositionImpl(RealMatrix matrix) throws NonSquareMatrixException, NotSymmetricMatrixException, NotPositiveDefiniteMatrixException
Calling this constructor is equivalent to call CholeskyDecompositionImpl(RealMatrix, double, double)
with the
thresholds set to the default values DEFAULT_RELATIVE_SYMMETRY_THRESHOLD
and DEFAULT_ABSOLUTE_POSITIVITY_THRESHOLD
matrix
- the matrix to decomposeNonSquareMatrixException
- if matrix is not squareNotSymmetricMatrixException
- if matrix is not symmetricNotPositiveDefiniteMatrixException
- if the matrix is not
strictly positive definiteCholeskyDecompositionImpl(RealMatrix, double, double)
,
DEFAULT_RELATIVE_SYMMETRY_THRESHOLD
,
DEFAULT_ABSOLUTE_POSITIVITY_THRESHOLD
public CholeskyDecompositionImpl(RealMatrix matrix, double relativeSymmetryThreshold, double absolutePositivityThreshold) throws NonSquareMatrixException, NotSymmetricMatrixException, NotPositiveDefiniteMatrixException
matrix
- the matrix to decomposerelativeSymmetryThreshold
- threshold above which off-diagonal
elements are considered too different and matrix not symmetricabsolutePositivityThreshold
- threshold below which diagonal
elements are considered null and matrix not positive definiteNonSquareMatrixException
- if matrix is not squareNotSymmetricMatrixException
- if matrix is not symmetricNotPositiveDefiniteMatrixException
- if the matrix is not
strictly positive definiteCholeskyDecompositionImpl(RealMatrix)
,
DEFAULT_RELATIVE_SYMMETRY_THRESHOLD
,
DEFAULT_ABSOLUTE_POSITIVITY_THRESHOLD
public RealMatrix getL()
L is an lower-triangular matrix
getL
in interface CholeskyDecomposition
public RealMatrix getLT()
LT is an upper-triangular matrix
getLT
in interface CholeskyDecomposition
public double getDeterminant()
getDeterminant
in interface CholeskyDecomposition
public DecompositionSolver getSolver()
getSolver
in interface CholeskyDecomposition
Copyright (c) 2003-2013 Apache Software Foundation