Class CholeskyDecompositionLDL_DDRM

java.lang.Object
org.ejml.dense.row.decomposition.chol.CholeskyDecompositionLDL_DDRM
All Implemented Interfaces:
org.ejml.interfaces.decomposition.CholeskyLDLDecomposition<org.ejml.data.DMatrixRMaj>, org.ejml.interfaces.decomposition.CholeskyLDLDecomposition_F64<org.ejml.data.DMatrixRMaj>, org.ejml.interfaces.decomposition.DecompositionInterface<org.ejml.data.DMatrixRMaj>

public class CholeskyDecompositionLDL_DDRM
extends java.lang.Object
implements org.ejml.interfaces.decomposition.CholeskyLDLDecomposition_F64<org.ejml.data.DMatrixRMaj>

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 Description
    CholeskyDecompositionLDL_DDRM()  
  • Method Summary

    Modifier and Type Method Description
    double[] _getVV()  
    boolean decompose​(org.ejml.data.DMatrixRMaj mat)
    Performs Choleksy decomposition on the provided matrix.
    org.ejml.data.DMatrixRMaj getD​(@Nullable org.ejml.data.DMatrixRMaj D)  
    double[] getDiagonal()
    Diagonal elements of the diagonal D matrix.
    org.ejml.data.DMatrixRMaj getL()
    Returns L matrix from the decomposition.
    L*D*LT=A
    org.ejml.data.DMatrixRMaj getL​(@Nullable org.ejml.data.DMatrixRMaj L)  
    boolean inputModified()  
    void setExpectedMaxSize​(int numRows, int numCols)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setExpectedMaxSize

      public void setExpectedMaxSize​(int numRows, int numCols)
    • decompose

      public boolean decompose​(org.ejml.data.DMatrixRMaj 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:
      decompose in interface org.ejml.interfaces.decomposition.DecompositionInterface<org.ejml.data.DMatrixRMaj>
      Parameters:
      mat - A symmetric n by n positive definite matrix.
      Returns:
      True if it was able to finish the decomposition.
    • inputModified

      public boolean inputModified()
      Specified by:
      inputModified in interface org.ejml.interfaces.decomposition.DecompositionInterface<org.ejml.data.DMatrixRMaj>
    • getDiagonal

      public double[] getDiagonal()
      Diagonal elements of the diagonal D matrix.
      Specified by:
      getDiagonal in interface org.ejml.interfaces.decomposition.CholeskyLDLDecomposition_F64<org.ejml.data.DMatrixRMaj>
      Returns:
      diagonal elements of D
    • getL

      public org.ejml.data.DMatrixRMaj getL()
      Returns L matrix from the decomposition.
      L*D*LT=A
      Returns:
      A lower triangular matrix.
    • _getVV

      public double[] _getVV()
    • getL

      public org.ejml.data.DMatrixRMaj getL​(@Nullable @Nullable org.ejml.data.DMatrixRMaj L)
      Specified by:
      getL in interface org.ejml.interfaces.decomposition.CholeskyLDLDecomposition<org.ejml.data.DMatrixRMaj>
    • getD

      public org.ejml.data.DMatrixRMaj getD​(@Nullable @Nullable org.ejml.data.DMatrixRMaj D)
      Specified by:
      getD in interface org.ejml.interfaces.decomposition.CholeskyLDLDecomposition<org.ejml.data.DMatrixRMaj>