Documentation of 'smile.math.matrix.QR' Java class
QR
smile.math.matrix

Class QR



  • public class QR
    extends java.lang.Object
    For an m-by-n matrix A with m ≥ n, the QR decomposition is an m-by-n orthogonal matrix Q and an n-by-n upper triangular matrix R such that A = Q*R.

    The QR decomposition always exists, even if the matrix does not have full rank. The primary use of the QR decomposition is in the least squares solution of non-square systems of simultaneous linear equations, where isSingular() has to be false.

    QR decomposition is also the basis for a particular eigenvalue algorithm, the QR algorithm.

    • Constructor Summary

      Constructors 
      Constructor and Description
      QR(DenseMatrix qr, double[] tau, boolean singular)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      Cholesky CholeskyOfAtA()
      Returns the Cholesky decomposition of A'A.
      DenseMatrix getQ()
      Returns the orthogonal factor.
      DenseMatrix getR()
      Returns the upper triangular factor.
      boolean isSingular()
      Returns true if the matrix is singular (not full column rank).
      void solve(DenseMatrix B)
      Solve the least squares A * X = B.
      void solve(double[] b, double[] x)
      Solve the least squares A*x = b.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QR

        public QR(DenseMatrix qr,
                  double[] tau,
                  boolean singular)
        Constructor.
    • Method Detail

      • isSingular

        public boolean isSingular()
        Returns true if the matrix is singular (not full column rank).
      • CholeskyOfAtA

        public Cholesky CholeskyOfAtA()
        Returns the Cholesky decomposition of A'A.
      • getR

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

        public DenseMatrix getQ()
        Returns the orthogonal factor.
      • solve

        public void solve(double[] b,
                          double[] x)
        Solve the least squares A*x = b.
        Parameters:
        b - right hand side of linear system.
        x - the output solution vector that minimizes the L2 norm of Q*R*x - b.
        Throws:
        java.lang.RuntimeException - if matrix is rank deficient.
      • solve

        public void solve(DenseMatrix B)
        Solve the least squares A * X = B. B will be overwritten with the solution matrix on output.
        Parameters:
        B - right hand side of linear system. B will be overwritten with the solution matrix on output.
        Throws:
        java.lang.RuntimeException - Matrix is rank deficient.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.