Class QR.QRMatrix

  • Enclosing interface:
    QR<T>

    public static class QR.QRMatrix
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int m
      Row and column dimensions.
      private int n
      Row and column dimensions.
      private double[][] QR
      Array for internal storage of decomposition.
      private double[] Rdiag
      Array for internal storage of diagonal of R.
      static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      QRMatrix​(Matrix A)
      QR Decomposition, computed by Householder reflections.
    • Field Detail

      • QR

        private final double[][] QR
        Array for internal storage of decomposition.
      • m

        private final int m
        Row and column dimensions.
      • n

        private final int n
        Row and column dimensions.
      • Rdiag

        private final double[] Rdiag
        Array for internal storage of diagonal of R.
    • Constructor Detail

      • QRMatrix

        public QRMatrix​(Matrix A)
        QR Decomposition, computed by Householder reflections.
        Parameters:
        A - Rectangular matrix
    • Method Detail

      • isFullRank

        public final boolean isFullRank()
        Is the matrix full rank?
        Returns:
        true if R, and hence A, has full rank.
      • getH

        public final DenseDoubleMatrix2D getH()
        Return the Householder vectors
        Returns:
        Lower trapezoidal matrix whose columns define the reflections
      • getQ

        public final DenseDoubleMatrix2D getQ()
        Generate and return the (economy-sized) orthogonal factor
        Returns:
        Q
      • solve

        public final Matrix solve​(Matrix B)
        Least squares solution of A*X = B
        Parameters:
        B - A Matrix with as many rows as A and any number of columns.
        Returns:
        X that minimizes the two norm of Q*R*X-B.
        Throws:
        java.lang.IllegalArgumentException - Matrix row dimensions must agree.
        java.lang.RuntimeException - Matrix is rank deficient.