Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.math.linearalgebra
Class CholeskyDecomposition

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.math.linearalgebra.CholeskyDecomposition
All Implemented Interfaces:
Serializable

public class CholeskyDecomposition
extends Object
implements Serializable

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.

See Also:
Serialized Form

Field Summary
private  boolean isspd
          Symmetric and positive definite flag.
private  double[][] L
          Array for internal storage of decomposition.
private  int n
          Row and column dimension (square matrix).
 
Constructor Summary
CholeskyDecomposition(Matrix Arg)
          Cholesky algorithm for symmetric and positive definite matrix.
 
Method Summary
 Matrix getL()
          Return triangular factor.
 boolean isSPD()
          Is the matrix symmetric and positive definite?
 Matrix solve(Matrix B)
          Solve A*X = B
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

L

private double[][] L
Array for internal storage of decomposition.


n

private int n
Row and column dimension (square matrix).


isspd

private boolean isspd
Symmetric and positive definite flag.

Constructor Detail

CholeskyDecomposition

public CholeskyDecomposition(Matrix Arg)
Cholesky algorithm for symmetric and positive definite matrix.

Parameters:
Arg - Square, symmetric matrix.
Method Detail

isSPD

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

Returns:
true if A is symmetric and positive definite.

getL

public Matrix getL()
Return triangular factor.

Returns:
L

solve

public Matrix solve(Matrix B)
Solve A*X = B

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

Release 0.1 (2008-07-10_1838)