public class QRDecomposition extends Object implements Serializable
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.
Constructor and Description |
---|
QRDecomposition(DoubleMatrix2D A)
Constructs and returns a new QR decomposition object; computed by Householder reflections;
The decomposed matrices can be retrieved via instance methods of the returned decomposition object.
|
Modifier and Type | Method and Description |
---|---|
DoubleMatrix2D |
getH()
Returns the Householder vectors H.
|
DoubleMatrix2D |
getQ()
Generates and returns the (economy-sized) orthogonal factor Q.
|
DoubleMatrix2D |
getR()
Returns the upper triangular factor, R.
|
boolean |
hasFullRank()
Returns whether the matrix A has full rank.
|
DoubleMatrix2D |
solve(DoubleMatrix2D B)
Least squares solution of A*X = B; returns X.
|
String |
toString()
Returns a String with (propertyName, propertyValue) pairs.
|
public QRDecomposition(DoubleMatrix2D A)
A
- A rectangular matrix.IllegalArgumentException
- if A.rows() < A.columns().public DoubleMatrix2D getH()
public DoubleMatrix2D getQ()
public DoubleMatrix2D getR()
public boolean hasFullRank()
public DoubleMatrix2D solve(DoubleMatrix2D B)
B
- A matrix with as many rows as A and any number of columns.IllegalArgumentException
- if B.rows() != A.rows().IllegalArgumentException
- if !this.hasFullRank() (A is rank deficient).Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.