maspack.solvers
Class IncompleteCholeskyDecomposition

java.lang.Object
  extended by maspack.solvers.IncompleteCholeskyDecomposition
All Implemented Interfaces:
LinearTransformNd

public class IncompleteCholeskyDecomposition
extends java.lang.Object
implements LinearTransformNd

Constructs the Cholesky decomposition of a symmetric positive definite matrix. This takes the form
M = L L'
where M is the original matrix, L is a lower-triangular matrix and L' denotes its transpose. Once this decomposition has been constructed, it can be used to perform various computations related to M, such as solving equations, computing the determinant, or estimating the condition number.

Providing a separate class for the Cholesky decomposition allows an application to perform such decompositions repeatedly without having to reallocate temporary storage space.


Field Summary
 SparseMatrixNd C
           
 
Constructor Summary
IncompleteCholeskyDecomposition()
          Creates an uninitialized CholeskyDecomposition.
IncompleteCholeskyDecomposition(SparseMatrixNd M)
          Creates a CholeskyDecomposition for the Matrix specified by M.
 
Method Summary
 int colSize()
          Number of columns in the matrix associated with this transformation.
 void factor(SparseMatrixNd A)
          Peforms an Cholesky decomposition on the Matrix M.
 void factor(SparseMatrixNd A, double tol)
           
 void get(MatrixNd L)
          Gets the lower-triangular matrix L associated with the Cholesky decomposition.
 void mul(VectorNd vr, VectorNd v1)
          Applies this transformation to vector v1 and returns the result in vr.
 int rowSize()
          Number of rows in the matrix associated with this transformation.
 boolean solve(VectorNd x, VectorNd b)
          Solves L * x = b
 boolean solveTranspose(VectorNd x, VectorNd b)
          Solves L' * x = b
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C

public SparseMatrixNd C
Constructor Detail

IncompleteCholeskyDecomposition

public IncompleteCholeskyDecomposition()
Creates an uninitialized CholeskyDecomposition.


IncompleteCholeskyDecomposition

public IncompleteCholeskyDecomposition(SparseMatrixNd M)
                                throws ImproperSizeException
Creates a CholeskyDecomposition for the Matrix specified by M.

Parameters:
M - matrix to perform the Cholesky decomposition on
Throws:
ImproperSizeException - if M is not square
Method Detail

factor

public void factor(SparseMatrixNd A)
Peforms an Cholesky decomposition on the Matrix M.

Parameters:
A - matrix on which to perform the Cholesky decomposition
Throws:
ImproperSizeException - if M is not square
java.lang.IllegalArgumentException - if M is detected to be not symmetric positive definite

factor

public void factor(SparseMatrixNd A,
                   double tol)

get

public void get(MatrixNd L)
Gets the lower-triangular matrix L associated with the Cholesky decomposition.

Parameters:
L - lower triangular matrix
Throws:
ImproperStateException - if this CholeskyDecomposition is uninitialized
ImproperSizeException - if L is not of the proper dimension and cannot be resized

solve

public boolean solve(VectorNd x,
                     VectorNd b)
              throws ImproperStateException,
                     ImproperSizeException
Solves L * x = b

Throws:
ImproperStateException
ImproperSizeException

solveTranspose

public boolean solveTranspose(VectorNd x,
                              VectorNd b)
                       throws ImproperStateException,
                              ImproperSizeException
Solves L' * x = b

Throws:
ImproperStateException
ImproperSizeException

colSize

public int colSize()
Description copied from interface: LinearTransformNd
Number of columns in the matrix associated with this transformation. This will equal the size of the input vector in mul.

Specified by:
colSize in interface LinearTransformNd
Returns:
number of columns

rowSize

public int rowSize()
Description copied from interface: LinearTransformNd
Number of rows in the matrix associated with this transformation. This will equal the size of the output vector in mul.

Specified by:
rowSize in interface LinearTransformNd
Returns:
number of rows

mul

public void mul(VectorNd vr,
                VectorNd v1)
Description copied from interface: LinearTransformNd
Applies this transformation to vector v1 and returns the result in vr.

Specified by:
mul in interface LinearTransformNd
Parameters:
vr - vector in which result is returned
v1 - vector to transform