Class QRP


  • public class QRP
    extends java.lang.Object
    Computes QR decompositions with column pivoting: A*P = Q*R where A(m,n), Q(m,m), and R(m,n), more generally: A*P = [Q1 Q2] * [R11, R12; 0 R22] and R22 elements are negligible.
    • Constructor Summary

      Constructors 
      Constructor Description
      QRP​(int m, int n)
      Constructs an empty QR decomposition
    • Constructor Detail

      • QRP

        public QRP​(int m,
                   int n)
        Constructs an empty QR decomposition
        Parameters:
        m - the number of rows.
        n - the number of columns.
    • Method Detail

      • factorize

        public static QRP factorize​(Matrix A)
        Convenience method to compute a QR decomposition
        Parameters:
        A - the matrix to decompose (not modified)
        Returns:
        Newly allocated decomposition
      • factor

        public QRP factor​(Matrix A)
        Executes a QR factorization for the given matrix.
        Parameters:
        A - the matrix to be factored (not modified)
        Returns:
        the factorization object
      • getR

        public DenseMatrix getR()
        Returns the upper triangular factor
      • getQ

        public DenseMatrix getQ()
        Returns the orthogonal matrix
      • getPVector

        public int[] getPVector()
        Returns the column pivoting vector. This function is cheaper than getP().
      • getP

        public Matrix getP()
        Returns the column pivoting matrix. This function allocates a new Matrix to be returned, a more cheap option is tu use getPVector().
      • getRank

        public int getRank()
        Returns the rank of the factored matrix