Class Doolittle

  • All Implemented Interfaces:
    LUDecomposition

    public class Doolittle
    extends Object
    implements LUDecomposition
    Doolittle algorithm is a LU decomposition algorithm which decomposes a square matrix A into:
    • P is an n x n permutation matrix;
    • L is an n x n (unit) lower triangular matrix;
    • U is an n x n upper triangular matrix,
    such that PA = LU. That is,
    P.multiply(A) == L.multiply(U) 
    Not every non-singular matrix can be LU decomposed but some singular matrix can have valid LU decomposition. For example, the following singular matrix has LU decomposition. \[ \begin{bmatrix} 1 & 0 & 0\\ 0 & 0 & 2\\ 0 & 1 & -1 \end{bmatrix} \] On the other hand, the LU decomposition with pivoting always exists, even if the matrix is singular.

    With (partial) pivoting, rows may be swapped during the decomposition process to avoid division by zero, and hence make the process more numerically stable.

    See Also:
    Wikipedia: LU decomposition
    • Constructor Detail

      • Doolittle

        public Doolittle​(Matrix A)
        Runs Doolittle algorithm on a square matrix for LU decomposition.
        Parameters:
        A - the square matrix
      • Doolittle

        public Doolittle​(Matrix A,
                         double epsilon)
        Runs Doolittle algorithm on a square matrix for LU decomposition.
        Parameters:
        A - the square matrix
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
      • Doolittle

        public Doolittle​(Matrix A,
                         boolean usePivoting)
        Runs Doolittle algorithm on a square matrix for LU decomposition.
        Parameters:
        A - the square matrix
        usePivoting - true if (partial) pivoting is used
      • Doolittle

        public Doolittle​(Matrix A,
                         boolean usePivoting,
                         double epsilon)
        Runs Doolittle algorithm on a square matrix for LU decomposition.
        Parameters:
        A - the square matrix
        usePivoting - true if (partial) pivoting is used
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0