Class ComplexCholesky
An abstract base class for Cholesky decomposition of Hermitian (or Hermitian) positive-definite matrices.
The Cholesky decomposition factorizes a Hermitian/Hermitian, positive-definite matrix \( A \) as: \[ A = LL^{H} \] where \( L \) is a lower triangular matrix. The decomposition is primarily used for efficient numerical solutions to linear systems, computing matrix inverses, and generating samples from multivariate normal distributions.
Hermitian Verification:
This class provides an option to explicitly check whether the input matrix is Hermitian. If enforceHermitian
is set
to true
, the implementation will verify that \( A \) satisfies
\( A = A^{H} \) before performing decomposition.
If set to false
, the matrix is assumed to be Hermitian, no explicit check will be performed, and only the lower-diagonal
entries of \( A \) are accessed.
positive-definiteness Check:
To ensure numerical stability, the algorithm verifies that all diagonal entries of \( L \)
are positive. A tolerance threshold, posDefTolerance
, is used to determine whether a diagonal entry is considered
non-positive, indicating that the matrix is not positive-definite. This threshold can be adjusted using
Cholesky.setPosDefTolerance(double)
.
Usage:
A typical workflow using a concrete implementation of Cholesky decomposition follows these steps:
- Instantiate an instance of
ComplexCholesky
. - Call
decompose(CMatrix)
to compute the decomposition. - Retrieve the factorized matrices using
Cholesky.getL()
orCholesky.getLH()
.
- See Also:
-
Field Summary
Fields inherited from class org.flag4j.linalg.decompositions.chol.Cholesky
enforceHermitian, L, posDefTolerance, SYM_POS_DEF_ERR
Fields inherited from class org.flag4j.linalg.decompositions.Decomposition
hasDecomposed
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a complex Cholesky decomposer.ComplexCholesky
(boolean enforceHermitian) Constructs a complex Cholesky decomposer. -
Method Summary
Modifier and TypeMethodDescriptionDecompose a matrix into \( A = LL^{H \) where \( L \) is a lower triangular matrix and \( L^{H} \) is the conjugate transpose of \( L \).Methods inherited from class org.flag4j.linalg.decompositions.chol.Cholesky
getL, getLH, setPosDefTolerance
Methods inherited from class org.flag4j.linalg.decompositions.Decomposition
ensureHasDecomposed
-
Constructor Details
-
ComplexCholesky
public ComplexCholesky()Constructs a complex Cholesky decomposer.
-
ComplexCholesky
public ComplexCholesky(boolean enforceHermitian) Constructs a complex Cholesky decomposer.- Parameters:
enforceHermitian
- Flag indicating if an explicit check should be made that the matrix to be decomposed is Hermitian.- If
true
, the matrix will be explicitly verified to be Hermitian. - If
false
, no check will be made to verify the matrix is Hermitian, and it will be assumed to be.
- If
-
-
Method Details
-
decompose
Decompose a matrix into \( A = LL^{H \) where \( L \) is a lower triangular matrix and \( L^{H} \) is the conjugate transpose of \( L \).- Specified by:
decompose
in classDecomposition<CMatrix>
- Parameters:
src
- The source matrix to decompose. Must be Hermitian positive-definite.- Returns:
- A reference to this decomposer.
- Throws:
IllegalArgumentException
- Ifsrc.numRows != src.numCols
orsrc
is not Hermitian andenforceHermitian
was set to true when this decomposer was instantiated.LinearAlgebraException
- Ifsrc
is not positive-definite.
-