Class BigMatrix.QR

java.lang.Object
smile.math.matrix.BigMatrix.QR
All Implemented Interfaces:
Serializable
Enclosing class:
BigMatrix

public static class BigMatrix.QR extends Object implements Serializable
The QR decomposition. 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.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final BigMatrix
    The QR decomposition.
    final org.bytedeco.javacpp.DoublePointer
    The scalar factors of the elementary reflectors
  • Constructor Summary

    Constructors
    Constructor
    Description
    QR(BigMatrix qr, org.bytedeco.javacpp.DoublePointer tau)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the Cholesky decomposition of A'A.
    Q()
    Returns the orthogonal factor.
    R()
    Returns the upper triangular factor.
    double[]
    solve(double[] b)
    Solves the least squares min || B - A*X ||.
    void
    Solves the least squares min || B - A*X ||.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • qr

      public final BigMatrix qr
      The QR decomposition.
    • tau

      public final org.bytedeco.javacpp.DoublePointer tau
      The scalar factors of the elementary reflectors
  • Constructor Details

    • QR

      public QR(BigMatrix qr, org.bytedeco.javacpp.DoublePointer tau)
      Constructor.
      Parameters:
      qr - the QR decomposition.
      tau - the scalar factors of the elementary reflectors
  • Method Details

    • CholeskyOfAtA

      public BigMatrix.Cholesky CholeskyOfAtA()
      Returns the Cholesky decomposition of A'A.
      Returns:
      the Cholesky decomposition of A'A.
    • R

      public BigMatrix R()
      Returns the upper triangular factor.
      Returns:
      the upper triangular factor.
    • Q

      public BigMatrix Q()
      Returns the orthogonal factor.
      Returns:
      the orthogonal factor.
    • solve

      public double[] solve(double[] b)
      Solves the least squares min || B - A*X ||.
      Parameters:
      b - the right hand side of overdetermined linear system.
      Returns:
      the solution vector beta that minimizes ||Y - X*beta||.
      Throws:
      RuntimeException - when the matrix is rank deficient.
    • solve

      public void solve(BigMatrix B)
      Solves the least squares min || B - A*X ||.
      Parameters:
      B - the right hand side of overdetermined linear system. B will be overwritten with the solution matrix on output.
      Throws:
      RuntimeException - when the matrix is rank deficient.