maspack.solvers
Class IncompleteLUDecomposition

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

public class IncompleteLUDecomposition
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 L
           
 SparseMatrixNd LU
           
 SparseMatrixNd U
           
 
Constructor Summary
IncompleteLUDecomposition()
          Creates an uninitialized CholeskyDecomposition.
IncompleteLUDecomposition(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 droptol)
           
 void get(MatrixNd LU)
          Gets the lower and upper triangular matrices L and U associated with this 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 solveL(VectorNd x, VectorNd b)
          Solves L * x = b
 boolean solveU(VectorNd x, VectorNd b)
          Solves U * x = b
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LU

public SparseMatrixNd LU

L

public SparseMatrixNd L

U

public SparseMatrixNd U
Constructor Detail

IncompleteLUDecomposition

public IncompleteLUDecomposition()
Creates an uninitialized CholeskyDecomposition.


IncompleteLUDecomposition

public IncompleteLUDecomposition(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

factor

public void factor(SparseMatrixNd A,
                   double droptol)

get

public void get(MatrixNd LU)
Gets the lower and upper triangular matrices L and U associated with this decomposition.

Parameters:
LU - lower and upper triangular matrices (sharing the same space)
Throws:
ImproperStateException - if this decomposition is uninitialized
ImproperSizeException - if LU is not of the proper dimension and cannot be resized

solveL

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

Throws:
ImproperStateException
ImproperSizeException

solveU

public boolean solveU(VectorNd x,
                      VectorNd b)
               throws ImproperStateException,
                      ImproperSizeException
Solves U * 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