Class Chol

  • All Implemented Interfaces:
    Cholesky

    public class Chol
    extends Object
    implements Cholesky
    Cholesky decomposition decomposes a real, symmetric (hence square), and positive definite matrix A into A = L * Lt, where L is a lower triangular matrix. For any real, symmetric, positive definite matrix, there is a unique Cholesky decomposition, such that L's diagonal entries are all positive. This implementation uses the Cholesky-Banachiewicz algorithm, which starts from the upper left corner of the matrix L and proceeds to calculate the matrix row by row.

    The R equivalent function is chol, cholmod.

    See Also:
    Wikipedia: Cholesky decomposition
    • Constructor Detail

      • Chol

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

        public Chol​(Matrix A,
                    boolean isSymmetric)
        Run the Cholesky decomposition on a real, symmetric (hence square), and positive definite matrix.
        Parameters:
        A - a real, symmetric (hence square), and positive definite matrix
        isSymmetric - true if A is symmetric to avoid the symmetry check
        Throws:
        RuntimeException - if A is not positive definite matrix
      • Chol

        public Chol​(Matrix A)
        Run the Cholesky decomposition on a real, symmetric (hence square), and positive definite matrix.
        Parameters:
        A - a real, symmetric (hence square), and positive definite matrix
        Throws:
        IllegalArgumentException - if A is not symmetric
        RuntimeException - if A is not positive definite matrix
    • Method Detail

      • Lt

        public UpperTriangularMatrix Lt()
        Gets the transpose of the lower triangular matrix, L'. The transpose is upper triangular.
        Returns:
        L'