类 LinalgUtil


  • public class LinalgUtil
    extends java.lang.Object
    作者:
    Yaqiang Wang
    • 构造器概要

      构造器 
      构造器 说明
      LinalgUtil()  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static Array cholesky​(Array a)
      Calculates the Cholesky decomposition of a matrix.
      static double determinantOfMatrix​(double[][] mat, int n, int N)  
      static double determinantOfMatrix​(Array mat)
      Calculate determinant of a matrix array
      static Array[] eigen​(Array a)
      Calculates the eigen decomposition of a real matrix.
      static Array[] eigen_bak​(Array a)
      Calculates the eigen decomposition of a real matrix.
      static Array[] eigen_EJML​(Array a)
      Calculates the eigen decomposition of a real matrix.
      static void getCofactor​(double[][] mat, double[][] temp, int p, int q, int n)  
      static Array inv​(Array a)
      Calculate inverse matrix
      static Array lstsq​(Array a, Array b)
      Not correct at present !!!
      static Array[] lu​(Array a)
      Calculates the LUP-decomposition of a square matrix.
      static Array[] qr​(Array a)
      Calculates the QR-decomposition of a matrix.
      static Array solve​(Array a, Array b)
      Solve a linear matrix equation, or system of linear scalar equations.
      static Array[] svd​(Array a)
      Calculates the compact Singular Value Decomposition of a matrix.
      static Array[] svd_EJML​(Array a)
      Calculates the compact Singular Value Decomposition of a matrix.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • LinalgUtil

        public LinalgUtil()
    • 方法详细资料

      • solve

        public static Array solve​(Array a,
                                  Array b)
        Solve a linear matrix equation, or system of linear scalar equations.
        参数:
        a - Coefficient matrix.
        b - Ordinate or “dependent variable” values.
        返回:
        Solution to the system a x = b. Returned shape is identical to b.
      • cholesky

        public static Array cholesky​(Array a)
        Calculates the Cholesky decomposition of a matrix. The Cholesky decomposition of a real symmetric positive-definite matrix A consists of a lower triangular matrix L with same size such that: A = LLT. In a sense, this is the square root of A.
        参数:
        a - The given matrix.
        返回:
        Result array.
      • lu

        public static Array[] lu​(Array a)
        Calculates the LUP-decomposition of a square matrix. The LUP-decomposition of a matrix A consists of three matrices L, U and P that satisfy: P×A = L×U. L is lower triangular (with unit diagonal terms), U is upper triangular and P is a permutation matrix. All matrices are m×m.
        参数:
        a - Given matrix.
        返回:
        Result P/L/U arrays.
      • qr

        public static Array[] qr​(Array a)
        Calculates the QR-decomposition of a matrix. The QR-decomposition of a matrix A consists of two matrices Q and R that satisfy: A = QR, Q is orthogonal (QTQ = I), and R is upper triangular. If A is m×n, Q is m×m and R m×n.
        参数:
        a - Given matrix.
        返回:
        Result Q/R arrays.
      • svd

        public static Array[] svd​(Array a)
        Calculates the compact Singular Value Decomposition of a matrix. The Singular Value Decomposition of matrix A is a set of three matrices: U, Σ and V such that A = U × Σ × VT. Let A be a m × n matrix, then U is a m × p orthogonal matrix, Σ is a p × p diagonal matrix with positive or null elements, V is a p × n orthogonal matrix (hence VT is also orthogonal) where p=min(m,n).
        参数:
        a - Given matrix.
        返回:
        Result U/S/V arrays.
      • svd_EJML

        public static Array[] svd_EJML​(Array a)
        Calculates the compact Singular Value Decomposition of a matrix. The Singular Value Decomposition of matrix A is a set of three matrices: U, Σ and V such that A = U × Σ × VT. Let A be a m × n matrix, then U is a m × p orthogonal matrix, Σ is a p × p diagonal matrix with positive or null elements, V is a p × n orthogonal matrix (hence VT is also orthogonal) where p=min(m,n).
        参数:
        a - Given matrix.
        返回:
        Result U/S/V arrays.
      • eigen_bak

        public static Array[] eigen_bak​(Array a)
        Calculates the eigen decomposition of a real matrix. The eigen decomposition of matrix A is a set of two matrices: V and D such that A = V × D × VT. A, V and D are all m × m matrices.
        参数:
        a - Given matrix.
        返回:
        Result W/V arrays.
      • eigen

        public static Array[] eigen​(Array a)
        Calculates the eigen decomposition of a real matrix. The eigen decomposition of matrix A is a set of two matrices: V and D such that A = V × D × VT. A, V and D are all m × m matrices.
        参数:
        a - Given matrix.
        返回:
        Result W/V arrays.
      • eigen_EJML

        public static Array[] eigen_EJML​(Array a)
        Calculates the eigen decomposition of a real matrix. The eigen decomposition of matrix A is a set of two matrices: V and D such that A = V × D × VT. A, V and D are all m × m matrices.
        参数:
        a - Given matrix.
        返回:
        Result W/V arrays.
      • inv

        public static Array inv​(Array a)
        Calculate inverse matrix
        参数:
        a - The matrix
        返回:
        Inverse matrix array
      • lstsq

        public static Array lstsq​(Array a,
                                  Array b)
        Not correct at present !!!
        参数:
        a -
        b -
        返回:
      • getCofactor

        public static void getCofactor​(double[][] mat,
                                       double[][] temp,
                                       int p,
                                       int q,
                                       int n)
      • determinantOfMatrix

        public static double determinantOfMatrix​(double[][] mat,
                                                 int n,
                                                 int N)
      • determinantOfMatrix

        public static double determinantOfMatrix​(Array mat)
        Calculate determinant of a matrix array
        参数:
        mat - Input array
        返回:
        Determinant