![]() |
CLA3P v0.3.1
Compact Linear Algebra Parallel Portable Package
|
Partial Pivoted QR Decomposition for rank reduction algorithms. More...
Public Member Functions | |
| PartialQR () | |
| Constructs an uninitialized partial QR object. | |
| PartialQR (int_t m, int_t n) | |
| Constructs a partial QR object with pre-allocated buffers. | |
| ~PartialQR () | |
| Destroys the partial QR decomposition object. | |
| void | clear () |
| Clears all decomposition results and resets the object. | |
| void | reserve (int_t m, int_t n) |
| Pre-allocates buffers for decomposition. | |
| real_t | cutTolerance () const |
| Retrieves the singular value tolerance threshold. | |
| void | setCutTolerance (real_t tol) |
| Configures the singular value tolerance threshold. | |
| void | decompose (const T_Matrix &mat) |
| Initiates the partial QR decomposition. | |
| void | resume (bool ignoreTol=false) |
| Resumes the partial QR decomposition. | |
| int_t | performDecompositionStep () |
| Performs a single decomposition step. | |
| int_t | totalColumnsProcessed () const |
| Retrieves the count of processed columns. | |
| const T_Matrix & | R () const |
| Retrieves the upper triangular matrix. | |
| const T_Vector & | tau () const |
| Retrieves the Householder reflection coefficients. | |
| const prm::PiMatrix & | P () const |
| Retrieves the column pivoting permutation matrix. | |
| const T_Matrix & | elementaryReflectors () const |
| Retrieves the elementary Householder reflector matrix. | |
| bool | transFlag () const |
| Determines if input matrix was transposed. | |
| void | fillMatrixR (int_t numRanks=0) |
| Extracts the upper triangular portion to form matrix \( R \). | |
Partial Pivoted QR Decomposition for rank reduction algorithms.
| T_Matrix | The dense matrix type to decompose. |
This class implements a partial (stopped) QR decomposition with column pivoting, useful for low-rank approximation and rank reduction processes. The algorithm processes the matrix incrementally, stopping when singular values fall below a specified tolerance threshold. The input matrix is automatically transposed as needed to ensure tall-matrix orientation ( \( m \geq n \)).
| cla3p::PartialQR< T_Matrix >::PartialQR | ( | ) |
Constructs an uninitialized partial QR object.
Initializes an empty partial QR object with no allocated memory for decomposition results.
| cla3p::PartialQR< T_Matrix >::PartialQR | ( | int_t | m, |
| int_t | n ) |
Constructs a partial QR object with pre-allocated buffers.
Initializes the partial QR decomposition object and allocates internal buffers to accommodate matrices up to the specified dimensions.
| [in] | m | The maximum number of matrix rows. |
| [in] | n | The maximum number of matrix columns. |
| cla3p::PartialQR< T_Matrix >::~PartialQR | ( | ) |
Destroys the partial QR decomposition object.
Releases all allocated memory and clears internal data structures.
| void cla3p::PartialQR< T_Matrix >::clear | ( | ) |
Clears all decomposition results and resets the object.
Deallocates decomposition results and returns the object to its default state.
| void cla3p::PartialQR< T_Matrix >::reserve | ( | int_t | m, |
| int_t | n ) |
Pre-allocates buffers for decomposition.
Allocates internal buffers to accommodate matrices with up to m rows and n columns. This avoids memory reallocation during subsequent decompositions.
| [in] | m | The maximum number of matrix rows to support. |
| [in] | n | The maximum number of matrix columns to support. |
| real_t cla3p::PartialQR< T_Matrix >::cutTolerance | ( | ) | const |
Retrieves the singular value tolerance threshold.
Returns the relative tolerance parameter used to determine which columns are kept in the partial QR decomposition. Diagonal elements \( R_{i,i} \) are retained if \( |R_{i,i}| > |R_{0,0}| \cdot \text{cutTolerance}() \).
| void cla3p::PartialQR< T_Matrix >::setCutTolerance | ( | real_t | tol | ) |
Configures the singular value tolerance threshold.
Sets the relative tolerance parameter that determines stopping condition. Diagonal elements \( R_{i,i} \) are retained if \( |R_{i,i}| > |R_{0,0}| \cdot \text{tol} \).
| [in] | tol | The desired cutoff tolerance value. |
| void cla3p::PartialQR< T_Matrix >::decompose | ( | const T_Matrix & | mat | ) |
Initiates the partial QR decomposition.
Begins column-wise QR decomposition with column pivoting, stopping when the tolerance criterion \( |R_{i,i}| > |R_{0,0}| \cdot \text{cutTolerance}() \) is violated.
| [in] | mat | The matrix to decompose. |
| void cla3p::PartialQR< T_Matrix >::resume | ( | bool | ignoreTol = false | ) |
Resumes the partial QR decomposition.
Continues the decomposition from where decompose() or the previous resume() stopped. The decomposition proceeds until the tolerance criterion \( |R_{i,i}| > |R_{0,0}| \cdot \text{cutTolerance}() \) is violated, or all columns are processed if ignoreTol is true.
| [in] | ignoreTol | If true, ignores the tolerance criterion and decomposes all remaining columns. |
| int_t cla3p::PartialQR< T_Matrix >::performDecompositionStep | ( | ) |
Performs a single decomposition step.
Executes one decomposition step with an automatically determined block size.
| int_t cla3p::PartialQR< T_Matrix >::totalColumnsProcessed | ( | ) | const |
Retrieves the count of processed columns.
Returns the total number of columns processed so far throughout the partial QR decomposition.
| const T_Matrix & cla3p::PartialQR< T_Matrix >::R | ( | ) | const |
Retrieves the upper triangular matrix.
Returns the matrix \( R \) calculated so far in the partial QR decomposition process.
| const T_Vector & cla3p::PartialQR< T_Matrix >::tau | ( | ) | const |
Retrieves the Householder reflection coefficients.
Returns the vector \( \tau \) of size \( \min(m,n) \) containing the scalar factors for elementary Householder reflectors.
| const prm::PiMatrix & cla3p::PartialQR< T_Matrix >::P | ( | ) | const |
Retrieves the column pivoting permutation matrix.
Returns the permutation matrix \( P \) that encodes the column pivots applied during the partial QR decomposition process.
| const T_Matrix & cla3p::PartialQR< T_Matrix >::elementaryReflectors | ( | ) | const |
Retrieves the elementary Householder reflector matrix.
Returns a matrix containing the elementary Householder vectors used to implicitly represent the orthogonal transformation matrix from the QR decomposition.
| bool cla3p::PartialQR< T_Matrix >::transFlag | ( | ) | const |
Determines if input matrix was transposed.
Indicates whether the input matrix was automatically conjugate-transposed during initialization to achieve tall-matrix orientation.
true if the matrix was transposed, false otherwise. | void cla3p::PartialQR< T_Matrix >::fillMatrixR | ( | int_t | numRanks = 0 | ) |
Extracts the upper triangular portion to form matrix \( R \).
Constructs matrix \( R \) from the elementary reflector matrix, optionally keeping only the first numRanks columns.
| [in] | numRanks | The number of columns to retain (0 means all columns). |