public class DMatrixQrd
extends java.lang.Object
The QR decomposition is constructed even if the matrix A is rank deficient. However, the primary use of the QR decomposition is for least-squares solutions of non-square systems of linear equations, and such solutions are feasible only if the matrix A is of full rank.
This class was adapted from the package Jama, which was developed by Joe Hicklin, Cleve Moler, and Peter Webb of The MathWorks, Inc., and by Ronald Boisvert, Bruce Miller, Roldan Pozo, and Karin Remington of the National Institue of Standards and Technology.
Constructor and Description |
---|
DMatrixQrd(DMatrix a)
Constructs an QR decomposition for the specified matrix A.
|
Modifier and Type | Method and Description |
---|---|
DMatrix |
getQ()
Gets the m-by-n matrix factor Q.
|
DMatrix |
getR()
Gets the n-by-n upper triangular matrix factor R.
|
boolean |
isFullRank()
Determines whether the matrix A = Q*R is of full rank.
|
DMatrix |
solve(DMatrix b)
Returns the least-squares solution X of the system A*X = B.
|
public DMatrixQrd(DMatrix a)
a
- the matrix A.public boolean isFullRank()
public DMatrix getQ()
public DMatrix getR()
public DMatrix solve(DMatrix b)
b
- a matrix of right-hand-side vectors. This matrix must
have the same number (m) of rows as the matrix A, but may have
any number of columns.java.lang.IllegalStateException
- if A is rank-deficient.