Class LUDecompositionCommonsResult

    • Constructor Detail

      • LUDecompositionCommonsResult

        public LUDecompositionCommonsResult​(org.apache.commons.math3.linear.LUDecomposition lu)
        Creates an instance.
        Parameters:
        lu - The result of the LU decomposition, not null. $\mathbf{L}$ cannot be singular.
    • Method Detail

      • getDeterminant

        public double getDeterminant()
        Return the determinant of the matrix.
        Specified by:
        getDeterminant in interface LUDecompositionResult
        Returns:
        determinant of the matrix
      • getL

        public DoubleMatrix getL()
        Returns the $\mathbf{L}$ matrix of the decomposition.

        $\mathbf{L}$ is a lower-triangular matrix.

        Specified by:
        getL in interface LUDecompositionResult
        Returns:
        the $\mathbf{L}$ matrix
      • getPivot

        public int[] getPivot()
        Returns the pivot permutation vector.
        Specified by:
        getPivot in interface LUDecompositionResult
        Returns:
        the pivot permutation vector
      • getU

        public DoubleMatrix getU()
        Returns the $\mathbf{U}$ matrix of the decomposition.

        $\mathbf{U}$ is an upper-triangular matrix.

        Specified by:
        getU in interface LUDecompositionResult
        Returns:
        the U matrix
      • solve

        public DoubleArray solve​(DoubleArray b)
        Solves $\mathbf{A}x = b$ where $\mathbf{A}$ is a (decomposed) matrix and $b$ is a vector.
        Specified by:
        solve in interface DecompositionResult
        Parameters:
        b - the vector to calculate with
        Returns:
        the vector x
      • solve

        public double[] solve​(double[] b)
        Solves $\mathbf{A}x = b$ where $\mathbf{A}$ is a (decomposed) matrix and $b$ is a vector.
        Specified by:
        solve in interface DecompositionResult
        Parameters:
        b - the vector to calculate with
        Returns:
        the vector x
      • solve

        public DoubleMatrix solve​(DoubleMatrix b)
        Solves $\mathbf{A}x = \mathbf{B}$ where $\mathbf{A}$ is a (decomposed) matrix and $\mathbf{B}$ is a matrix.
        Specified by:
        solve in interface DecompositionResult
        Parameters:
        b - the matrix to calculate with
        Returns:
        the matrix x