Package no.uib.cipr.matrix
Class QRP
- java.lang.Object
-
- no.uib.cipr.matrix.QRP
-
public class QRP extends java.lang.ObjectComputes QR decompositions with column pivoting:A*P = Q*RwhereA(m,n),Q(m,m), andR(m,n), more generally:A*P = [Q1 Q2] * [R11, R12; 0 R22]andR22elements 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 QRPfactor(Matrix A)Executes a QR factorization for the given matrix.static QRPfactorize(Matrix A)Convenience method to compute a QR decompositionMatrixgetP()Returns the column pivoting matrix.int[]getPVector()Returns the column pivoting vector.DenseMatrixgetQ()Returns the orthogonal matrixDenseMatrixgetR()Returns the upper triangular factorintgetRank()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
-
-