Package org.jblas

Class Decompose


  • public class Decompose
    extends java.lang.Object
    Matrix which collects all kinds of decompositions.
    • Constructor Detail

      • Decompose

        public Decompose()
    • Method Detail

      • lu

        public static Decompose.LUDecomposition<DoubleMatrix> lu​(DoubleMatrix A)
        Compute LU Decomposition of a general matrix. Computes the LU decomposition using GETRF. Returns three matrices L, U, P, where L is lower diagonal, U is upper diagonal, and P is a permutation matrix such that A = P * L * U.
        Parameters:
        A - general matrix
        Returns:
        An LUDecomposition object.
      • cholesky

        public static FloatMatrix cholesky​(FloatMatrix A)
        if (info ) Compute Cholesky decomposition of A
        Parameters:
        A - symmetric, positive definite matrix (only upper half is used)
        Returns:
        upper triangular matrix U such that A = U' * U
      • clearLower

        private static void clearLower​(FloatMatrix A)
      • lu

        public static Decompose.LUDecomposition<FloatMatrix> lu​(FloatMatrix A)
        Compute LU Decomposition of a general matrix. Computes the LU decomposition using GETRF. Returns three matrices L, U, P, where L is lower diagonal, U is upper diagonal, and P is a permutation matrix such that A = P * L * U.
        Parameters:
        A - general matrix
        Returns:
        An LUDecomposition object.
      • cholesky

        public static DoubleMatrix cholesky​(DoubleMatrix A)
        Compute Cholesky decomposition of A
        Parameters:
        A - symmetric, positive definite matrix (only upper half is used)
        Returns:
        upper triangular matrix U such that A = U' * U
      • clearLower

        private static void clearLower​(DoubleMatrix A)
      • qr

        public static Decompose.QRDecomposition<DoubleMatrix> qr​(DoubleMatrix A)
        QR decomposition. Decomposes (m,n) matrix A into a (m,m) matrix Q and an (m,n) matrix R such that Q is orthogonal, R is upper triangular and Q * R = A Note that if A has more rows than columns, then the lower rows of R will contain only zeros, such that the corresponding later columns of Q do not enter the computation at all. For some reason, LAPACK does not properly normalize those columns.
        Parameters:
        A - matrix
        Returns:
        QR decomposition
      • qr

        public static Decompose.QRDecomposition<FloatMatrix> qr​(FloatMatrix A)
        QR decomposition. Decomposes (m,n) matrix A into a (m,m) matrix Q and an (m,n) matrix R such that Q is orthogonal, R is upper triangular and Q * R = A
        Parameters:
        A - matrix
        Returns:
        QR decomposition