|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.matrix.CholeskyDecomposition
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.
Constructor Summary | |
CholeskyDecomposition()
Creates an uninitialized CholeskyDecomposition. |
|
CholeskyDecomposition(int n)
Creates an uninitialized CholeskyDecomposition with enough capacity to handle matrices of size n . |
|
CholeskyDecomposition(MatrixObject M)
Creates a CholeskyDecomposition for the MatrixObject specified by M. |
Method Summary | |
double |
conditionEstimate(MatrixObject M)
Estimates the condition number of the original matrix M associated with this decomposition. |
double |
determinant()
Compute the determinant of the original matrix M associated with this decomposition. |
void |
get(MatrixNd L)
Gets the lower-triangular matrix L associated with the Cholesky decomposition. |
boolean |
inverse(MatrixObject R)
Computes the inverse of the original matrix M associated with this decomposition, and places the result in R. |
void |
set(MatrixObject M)
Peforms an Cholesky decomposition on the MatrixObject M. |
boolean |
solve(MatrixObject X,
MatrixObject B)
Solves the linear equation M X = B where M is the original matrix associated with this decomposition, and X and B are matrices. |
boolean |
solve(VectorObject x,
VectorObject b)
Solves the linear equation M x = b where M is the original matrix associated with this decomposition, and x and b are vectors. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CholeskyDecomposition()
public CholeskyDecomposition(int n)
n
. This
capacity will later be increased on demand.
n
- initial maximum matrix sizepublic CholeskyDecomposition(MatrixObject M) throws ImproperSizeException
M
- matrix to perform the Cholesky decomposition on
ImproperSizeException
- if M is not squareMethod Detail |
public void set(MatrixObject M) throws ImproperSizeException
M
- matrix to perform the Cholesky decomposition on
ImproperSizeException
- if M is not square
java.lang.IllegalArgumentException
- if M is detected to be
not symmetric positive definitepublic void get(MatrixNd L) throws ImproperStateException, ImproperSizeException
L
- lower triangular matrix
ImproperStateException
- if this CholeskyDecomposition
is uninitialized
ImproperSizeException
- if L is
not of the proper dimension and cannot be resizedpublic boolean solve(VectorObject x, VectorObject b) throws ImproperStateException, ImproperSizeException
x
- unknown vector to solve forb
- constant vector
ImproperStateException
- if this decomposition is
uninitialized
ImproperSizeException
- if b does not have a size
compatible with M, or if x does not have a size compatible
with M and cannot be resized.public boolean solve(MatrixObject X, MatrixObject B) throws ImproperStateException, ImproperSizeException
X
- unknown matrix to solve forB
- constant matrix
ImproperStateException
- if this decomposition is
uninitialized
ImproperSizeException
- if B has a different number of
rows than M, or if X has a different number of rows than M
or a different number of columns than B and cannot be resized.public double conditionEstimate(MatrixObject M) throws ImproperStateException, ImproperSizeException
M
- original matrix
ImproperStateException
- if this CholeskyDecomposition is
uninitialized
ImproperSizeException
- if the size of M does not
match the size of the current Cholesky decompositionpublic double determinant() throws ImproperStateException
ImproperStateException
- if this decomposition is
uninitializedpublic boolean inverse(MatrixObject R) throws ImproperStateException
R
- matrix in which the inverse is stored
ImproperStateException
- if this decomposition is
uninitialized
ImproperSizeException
- if R does not have
the same size as M and cannot be resized.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |