# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.algebra.linear.matrix.doubles.factorization.triangle.cholesky

## Class Chol

• java.lang.Object
• com.numericalmethod.suanshu.algebra.linear.matrix.doubles.factorization.triangle.cholesky.Chol
• All Implemented Interfaces:
Cholesky

public class Chol
extends Object
implements Cholesky
Cholesky decomposition decomposes a real, symmetric (hence square), and positive definite matrix A into A = L * Lt, where L is a lower triangular matrix. For any real, symmetric, positive definite matrix, there is a unique Cholesky decomposition, such that L's diagonal entries are all positive. This implementation uses the Cholesky-Banachiewicz algorithm, which starts from the upper left corner of the matrix L and proceeds to calculate the matrix row by row.

The R equivalent function is chol, cholmod.

Wikipedia: Cholesky decomposition
• ### Constructor Summary

Constructors
Constructor and Description
Chol(Matrix A)
Run the Cholesky decomposition on a real, symmetric (hence square), and positive definite matrix.
Chol(Matrix A, boolean isSymmetric)
Run the Cholesky decomposition on a real, symmetric (hence square), and positive definite matrix.
Chol(Matrix A, double epsilon)
Run the Cholesky decomposition on a real, symmetric (hence square), and positive definite matrix.
• ### Method Summary

All Methods
Modifier and Type Method and Description
LowerTriangularMatrix L()
Get the lower triangular matrix L.
UpperTriangularMatrix Lt()
Gets the transpose of the lower triangular matrix, L'.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### Chol

public Chol(Matrix A,
double epsilon)
Run the Cholesky decomposition on a real, symmetric (hence square), and positive definite matrix.
Parameters:
A - a real, symmetric (hence square), and positive definite matrix
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
Throws:
IllegalArgumentException - if A is not symmetric
RuntimeException - if A is not positive definite matrix
• #### Chol

public Chol(Matrix A,
boolean isSymmetric)
Run the Cholesky decomposition on a real, symmetric (hence square), and positive definite matrix.
Parameters:
A - a real, symmetric (hence square), and positive definite matrix
isSymmetric - true if A is symmetric to avoid the symmetry check
Throws:
RuntimeException - if A is not positive definite matrix
• #### Chol

public Chol(Matrix A)
Run the Cholesky decomposition on a real, symmetric (hence square), and positive definite matrix.
Parameters:
A - a real, symmetric (hence square), and positive definite matrix
Throws:
IllegalArgumentException - if A is not symmetric
RuntimeException - if A is not positive definite matrix
• ### Method Detail

• #### L

public LowerTriangularMatrix L()
Description copied from interface: Cholesky
Get the lower triangular matrix L.
Specified by:
L in interface Cholesky
Returns:
L
• #### Lt

public UpperTriangularMatrix Lt()
Gets the transpose of the lower triangular matrix, L'. The transpose is upper triangular.
Returns:
L'