QR class

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 so that A = Q*R. The QR decompostion always exists, even if the matrix does not have full rank, so the constructor will never fail. The primary use of the QR decomposition is in the least squares solution of nonsquare systems of simultaneous linear equations. This will fail if isFullRank() returns false.

References

  1. "QR Decomposition". https://en.wikipedia.org/wiki/QR_decomposition. Retrieved 2019-07-17.
  2. "Jama". https://math.nist.gov/javanumerics/jama/. Retrieved 2019-07-17.
  3. "QR Decomposition Algorithms". https://rosettacode.org/wiki/QR_decomposition#Java. Retrieved 2019-07-17.
  4. "numpy.linalg.qr". https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.qr.html. Retrieved 2019-07-17.

Examples

var qr = QR(Array2d([
   Array([4.0, 2.0, 1.0]),
   Array([16.0, 4.0, 1.0]),
   Array([64.0, 8.0, 1.0])
]));
var q = qr.Q();
print(q);
var r = qr.R();
print(r);

Constructors

QR(Array2d A)
QR Decomposition, computed by Householder reflections. Structure to access R and the Householder vectors and compute Q. A Rectangular matrix

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

H() Array2d
Return the Householder vectors return Lower trapezoidal matrix whose columns define the reflections
isFullRank() bool
Is the matrix full rank? return true if R, and hence A, has full rank.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
Q() Array2d
Generate and return the (economy-sized) orthogonal factor Q
R() Array2d
Return the upper triangular factor R
solve(Array2d B) Array2d
Least squares solution of AX = B B A Matrix with as many rows as A and any number of columns. return X that minimizes the two norm of QR*X-B.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited