Class QR
- java.lang.Object
-
- dev.nm.algebra.linear.matrix.doubles.factorization.qr.QR
-
- All Implemented Interfaces:
QRDecomposition
public class QR extends Object implements QRDecomposition
QR decomposition of a matrix decomposes an m x n matrix A so that A = Q * R.- Q is an m x n orthogonal matrix;
- R is a n x n upper triangular matrix.
- sqQ is a square m x m orthogonal matrix;
- tallR is a m x n matrix.
- See Also:
- Wikipedia: QR decomposition
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PermutationMatrixP()Get P, the pivoting matrix in the QR decomposition.MatrixQ()Get the orthogonal Q matrix in the QR decomposition, A = QR.UpperTriangularMatrixR()Get the upper triangular matrix R in the QR decomposition, A = QR.intrank()Get the numerical rank of A as computed by the QR decomposition.MatrixsquareQ()Get the square Q matrix.MatrixtallR()Get the tall R matrix.
-
-
-
Method Detail
-
P
public PermutationMatrix P()
Description copied from interface:QRDecompositionGet P, the pivoting matrix in the QR decomposition.- Specified by:
Pin interfaceQRDecomposition- Returns:
- P
-
Q
public Matrix Q()
Description copied from interface:QRDecompositionGet the orthogonal Q matrix in the QR decomposition, A = QR. The dimension of Q is m x n, the same as A, the matrix to be orthogonalized.- Specified by:
Qin interfaceQRDecomposition- Returns:
- Q
-
R
public UpperTriangularMatrix R()
Description copied from interface:QRDecompositionGet the upper triangular matrix R in the QR decomposition, A = QR. The dimension of R is n x n, a square matrix.- Specified by:
Rin interfaceQRDecomposition- Returns:
- R
-
rank
public int rank()
Description copied from interface:QRDecompositionGet the numerical rank of A as computed by the QR decomposition. Numerical determination of rank requires a criterion to decide when a value should be treated as zero, hence a precision parameter. This is a practical choice which depends on both the matrix and the application. For instance, for a matrix with a big first eigenvector, we should accordingly decrease the precision to compute the rank.- Specified by:
rankin interfaceQRDecomposition- Returns:
- the rank of A
-
squareQ
public Matrix squareQ()
Description copied from interface:QRDecompositionGet the square Q matrix. This is an arbitrary orthogonal completion of the Q matrix in the QR decomposition. The dimension is m x m (square). We have A = sqQ * tallR.- Specified by:
squareQin interfaceQRDecomposition- Returns:
- the square Q matrix
-
tallR
public Matrix tallR()
Description copied from interface:QRDecompositionGet the tall R matrix. This is completed by binding zero rows beneath the square upper triangular matrix R in the QR decomposition. The dimension is m x n. It may not be square. We have A = sqQ * tallR.- Specified by:
tallRin interfaceQRDecomposition- Returns:
- the tall R matrix
-
-