public abstract class CholeskyDecompositionCommon extends Object implements CholeskyDecomposition<DenseMatrix64F>
This is an abstract class for a Cholesky decomposition. It provides the solvers, but the actual decompsoition is provided in other classes.
A Cholesky Decomposition is a special decomposition for positive-definite symmetric matrices
that is more efficient than other general purposes decomposition. It refactors matrices
using one of the two following equations:
L*LT=A
RT*R=A
where L is a lower triangular matrix and R is an upper traingular matrix.
CholeskyDecompositionInner,
CholeskyDecompositionBlock,
CholeskyDecompositionLDL| Modifier and Type | Field and Description |
|---|---|
protected boolean |
lower |
protected int |
maxWidth |
protected int |
n |
protected double[] |
t |
protected DenseMatrix64F |
T |
protected double[] |
vv |
| Constructor and Description |
|---|
CholeskyDecompositionCommon(boolean lower)
Creates a CholeksyDecomposition capable of decompositong a matrix that is
n by n, where n is the width.
|
| Modifier and Type | Method and Description |
|---|---|
double[] |
_getVV() |
boolean |
decompose(DenseMatrix64F mat)
Performs Choleksy decomposition on the provided matrix.
|
protected abstract boolean |
decomposeLower()
Performs an lower triangular decomposition.
|
protected abstract boolean |
decomposeUpper()
Performs an upper triangular decomposition.
|
DenseMatrix64F |
getT()
Returns the triangular matrix from the decomposition.
|
DenseMatrix64F |
getT(DenseMatrix64F T)
Returns the triangular matrix from the decomposition.
|
boolean |
inputModified()
Is the input matrix to
DecompositionInterface.decompose(org.ejml.data.Matrix64F) is modified during
the decomposition process. |
boolean |
isLower()
If true the decomposition was for a lower triangular matrix.
|
void |
setExpectedMaxSize(int numRows,
int numCols) |
protected int maxWidth
protected int n
protected DenseMatrix64F T
protected double[] t
protected double[] vv
protected boolean lower
public CholeskyDecompositionCommon(boolean lower)
lower - should a lower or upper triangular matrix be used.public void setExpectedMaxSize(int numRows,
int numCols)
public boolean isLower()
isLower in interface CholeskyDecomposition<DenseMatrix64F>public boolean decompose(DenseMatrix64F mat)
Performs Choleksy decomposition on the provided matrix.
If the matrix is not positive definite then this function will return false since it can't complete its computations. Not all errors will be found. This is an efficient way to check for positive definiteness.
decompose in interface DecompositionInterface<DenseMatrix64F>mat - A symmetric positive definite matrix with n <= widthMax.public boolean inputModified()
DecompositionInterfaceDecompositionInterface.decompose(org.ejml.data.Matrix64F) is modified during
the decomposition process.inputModified in interface DecompositionInterface<DenseMatrix64F>protected abstract boolean decomposeLower()
protected abstract boolean decomposeUpper()
public DenseMatrix64F getT(DenseMatrix64F T)
CholeskyDecompositionReturns the triangular matrix from the decomposition.
If an input is provided that matrix is used to write the results to. Otherwise a new matrix is created and the results written to it.
getT in interface CholeskyDecomposition<DenseMatrix64F>T - If not null then the decomposed matrix is written here.public DenseMatrix64F getT()
public double[] _getVV()
Copyright © 2013. All Rights Reserved.