![]() |
CLA3P v0.3.1
Compact Linear Algebra Parallel Portable Package
|
Eigenvalue decomposition solver using LAPACK GEEV routines. More...
Public Member Functions | |
| LapackGeev () | |
| Default constructor. | |
| LapackGeev (bool calcLeft, bool calcRight) | |
| Constructor with explicit eigenvector options. | |
| ~LapackGeev () | |
| Destructor. | |
| void | reserve (int_t n) |
Pre-allocates internal buffers for a matrix of dimension n. | |
| void | clear () |
| Clears all internal data and releases allocated memory. | |
| void | decompose (const T_Matrix &mat) |
Performs the eigenvalue decomposition of mat. | |
| void | setCalcLeft (bool calcLeft) |
| Sets whether to compute left eigenvectors. | |
| void | setCalcRight (bool calcRight) |
| Sets whether to compute right eigenvectors. | |
| bool | getCalcLeft () const |
| Checks if left eigenvectors will be computed. | |
| bool | getCalcRight () const |
| Checks if right eigenvectors will be computed. | |
| const T_CVector & | eigenvalues () const |
| Returns the computed eigenvalues. | |
| const T_CMatrix & | leftEigenvectors () const |
| Returns the computed left eigenvectors. | |
| const T_CMatrix & | rightEigenvectors () const |
| Returns the computed right eigenvectors. | |
Eigenvalue decomposition solver using LAPACK GEEV routines.
This class provides a high-level interface for computing eigenvalues and eigenvectors of general (non-symmetric) square matrices using the LAPACK GEEV implementation (real: dgeev/sgeev, complex: zgeev/cgeev).
The GEEV routine computes the eigenvalue decomposition of a general matrix \( A \):
Results are always returned as complex matrices/vectors, even for real input matrices, since real matrices may have complex conjugate eigenvalue pairs. Internal buffers are managed automatically and can be pre-allocated via reserve() to avoid repeated heap allocations when the solver is reused for multiple decompositions.
| T_Matrix | The dense matrix type to decompose (can be real or complex). |
| cla3p::LapackGeev< T_Matrix >::LapackGeev | ( | ) |
Default constructor.
Initializes the eigenvalue solver with default settings. calcLeft is set to false and calcRight is set to true, so only right eigenvectors are computed by default.
| cla3p::LapackGeev< T_Matrix >::LapackGeev | ( | bool | calcLeft, |
| bool | calcRight ) |
Constructor with explicit eigenvector options.
Initializes the eigenvalue solver with the specified eigenvector computation options. Use this form when left eigenvectors are needed or when neither set of eigenvectors is required (eigenvalues only).
| [in] | calcLeft | If true, left eigenvectors will be computed in decompose(). |
| [in] | calcRight | If true, right eigenvectors will be computed in decompose(). |
| cla3p::LapackGeev< T_Matrix >::~LapackGeev | ( | ) |
Destructor.
Releases all allocated resources and clears internal state.
| void cla3p::LapackGeev< T_Matrix >::reserve | ( | int_t | n | ) |
Pre-allocates internal buffers for a matrix of dimension n.
Allocates all scalar and complex workspace buffers required for eigenvalue decomposition of an n x n matrix. Calling this before decompose() avoids repeated heap allocations when the same solver instance is reused across multiple decompositions of equal or smaller size.
| [in] | n | Matrix dimension. |
| void cla3p::LapackGeev< T_Matrix >::clear | ( | ) |
Clears all internal data and releases allocated memory.
Resets the solver to its initial state, releasing all computed results, internal workspace buffers, and resetting options to their defaults (calcLeft = false, calcRight = true).
| void cla3p::LapackGeev< T_Matrix >::decompose | ( | const T_Matrix & | mat | ) |
Performs the eigenvalue decomposition of mat.
Computes the eigenvalues and, depending on the current settings, the left and/or right eigenvectors of mat using the LAPACK GEEV routine. The input matrix is copied internally before factorization; the original is left unmodified.
Results are accessible via eigenvalues(), leftEigenvectors(), and rightEigenvectors() after this call returns.
| [in] | mat | Square general dense matrix to decompose. |
| void cla3p::LapackGeev< T_Matrix >::setCalcLeft | ( | bool | calcLeft | ) |
Sets whether to compute left eigenvectors.
Takes effect on the next call to decompose(). Changing this setting after reserve() has been called will require new buffer allocations on the next decompose().
| [in] | calcLeft | If true, left eigenvectors will be computed. |
| void cla3p::LapackGeev< T_Matrix >::setCalcRight | ( | bool | calcRight | ) |
Sets whether to compute right eigenvectors.
Takes effect on the next call to decompose(). Changing this setting after reserve() has been called will require new buffer allocations on the next decompose().
| [in] | calcRight | If true, right eigenvectors will be computed. |
| bool cla3p::LapackGeev< T_Matrix >::getCalcLeft | ( | ) | const |
Checks if left eigenvectors will be computed.
true if left eigenvectors will be computed, false otherwise. | bool cla3p::LapackGeev< T_Matrix >::getCalcRight | ( | ) | const |
Checks if right eigenvectors will be computed.
true if right eigenvectors will be computed, false otherwise. | const T_CVector & cla3p::LapackGeev< T_Matrix >::eigenvalues | ( | ) | const |
Returns the computed eigenvalues.
Each element i of the returned vector corresponds to the i-th eigenvalue \( \lambda_i \), matching the column ordering of leftEigenvectors() and rightEigenvectors().
n containing the eigenvalues. | const T_CMatrix & cla3p::LapackGeev< T_Matrix >::leftEigenvectors | ( | ) | const |
Returns the computed left eigenvectors.
Column i of the returned matrix contains the left eigenvector \( w_i \) satisfying \( w_i^H A = \lambda_i w_i^H \), where \( \lambda_i \) is eigenvalues() [i].
n x n matrix of left eigenvectors. true. | const T_CMatrix & cla3p::LapackGeev< T_Matrix >::rightEigenvectors | ( | ) | const |
Returns the computed right eigenvectors.
Column i of the returned matrix contains the right eigenvector \( v_i \) satisfying \( A v_i = \lambda_i v_i \), where \( \lambda_i \) is eigenvalues() [i].
n x n matrix of right eigenvectors. true.