This class implements a wrapper to the Spectra generalized eigen solver for square real symmetric matrices, i.e. to solve \( Ax = \lambda Bx\), where A is symmetric and B is positive definite. It calculates the full spectrum of eigenvalues. More...
#include <ikarus/solver/eigenvaluesolver/generalizedeigensolver.hh>
Public Types | |
| using | ScalarType = typename MT::Scalar |
| using | MatrixType = MT |
| using | ProductType = std::conditional_t< isDense, Spectra::DenseSymMatProd< ScalarType >, Spectra::SparseSymMatProd< ScalarType > > |
| using | CholeskyType = std::conditional_t< isDense, Spectra::DenseCholesky< ScalarType >, Spectra::SparseCholesky< ScalarType > > |
| using | SolverType = Spectra::SymGEigsSolver< ProductType, CholeskyType, Spectra::GEigsMode::Cholesky > |
Public Member Functions | |
| template<typename MATA , typename MATB > requires (Concepts::DenseOrSparseEigenMatrix<std::remove_cvref_t<MATA>>) | |
| GeneralizedSymEigenSolver (MATA &&A, MATB &&B) | |
| Construct a new GeneralizedSymEigenSolver object. More... | |
| template<Concepts::FlatAssembler AssemblerA, Concepts::FlatAssembler AssemblerB> | |
| GeneralizedSymEigenSolver (std::shared_ptr< AssemblerA > assemblerA, const std::shared_ptr< AssemblerB > &assemblerB) | |
| Construct a new GeneralSymEigenSolver object. More... | |
| bool | compute (Eigen::Index maxit=1000, ScalarType tolerance=1e-10) |
| Starts the computation of the eigenvalue solver. More... | |
| auto & | eigenvalues () const |
| Returns the eigenvalues of the generalized eigenvalue problem. More... | |
| auto & | eigenvectors () const |
| Returns the eigenvectors of the generalized eigenvalue problem. More... | |
| Eigen::Index | nev () const |
| Returns the number of eigenvalues of the problem. More... | |
Static Public Attributes | |
| static constexpr bool | isDense = Concepts::EigenMatrix<MT> |
Under the hood it uses the Spectra::SymGEigsSolver with Cholesky decomposition for B. As this class can only compute up to \( n-1 \) smallest or greatest eigenvalues, we use two different solvers for the n/2 smallest and n/2 greatest eigenvalues. The matrices are shared throughout the solvers so no extra copy is being made.
| MT | the used Matrix Type, can be a sparse or dense Eigen::Matrix |
| using Ikarus::GeneralizedSymEigenSolver< EigenValueSolverType::Spectra, MT >::CholeskyType = std::conditional_t<isDense, Spectra::DenseCholesky<ScalarType>, Spectra::SparseCholesky<ScalarType> > |
| using Ikarus::GeneralizedSymEigenSolver< EigenValueSolverType::Spectra, MT >::MatrixType = MT |
| using Ikarus::GeneralizedSymEigenSolver< EigenValueSolverType::Spectra, MT >::ProductType = std::conditional_t<isDense, Spectra::DenseSymMatProd<ScalarType>, Spectra::SparseSymMatProd<ScalarType> > |
| using Ikarus::GeneralizedSymEigenSolver< EigenValueSolverType::Spectra, MT >::ScalarType = typename MT::Scalar |
| using Ikarus::GeneralizedSymEigenSolver< EigenValueSolverType::Spectra, MT >::SolverType = Spectra::SymGEigsSolver<ProductType, CholeskyType, Spectra::GEigsMode::Cholesky> |
|
inline |
| MATA | the deduced type of the matrix A |
| MATB | the deduced type of the matrix B |
| A | the matrix A |
| B | the matrix B |
|
inline |
| AssemblerA | the type of the assembler for matrix A. |
| AssemblerB | the type of the assembler for matrix B. |
| assemblerA | assembler for matrix A. |
| assemblerB | assembler for matrix B. |
|
inline |
| tolerance | given tolerance for iterative eigenvalue solving (default: 1e-10) |
| maxit | given maximum iterations for eigenvalue solving (default: 1000) |
|
inline |
|
inline |
|
inline |
|
staticconstexpr |