Package no.uib.cipr.matrix
Class QRP
java.lang.Object
no.uib.cipr.matrix.QRP
Computes QR decompositions with column pivoting:
A*P = Q*R
where
A(m,n)
, Q(m,m)
, and R(m,n)
, more generally:
A*P = [Q1 Q2] * [R11, R12; 0 R22]
and R22
elements are
negligible.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExecutes a QR factorization for the given matrix.static QRP
Convenience method to compute a QR decompositiongetP()
Returns the column pivoting matrix.int[]
Returns the column pivoting vector.getQ()
Returns the orthogonal matrixgetR()
Returns the upper triangular factorint
getRank()
Returns the rank of the factored matrix
-
Constructor Details
-
QRP
public QRP(int m, int n) Constructs an empty QR decomposition- Parameters:
m
- the number of rows.n
- the number of columns.
-
-
Method Details
-
factorize
Convenience method to compute a QR decomposition- Parameters:
A
- the matrix to decompose (not modified)- Returns:
- Newly allocated decomposition
-
factor
Executes a QR factorization for the given matrix.- Parameters:
A
- the matrix to be factored (not modified)- Returns:
- the factorization object
-
getR
Returns the upper triangular factor -
getQ
Returns the orthogonal matrix -
getPVector
public int[] getPVector()Returns the column pivoting vector. This function is cheaper thangetP()
. -
getP
Returns the column pivoting matrix. This function allocates a new Matrix to be returned, a more cheap option is tu usegetPVector()
. -
getRank
public int getRank()Returns the rank of the factored matrix
-