public class QRColPivDecompositionHouseholderColumn_D64 extends QRDecompositionHouseholderColumn_D64 implements QRPDecomposition<DenseMatrix64F>
Performs QR decomposition with column pivoting. To prevent overflow/underflow the whole matrix
is normalized by the max value, but columns are not normalized individually any more. To enable
code reuse it extends QRDecompositionHouseholderColumn_D64 and functions from that class
are used whenever possible. Columns are transposed into single arrays, which allow for
fast pivots.
Decomposition: A*P = Q*R
Based off the description in "Fundamentals of Matrix Computations", 2nd by David S. Watkins.
| Modifier and Type | Field and Description |
|---|---|
protected double |
maxAbs |
protected double[] |
normsCol |
protected int[] |
pivots |
protected int |
rank |
protected double |
singularThreshold |
| Constructor and Description |
|---|
QRColPivDecompositionHouseholderColumn_D64() |
QRColPivDecompositionHouseholderColumn_D64(double singularThreshold)
Configure parameters.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
decompose(DenseMatrix64F A)
To decompose the matrix 'A' it must have full rank.
|
DenseMatrix64F |
getPivotMatrix(DenseMatrix64F P)
Creates the pivot matrix.
|
int[] |
getPivots()
Ordering of each column after pivoting.
|
DenseMatrix64F |
getQ(DenseMatrix64F Q,
boolean compact)
Computes the Q matrix from the information stored in the QR matrix.
|
int |
getRank()
Returns the rank as determined by the algorithm.
|
protected boolean |
householderPivot(int j)
Computes the householder vector "u" for the first column of submatrix j.
|
void |
setExpectedMaxSize(int numRows,
int numCols) |
void |
setSingularThreshold(double threshold)
Specifies the threshold used to flag a column as being singular.
|
convertToColumnMajor, getGammas, getQR, getR, householder, inputModified, updateAclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRinputModifiedprotected int[] pivots
protected double[] normsCol
protected double maxAbs
protected double singularThreshold
protected int rank
public QRColPivDecompositionHouseholderColumn_D64(double singularThreshold)
singularThreshold - The singular threshold.public QRColPivDecompositionHouseholderColumn_D64()
public void setSingularThreshold(double threshold)
QRPDecompositionSpecifies the threshold used to flag a column as being singular. The specified threshold is relative and will very depending on the system. The default value is UtilEJML.EPS.
setSingularThreshold in interface QRPDecomposition<DenseMatrix64F>threshold - Singular threshold.public void setExpectedMaxSize(int numRows,
int numCols)
setExpectedMaxSize in class QRDecompositionHouseholderColumn_D64public DenseMatrix64F getQ(DenseMatrix64F Q, boolean compact)
getQ in interface QRDecomposition<DenseMatrix64F>getQ in class QRDecompositionHouseholderColumn_D64Q - The orthogonal Q matrix.compact - If true an m by n matrix is created, otherwise n by n.public boolean decompose(DenseMatrix64F A)
To decompose the matrix 'A' it must have full rank. 'A' is a 'm' by 'n' matrix. It requires about 2n*m2-2m2/3 flops.
The matrix provided here can be of different dimension than the one specified in the constructor. It just has to be smaller than or equal to it.
decompose in interface DecompositionInterface<DenseMatrix64F>decompose in class QRDecompositionHouseholderColumn_D64A - The matrix which is being decomposed. Modification is implementation dependent.protected boolean householderPivot(int j)
Computes the householder vector "u" for the first column of submatrix j. The already computed norm is used and checks to see if the matrix is singular at this point.
Q = I - γuuT
This function finds the values of 'u' and 'γ'.
j - Which submatrix to work off of.public int getRank()
QRPDecompositiongetRank in interface QRPDecomposition<DenseMatrix64F>public int[] getPivots()
QRPDecompositiongetPivots in interface QRPDecomposition<DenseMatrix64F>public DenseMatrix64F getPivotMatrix(DenseMatrix64F P)
QRPDecompositiongetPivotMatrix in interface QRPDecomposition<DenseMatrix64F>P - Optional storage for pivot matrix. If null a new matrix will be created.