Class RealCholesky
java.lang.Object
org.flag4j.linalg.decompositions.chol.Cholesky<Matrix>
org.flag4j.linalg.decompositions.chol.RealCholesky
- All Implemented Interfaces:
Decomposition<Matrix>
An instance of this class allows for the computation of a Cholesky decomposition for a
real dense matrix
.
Given a symmetric positive-definite matrix A
, the Cholesky decomposition will decompose it into
A=LL<sup>T</sup>
where L
is a lower triangular matrix and L<sup>T</sup>
is the
transpose of L
.
-
Field Summary
Fields inherited from class org.flag4j.linalg.decompositions.chol.Cholesky
DEFAULT_POS_DEF_TOLERANCE, enforceHermitian, L
-
Constructor Summary
ConstructorDescriptionConstructs a Cholesky decomposer.RealCholesky
(boolean enforceSymmetric) Constructs a Cholesky decomposer. -
Method Summary
Modifier and TypeMethodDescriptionDecompose a matrix intoA=LL
T whereL
is a lower triangular matrix andL
T is the transpose ofL
.
-
Constructor Details
-
RealCholesky
public RealCholesky()Constructs a Cholesky decomposer. If you would like to enforce a check for symmetry at the time of decomposition, seeRealCholesky(boolean)
. -
RealCholesky
public RealCholesky(boolean enforceSymmetric) Constructs a Cholesky decomposer.- Parameters:
enforceSymmetric
- Flag indicating if the symmetry of the matrix to be decomposed should be explicitly checked (true). If false, no check will be made and the matrix will be treated as if it were symmetric and only the lower half of the matrix will be accessed.
-
-
Method Details
-
decompose
Decompose a matrix intoA=LL
T whereL
is a lower triangular matrix andL
T is the transpose ofL
.- Parameters:
src
- The source matrix to decompose. Must be symmetric positive-definite. Note, symmetry will only be checked explicitly ifenforceSymmetric
was set to true when this decomposer was instantiated.- Returns:
- A reference to this decomposer.
- Throws:
IllegalArgumentException
- Ifsrc
is not symmetric andenforceSymmetric
was set to true when this decomposer was instantiated.LinearAlgebraException
- If this matrix is not positive-definite.
-