![]() |
CLA3P v0.3.1
Compact Linear Algebra Parallel Portable Package
|
Singular Value Decomposition (SVD) implementation for dense matrices. More...
Public Member Functions | |
| DefaultSVD () | |
| Constructs an uninitialized SVD decomposition object. | |
| DefaultSVD (int_t m, int_t n, svdPolicy_t leftPolicy=svdPolicy_t::Economy, svdPolicy_t rightPolicy=svdPolicy_t::Economy) | |
| Constructs an SVD object with pre-allocated buffers. | |
| ~DefaultSVD () | |
| Destroys the SVD 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. | |
| svdPolicy_t | getLeftPolicy () const |
| Retrieves the left singular vector computation policy. | |
| svdPolicy_t | getRightPolicy () const |
| Retrieves the right singular vector computation policy. | |
| void | setLeftPolicy (svdPolicy_t leftPolicy) |
| Configures the left singular vector computation policy. | |
| void | setRightPolicy (svdPolicy_t rightPolicy) |
| Configures the right singular vector computation policy. | |
| void | decompose (const T_Matrix &mat) |
| Performs Singular Value Decomposition on the input matrix. | |
| const T_RVector & | singularValues () const |
| Retrieves the computed singular values. | |
| const T_Matrix & | leftSingularVectors () const |
| Retrieves the left singular vectors matrix. | |
| const T_Matrix & | rightSingularVectors () const |
| Retrieves the right singular vectors matrix. | |
Singular Value Decomposition (SVD) implementation for dense matrices.
| T_Matrix | The dense matrix type to decompose. |
This class provides a complete Singular Value Decomposition interface, decomposing a matrix \( A \) into \( A = U \cdot \Sigma \cdot V^H \), where \( U \) and \( V \) are unitary matrices and \( \Sigma \) is diagonal.
| cla3p::DefaultSVD< T_Matrix >::DefaultSVD | ( | ) |
Constructs an uninitialized SVD decomposition object.
Initializes an empty SVD object with no allocated memory for decomposition results.
| cla3p::DefaultSVD< T_Matrix >::DefaultSVD | ( | int_t | m, |
| int_t | n, | ||
| svdPolicy_t | leftPolicy = svdPolicy_t::Economy, | ||
| svdPolicy_t | rightPolicy = svdPolicy_t::Economy ) |
Constructs an SVD object with pre-allocated buffers.
Initializes the SVD 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. |
| [in] | leftPolicy | The singular vector computation policy for \( U \). |
| [in] | rightPolicy | The singular vector computation policy for \( V \). |
| cla3p::DefaultSVD< T_Matrix >::~DefaultSVD | ( | ) |
Destroys the SVD decomposition object.
Releases all allocated memory and clears internal data structures.
| void cla3p::DefaultSVD< T_Matrix >::clear | ( | ) |
Clears all decomposition results and resets the object.
Deallocates decomposition results and returns the object to its default state.
| void cla3p::DefaultSVD< 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. |
| svdPolicy_t cla3p::DefaultSVD< T_Matrix >::getLeftPolicy | ( | ) | const |
Retrieves the left singular vector computation policy.
Returns the policy that determines whether the left singular vectors ( \( U \) matrix) will be computed in full, limited to \( \min(m,n) \) columns, or not at all.
| svdPolicy_t cla3p::DefaultSVD< T_Matrix >::getRightPolicy | ( | ) | const |
Retrieves the right singular vector computation policy.
Returns the policy that determines whether the right singular vectors ( \( V^H \) matrix) will be computed in full, limited to \( \min(m,n) \) rows, or not at all.
| void cla3p::DefaultSVD< T_Matrix >::setLeftPolicy | ( | svdPolicy_t | leftPolicy | ) |
Configures the left singular vector computation policy.
Specifies whether the left singular vectors ( \( U \) matrix) should be computed in full, limited to \( \min(m,n) \) columns, or not computed at all.
| [in] | leftPolicy | The left singular vector computation policy. |
| void cla3p::DefaultSVD< T_Matrix >::setRightPolicy | ( | svdPolicy_t | rightPolicy | ) |
Configures the right singular vector computation policy.
Specifies whether the right singular vectors ( \( V^H \) matrix) should be computed in full, limited to \( \min(m,n) \) rows, or not computed at all.
| [in] | rightPolicy | The right singular vector computation policy. |
| void cla3p::DefaultSVD< T_Matrix >::decompose | ( | const T_Matrix & | mat | ) |
Performs Singular Value Decomposition on the input matrix.
Computes the decomposition \( A = U \cdot \Sigma \cdot V^H \) of the input matrix. The computation respects the singular vector policies set via setLeftPolicy() and setRightPolicy().
| [in] | mat | The matrix to decompose. |
| const T_RVector & cla3p::DefaultSVD< T_Matrix >::singularValues | ( | ) | const |
Retrieves the computed singular values.
Returns the diagonal elements of \( \Sigma \) in descending order.
| const T_Matrix & cla3p::DefaultSVD< T_Matrix >::leftSingularVectors | ( | ) | const |
Retrieves the left singular vectors matrix.
Returns the matrix \( U \) of size \( m \times k \), where:
| const T_Matrix & cla3p::DefaultSVD< T_Matrix >::rightSingularVectors | ( | ) | const |
Retrieves the right singular vectors matrix.
Returns the matrix \( V^H \) of size \( k \times n \), where: