Class CholeskyDecompositionLDL_D64
- java.lang.Object
-
- org.ejml.alg.dense.decomposition.chol.CholeskyDecompositionLDL_D64
-
- All Implemented Interfaces:
- CholeskyLDLDecomposition<DenseMatrix64F>, DecompositionInterface<DenseMatrix64F>
public class CholeskyDecompositionLDL_D64 extends java.lang.Object implements CholeskyLDLDecomposition<DenseMatrix64F>
This variant on the Cholesky decomposition avoid the need to take the square root by performing the following decomposition:
L*D*LT=A
where L is a lower triangular matrix with zeros on the diagonal. D is a diagonal matrix. The diagonal elements of L are equal to one.Unfortunately the speed advantage of not computing the square root is washed out by the increased number of array accesses. There only appears to be a slight speed boost for very small matrices.
-
-
Constructor Summary
Constructors Constructor and Description CholeskyDecompositionLDL_D64()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]_getVV()booleandecompose(DenseMatrix64F mat)Performs Choleksy decomposition on the provided matrix.DenseMatrix64FgetD(DenseMatrix64F D)Returns the diagonal matrixfrom the decomposition.double[]getDiagonal()Diagonal elements of the diagonal D matrix.DenseMatrix64FgetL()Returns L matrix from the decomposition.
L*D*LT=ADenseMatrix64FgetL(DenseMatrix64F L)Returns the lower triangular matrix from the decomposition.booleaninputModified()Is the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.voidsetExpectedMaxSize(int numRows, int numCols)
-
-
-
Method Detail
-
setExpectedMaxSize
public void setExpectedMaxSize(int numRows, int numCols)
-
decompose
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.
- Specified by:
decomposein interfaceDecompositionInterface<DenseMatrix64F>- Parameters:
mat- A symetric n by n positive definite matrix.- Returns:
- True if it was able to finish the decomposition.
-
inputModified
public boolean inputModified()
Description copied from interface:DecompositionInterfaceIs the input matrix toDecompositionInterface.decompose(org.ejml.data.Matrix)is modified during the decomposition process.- Specified by:
inputModifiedin interfaceDecompositionInterface<DenseMatrix64F>- Returns:
- true if the input matrix to decompose() is modified.
-
getDiagonal
public double[] getDiagonal()
Diagonal elements of the diagonal D matrix.- Specified by:
getDiagonalin interfaceCholeskyLDLDecomposition<DenseMatrix64F>- Returns:
- diagonal elements of D
-
getL
public DenseMatrix64F getL()
Returns L matrix from the decomposition.
L*D*LT=A- Returns:
- A lower triangular matrix.
-
_getVV
public double[] _getVV()
-
getL
public DenseMatrix64F getL(DenseMatrix64F L)
Description copied from interface:CholeskyLDLDecompositionReturns the lower 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.
- Specified by:
getLin interfaceCholeskyLDLDecomposition<DenseMatrix64F>- Parameters:
L- If not null then the decomposed matrix is written here.- Returns:
- A lower triangular matrix.
-
getD
public DenseMatrix64F getD(DenseMatrix64F D)
Description copied from interface:CholeskyLDLDecompositionReturns the diagonal matrixfrom 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.
- Specified by:
getDin interfaceCholeskyLDLDecomposition<DenseMatrix64F>- Parameters:
D- If not null it will be used to store the diagonal matrix- Returns:
- D Square diagonal matrix
-
-
DMelt 3.0 © DataMelt by jWork.ORG