Interface Lapack

  • All Known Implementing Classes:
    BaseLapack

    public interface Lapack
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void geqrf​(INDArray A, INDArray R)
      QR decomposiiton of a matrix Factorize a matrix A such that A = QR The matrix A is overwritten by the Q component (i.e.
      void gesvd​(INDArray A, INDArray S, INDArray U, INDArray VT)
      SVD decomposiiton of a matrix Factorize a matrix into its singular vectors and eigenvalues The decomposition is such that: A = U x S x VT gesvd = singular value decomposition (SVD) of a general matrix (GE)
      INDArray getLFactor​(INDArray A)
      extracts the L (lower triangular) matrix from the LU factor result L will be the same dimensions as A
      INDArray getPFactor​(int M, INDArray ipiv)
      This method takes one of the ipiv returns from LAPACK and creates the permutation matrix.
      INDArray getrf​(INDArray A)
      LU decomposiiton of a matrix Factorize a matrix A The matrix A is overridden by the L & U combined.
      void getri​(int N, INDArray A, int lda, int[] IPIV, INDArray WORK, int lwork, int INFO)
      Generate inverse ggiven LU decomp
      INDArray getUFactor​(INDArray A)
      extracts the U (upper triangular) matrix from the LU factor result U will be n x n matrix where n = num cols in A
      void potrf​(INDArray A, boolean lower)
      Triangular decomposiiton of a positive definite matrix ( cholesky ) Factorize a matrix A such that A = LL* (assuming lower==true) or A = U*U (a * represents conjugate i.e.
      int syev​(char jobz, char uplo, INDArray A, INDArray V)
      Caclulate the eigenvalues and vectors of a symmetric matrix.
    • Method Detail

      • getrf

        INDArray getrf​(INDArray A)
        LU decomposiiton of a matrix Factorize a matrix A The matrix A is overridden by the L & U combined. The permutation results are returned directly as a vector. To create the permutation matrix use getPFactor method To split out the L & U matrix use getLFactor and getUFactor methods getrf = triangular factorization (TRF) of a general matrix (GE)
        Parameters:
        A - the input matrix, it will be overwritten with the factors
        Throws:
        Error - - with a message to indicate failure (usu. bad params)
      • geqrf

        void geqrf​(INDArray A,
                   INDArray R)
        QR decomposiiton of a matrix Factorize a matrix A such that A = QR The matrix A is overwritten by the Q component (i.e. destroyed) geqrf = QR factorization of a general matrix (GE) into an orthogonal matrix Q and an upper triangular R matrix
        Parameters:
        A - the input matrix, it will be overwritten with the factors
        The - R array if null R is not returned
        Throws:
        Error - - with a message to indicate failure (usu. bad params)
      • potrf

        void potrf​(INDArray A,
                   boolean lower)
        Triangular decomposiiton of a positive definite matrix ( cholesky ) Factorize a matrix A such that A = LL* (assuming lower==true) or A = U*U (a * represents conjugate i.e. if matrix is real U* is a transpose) The matrix A is overridden by the L (or U). potrf = LU factorization of a positive definite matrix (PO) into a lower L ( or upper U ) triangular matrix
        Parameters:
        A - the input matrix, it will be overwritten with the factors
        whether - to return the upper (false) or lower factor
        Throws:
        Error - - with a message to indicate failure (usu. bad params)
      • syev

        int syev​(char jobz,
                 char uplo,
                 INDArray A,
                 INDArray V)
        Caclulate the eigenvalues and vectors of a symmetric matrix. The symmetric matrix means the results are guaranteed to be real (not complex) The matrix A is overridden by the eigenvectors. The eigenvalues are returned separately
        Parameters:
        A - the input matrix, it will be overwritten with the eigenvectors
        V - the resulting eigenvalues
        Throws:
        Error - - with a message to indicate failure (usu. bad params)
      • gesvd

        void gesvd​(INDArray A,
                   INDArray S,
                   INDArray U,
                   INDArray VT)
        SVD decomposiiton of a matrix Factorize a matrix into its singular vectors and eigenvalues The decomposition is such that: A = U x S x VT gesvd = singular value decomposition (SVD) of a general matrix (GE)
        Parameters:
        A - the input matrix
        S - the eigenvalues as a vector
        U - the left singular vectors as a matrix. Maybe null if no S required
        VT - the right singular vectors as a (transposed) matrix. Maybe null if no V required
        Throws:
        Error - - with a message to indicate failure (usu. bad params)
      • getPFactor

        INDArray getPFactor​(int M,
                            INDArray ipiv)
        This method takes one of the ipiv returns from LAPACK and creates the permutation matrix. When factorizing, it is useful to avoid underflows and overflows by reordering rows/and or columns of the input matrix (mostly these methods solve simultaneous equations, so order is not important). The ipiv method assumes that only row ordering is done ( never seen column ordering done )
        Parameters:
        M - - the size of the permutation matrix ( usu. the # rows in factored matrix )
        ipiv - - the vector returned from a refactoring
      • getLFactor

        INDArray getLFactor​(INDArray A)
        extracts the L (lower triangular) matrix from the LU factor result L will be the same dimensions as A
        Parameters:
        A - - the combined L & U matrices returned from factorization
      • getUFactor

        INDArray getUFactor​(INDArray A)
        extracts the U (upper triangular) matrix from the LU factor result U will be n x n matrix where n = num cols in A
        Parameters:
        A - - the combined L & U matrices returned from factorization
      • getri

        void getri​(int N,
                   INDArray A,
                   int lda,
                   int[] IPIV,
                   INDArray WORK,
                   int lwork,
                   int INFO)
        Generate inverse ggiven LU decomp
        Parameters:
        N -
        A -
        lda -
        IPIV -
        WORK -
        lwork -
        INFO -