org.openmali.decomposition
Class CholeskyDecomposition

java.lang.Object
  extended by org.openmali.decomposition.CholeskyDecomposition

public class CholeskyDecomposition
extends java.lang.Object

Cholesky Decomposition.

For a symmetric, positive definite matrix A, the Cholesky decomposition is an lower triangular matrix L so that A = L * L'.

If the matrix is not symmetric or positive definite, the constructor returns a partial decomposition and sets an internal flag that may be queried by the isSPD() method.


Constructor Summary
CholeskyDecomposition(MatrixMxNf M)
          Cholesky algorithm for symmetric and positive definite matrix.
 
Method Summary
 MatrixMxNf getL()
          Return triangular factor.
 boolean isSPD()
          Is the matrix symmetric and positive definite?
 void solve(MatrixMxNf B, MatrixMxNf result)
          Solves A * X = B.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CholeskyDecomposition

public CholeskyDecomposition(MatrixMxNf M)
Cholesky algorithm for symmetric and positive definite matrix.

Parameters:
M - Square, symmetric matrix. return Structure to access L and isspd flag.
Method Detail

isSPD

public final boolean isSPD()
Is the matrix symmetric and positive definite?

Returns:
true if A is symmetric and positive definite.

getL

public MatrixMxNf getL()
Return triangular factor.

Returns:
L

solve

public final void solve(MatrixMxNf B,
                        MatrixMxNf result)
Solves A * X = B.

Parameters:
B - A Matrix with as many rows as A and any number of columns.
result - so that L*L'*X = B
Throws:
java.lang.IllegalArgumentException - Matrix row dimensions must agree.
java.lang.RuntimeException - Matrix is not symmetric positive definite.