Class QR.QRMatrix
java.lang.Object
org.ujmp.core.doublematrix.calculation.general.decomposition.QR.QRMatrix
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
Row and column dimensions.private final int
Row and column dimensions.private final double[][]
Array for internal storage of decomposition.private final double[]
Array for internal storage of diagonal of R.static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal DenseDoubleMatrix2D
getH()
Return the Householder vectorsfinal DenseDoubleMatrix2D
getQ()
Generate and return the (economy-sized) orthogonal factorfinal DenseDoubleMatrix2D
getR()
Return the upper triangular factorfinal boolean
Is the matrix full rank?final Matrix
Least squares solution of A*X = B
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
QR
private final double[][] QRArray for internal storage of decomposition. -
m
private final int mRow and column dimensions. -
n
private final int nRow and column dimensions. -
Rdiag
private final double[] RdiagArray for internal storage of diagonal of R.
-
-
Constructor Details
-
QRMatrix
QR Decomposition, computed by Householder reflections.- Parameters:
A
- Rectangular matrix
-
-
Method Details
-
isFullRank
public final boolean isFullRank()Is the matrix full rank?- Returns:
- true if R, and hence A, has full rank.
-
getH
Return the Householder vectors- Returns:
- Lower trapezoidal matrix whose columns define the reflections
-
getR
Return the upper triangular factor- Returns:
- R
-
getQ
Generate and return the (economy-sized) orthogonal factor- Returns:
- Q
-
solve
Least squares solution of A*X = B- Parameters:
B
- A Matrix with as many rows as A and any number of columns.- Returns:
- X that minimizes the two norm of Q*R*X-B.
- Throws:
IllegalArgumentException
- Matrix row dimensions must agree.RuntimeException
- Matrix is rank deficient.
-