Documentation of 'smile.math.matrix.LU' Java class
LU
smile.math.matrix

Class LU



  • public class LU
    extends java.lang.Object
    For an m-by-n matrix A with m ≥ n, the LU decomposition is an m-by-n unit lower triangular matrix L, an n-by-n upper triangular matrix U, and a permutation vector piv of length m so that A(piv,:) = L*U. If m < n, then L is m-by-m and U is m-by-n.

    The LU decomposition with pivoting always exists, even if the matrix is singular. The primary use of the LU decomposition is in the solution of square systems of simultaneous linear equations if it is not singular.

    This decomposition can also be used to calculate the determinant.

    • Constructor Summary

      Constructors 
      Constructor and Description
      LU(DenseMatrix lu, int[] piv, boolean singular)
      Constructor.
      LU(DenseMatrix lu, int[] piv, int pivsign, boolean singular)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double det()
      Returns the matrix determinant
      DenseMatrix inverse()
      Returns the matrix inverse.
      boolean isSingular()
      Returns true if the matrix is singular or false otherwise.
      void solve(DenseMatrix B)
      Solve A * X = B.
      void solve(double[] b)
      Solve A * x = b.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LU

        public LU(DenseMatrix lu,
                  int[] piv,
                  int pivsign,
                  boolean singular)
        Constructor.
        Parameters:
        lu - LU decomposition matrix
        piv - pivot vector
        pivsign - pivot sign. +1 if even number of row interchanges, -1 if odd number of row interchanges.
        singular - True if the matrix is singular
      • LU

        public LU(DenseMatrix lu,
                  int[] piv,
                  boolean singular)
        Constructor.
        Parameters:
        lu - LU decomposition matrix
        piv - pivot vector
        singular - True if the matrix is singular
    • Method Detail

      • isSingular

        public boolean isSingular()
        Returns true if the matrix is singular or false otherwise.
      • det

        public double det()
        Returns the matrix determinant
      • inverse

        public DenseMatrix inverse()
        Returns the matrix inverse. For pseudo inverse, use QRDecomposition.
      • solve

        public void solve(double[] b)
        Solve A * x = b.
        Parameters:
        b - right hand side of linear system. On output, b will be overwritten with the solution matrix.
        Throws:
        java.lang.RuntimeException - if matrix is singular.
      • solve

        public void solve(DenseMatrix B)
        Solve A * X = B. B will be overwritten with the solution matrix on output.
        Parameters:
        B - right hand side of linear system. On output, B will be overwritten with the solution matrix.
        Throws:
        java.lang.RuntimeException - if matrix is singular.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.