Description
template<typename OpType = DenseGenMatProd<double>>
class Spectra::GenEigsSolver< OpType >
This class implements the eigen solver for general matrices, i.e., to solve \(Ax=\lambda x\) for a possibly non-symmetric (for real-valued matrices) or non-Hermitian (for complex-valued matrices) \(A\) matrix.
Most of the background information documented in the SymEigsSolver class also applies to the GenEigsSolver class here, except that the eigenvalues and eigenvectors of a general matrix can now be complex-valued.
- Template Parameters
-
OpType The name of the matrix operation class. Users could either use the wrapper classes such as DenseGenMatProd and SparseGenMatProd, or define their own that implements the type definition Scalarand all the public member functions as in DenseGenMatProd.
An example that illustrates the usage of GenEigsSolver is give below:
And also an example for sparse matrices:
GenEigsSolver also supports complex-valued matrices:
#include <GenEigsSolver.h>


Public Member Functions | |
| GenEigsSolver (OpType &op, Index nev, Index ncv) | |
| Constructor to create a solver object. More... | |
Public Member Functions inherited from Spectra::GenEigsBase< DenseGenMatProd< double >, IdentityBOp > | |
| void | init (const Scalar *init_resid) |
| Initializes the solver by providing an initial residual vector. More... | |
| void | init () |
| Initializes the solver by providing a random initial residual vector. More... | |
| Index | compute (SortRule selection=SortRule::LargestMagn, Index maxit=1000, RealScalar tol=1e-10, SortRule sorting=SortRule::LargestMagn) |
| Conducts the major computation procedure. More... | |
| CompInfo | info () const |
| Returns the status of the computation. More... | |
| Index | num_iterations () const |
| Returns the number of iterations used in the computation. | |
| Index | num_operations () const |
| Returns the number of matrix operations used in the computation. | |
| ComplexVector | eigenvalues () const |
| Returns the converged eigenvalues. More... | |
| ComplexMatrix | eigenvectors (Index nvec) const |
| Returns the eigenvectors associated with the converged eigenvalues. More... | |
| ComplexMatrix | eigenvectors () const |
| Returns all converged eigenvectors. | |
Additional Inherited Members | |
Protected Member Functions inherited from Spectra::GenEigsBase< DenseGenMatProd< double >, IdentityBOp > | |
| virtual void | sort_ritzpair (SortRule sort_rule) |
Protected Attributes inherited from Spectra::GenEigsBase< DenseGenMatProd< double >, IdentityBOp > | |
| DenseGenMatProd< double > & | m_op |
| const Index | m_n |
| const Index | m_nev |
| const Index | m_ncv |
| Index | m_nmatop |
| Index | m_niter |
| ArnoldiFac | m_fac |
| ComplexVector | m_ritz_val |
| ComplexMatrix | m_ritz_vec |
| ComplexVector | m_ritz_est |
Constructor & Destructor Documentation
◆ GenEigsSolver()
|
inline |
Constructor to create a solver object.
- Parameters
-
op The matrix operation object that implements the matrix-vector multiplication operation of \(A\): calculating \(Av\) for any vector \(v\). Users could either create the object from the wrapper class such as DenseGenMatProd, or define their own that implements all the public members as in DenseGenMatProd. nev Number of eigenvalues requested. This should satisfy \(1\le nev \le n-2\), where \(n\) is the size of matrix. ncv Parameter that controls the convergence speed of the algorithm. Typically a larger ncvmeans faster convergence, but it may also result in greater memory use and more matrix operations in each iteration. This parameter must satisfy \(nev+2 \le ncv \le n\), and is advised to take \(ncv \ge 2\cdot nev + 1\).
The documentation for this class was generated from the following file:
- /builds/uwsbel/chrono/src/chrono_thirdparty/spectra/Spectra/GenEigsSolver.h
Public Member Functions inherited from