Class LDLt


  • public class LDLt
    extends Object
    The LDL decomposition decomposes a real and symmetric (hence square) matrix A into A = L * D * Lt. L is a lower triangular matrix. D is a diagonal matrix. Unlike Cholesky decomposition, this decomposition applies to all real and symmetric matrices, whether positive definite or not. Moreover, when A is positive definite the elements of the diagonal matrix D are all positive. In other words, if A is semi/positive/negative definite, so is D. This algorithm eliminates the need to take square roots.
    See Also:
    Wikipedia: Avoiding taking square roots
    • Constructor Detail

      • LDLt

        public LDLt​(Matrix A,
                    double epsilon)
        Run the LDL decomposition on a real and symmetric (hence square) matrix.
        Parameters:
        A - a real and symmetric (hence square) matrix
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
        Throws:
        IllegalArgumentException - if A is not symmetric
      • LDLt

        public LDLt​(Matrix A)
        Run the LDL decomposition on a real and symmetric (hence square) matrix.
        Parameters:
        A - a real and symmetric (hence square) matrix
        Throws:
        IllegalArgumentException - if A is not symmetric
    • Method Detail

      • Lt

        public UpperTriangularMatrix Lt()
        Get the transpose of L as in the LDL decomposition. The transpose is upper triangular.
        Returns:
        L'
      • D

        public DiagonalMatrix D()
        Get D the the diagonal matrix in the LDL decomposition.
        Returns:
        D