Package no.uib.cipr.matrix
Class QRP
- java.lang.Object
-
- no.uib.cipr.matrix.QRP
-
public class QRP extends java.lang.Object
Computes QR decompositions with column pivoting:A*P = Q*R
whereA(m,n)
,Q(m,m)
, andR(m,n)
, more generally:A*P = [Q1 Q2] * [R11, R12; 0 R22]
andR22
elements are negligible.
-
-
Constructor Summary
Constructors Constructor Description QRP(int m, int n)
Constructs an empty QR decomposition
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description QRP
factor(Matrix A)
Executes a QR factorization for the given matrix.static QRP
factorize(Matrix A)
Convenience method to compute a QR decompositionMatrix
getP()
Returns the column pivoting matrix.int[]
getPVector()
Returns the column pivoting vector.DenseMatrix
getQ()
Returns the orthogonal matrixDenseMatrix
getR()
Returns the upper triangular factorint
getRank()
Returns the rank of the factored matrix
-
-
-
Method Detail
-
factorize
public static QRP factorize(Matrix A)
Convenience method to compute a QR decomposition- Parameters:
A
- the matrix to decompose (not modified)- Returns:
- Newly allocated decomposition
-
factor
public QRP factor(Matrix A)
Executes a QR factorization for the given matrix.- Parameters:
A
- the matrix to be factored (not modified)- Returns:
- the factorization object
-
getR
public DenseMatrix getR()
Returns the upper triangular factor
-
getQ
public DenseMatrix getQ()
Returns the orthogonal matrix
-
getPVector
public int[] getPVector()
Returns the column pivoting vector. This function is cheaper thangetP()
.
-
getP
public Matrix 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
-
-