Class Chol
- java.lang.Object
-
- dev.nm.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 ischol, cholmod.- See Also:
- Wikipedia: Cholesky decomposition
-
-
Constructor Summary
Constructors Constructor 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 Instance Methods Concrete Methods Modifier and Type Method Description LowerTriangularMatrixL()Get the lower triangular matrix L.UpperTriangularMatrixLt()Gets the transpose of the lower triangular matrix, L'.
-
-
-
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 matrixepsilon- a precision parameter: when a number |x| ≤ ε, it is considered 0- Throws:
IllegalArgumentException- if A is not symmetricRuntimeException- 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 matrixisSymmetric-trueifAis 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 symmetricRuntimeException- if A is not positive definite matrix
-
-
Method Detail
-
L
public LowerTriangularMatrix L()
Description copied from interface:CholeskyGet the lower triangular matrix L.
-
Lt
public UpperTriangularMatrix Lt()
Gets the transpose of the lower triangular matrix, L'. The transpose is upper triangular.- Returns:
- L'
-
-