SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles.factorization.triangle
Class Cholesky

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.factorization.triangle.Cholesky

public class Cholesky
extends java.lang.Object

Cholesky decomposition decomposes a real, symmetric (hence square), and positive definite matrix A into

 A = L %*% Lt
 
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.

We implement the Cholesky-Crout algorithm. It starts from the upper left corner of the matrix L and proceeds to calculate the matrix row by row.

If the matrix is not symmetric, it throws an IllegalArgumentException. If the matrix is not positive definite, it throws a RuntimeException.

See Also:
Wikipedia: Cholesky decomposition

Constructor Summary
Cholesky(Matrix A)
          Run the Cholesky decomposition.
 
Method Summary
 LowerTriangularMatrix L()
          Get a copy of the lower triangular matrix L as in L %*% Lt.
 UpperTriangularMatrix Lt()
          Get a copy of the transpose of the lower triangular matrix L as in A = L %*% Lt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cholesky

public Cholesky(Matrix A)
Run the Cholesky decomposition.

Parameters:
A - a real, symmetric (hence square), and positive definite matrix
Throws:
java.lang.IllegalArgumentException - if A is not symmetric
java.lang.RuntimeException - if A is not positive definite matrix
Method Detail

L

public LowerTriangularMatrix L()
Get a copy of the lower triangular matrix L as in L %*% Lt.

Returns:
a copy of L

Lt

public UpperTriangularMatrix Lt()
Get a copy of the transpose of the lower triangular matrix L as in A = L %*% Lt.

The transpose is upper triangular.

Returns:
a copy of Lt

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.