Spectra
Spectra::SymGEigsSolver< Scalar, SelectionRule, OpType, BOpType, GEIGS_REGULAR_INVERSE > Class Template Reference

#include <Spectra/SymGEigsSolver.h>

Inheritance diagram for Spectra::SymGEigsSolver< Scalar, SelectionRule, OpType, BOpType, GEIGS_REGULAR_INVERSE >:
Spectra::SymEigsBase< Scalar, SelectionRule, SymGEigsRegInvOp< Scalar, OpType, BOpType >, BOpType >

Public Member Functions

 SymGEigsSolver (OpType *op, BOpType *Bop, int nev, int ncv)
 
- Public Member Functions inherited from Spectra::SymEigsBase< Scalar, SelectionRule, SymGEigsRegInvOp< Scalar, OpType, BOpType >, BOpType >
void init (const Scalar *init_resid)
 
void init ()
 
int compute (int maxit=1000, Scalar tol=1e-10, int sort_rule=LARGEST_ALGE)
 
int info () const
 
int num_iterations () const
 
int num_operations () const
 
Vector eigenvalues () const
 
virtual Matrix eigenvectors (int nvec) const
 
virtual Matrix eigenvectors () const
 

Detailed Description

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
class Spectra::SymGEigsSolver< Scalar, SelectionRule, OpType, BOpType, GEIGS_REGULAR_INVERSE >

This class implements the generalized eigen solver for real symmetric matrices in the regular inverse mode, i.e., to solve \(Ax=\lambda Bx\) where \(A\) is symmetric, and \(B\) is positive definite with the operations defined below.

This solver requires two matrix operation objects: one for \(A\) that implements the matrix multiplication \(Av\), and one for \(B\) that implements the matrix-vector product \(Bv\) and the linear equation solving operation \(B^{-1}v\).

If \(A\) and \(B\) are stored as Eigen matrices, then the first operation can be created using the DenseSymMatProd or SparseSymMatProd classes, and the second operation can be created using the SparseRegularInverse class. There is no wrapper class for a dense \(B\) matrix since in this case the Cholesky mode is always preferred. If the users need to define their own operation classes, then they should implement all the public member functions as in those built-in classes.

Template Parameters
ScalarThe element type of the matrix. Currently supported types are float, double and long double.
SelectionRuleAn enumeration value indicating the selection rule of the requested eigenvalues, for example LARGEST_MAGN to retrieve eigenvalues with the largest magnitude. The full list of enumeration values can be found in Enumerations.
OpTypeThe name of the matrix operation class for \(A\). Users could either use the wrapper classes such as DenseSymMatProd and SparseSymMatProd, or define their own that implements all the public member functions as in DenseSymMatProd.
BOpTypeThe name of the matrix operation class for \(B\). Users could either use the wrapper class SparseRegularInverse, or define their own that implements all the public member functions as in SparseRegularInverse.
GEigsModeMode of the generalized eigen solver. In this solver it is Spectra::GEIGS_REGULAR_INVERSE.

Definition at line 285 of file SymGEigsSolver.h.

Constructor & Destructor Documentation

◆ SymGEigsSolver()

template<typename Scalar , int SelectionRule, typename OpType , typename BOpType >
Spectra::SymGEigsSolver< Scalar, SelectionRule, OpType, BOpType, GEIGS_REGULAR_INVERSE >::SymGEigsSolver ( OpType *  op,
BOpType *  Bop,
int  nev,
int  ncv 
)
inline

Constructor to create a solver object.

Parameters
opPointer to the \(A\) matrix operation object. It should implement the matrix-vector multiplication operation of \(A\): calculating \(Av\) for any vector \(v\). Users could either create the object from the wrapper classes such as DenseSymMatProd, or define their own that implements all the public member functions as in DenseSymMatProd.
BopPointer to the \(B\) matrix operation object. It should implement the multiplication operation \(Bv\) and the linear equation solving operation \(B^{-1}v\) for any vector \(v\). Users could either create the object from the wrapper class SparseRegularInverse, or define their own that implements all the public member functions as in SparseRegularInverse.
nevNumber of eigenvalues requested. This should satisfy \(1\le nev \le n-1\), where \(n\) is the size of matrix.
ncvParameter that controls the convergence speed of the algorithm. Typically a larger ncv means faster convergence, but it may also result in greater memory use and more matrix operations in each iteration. This parameter must satisfy \(nev < ncv \le n\), and is advised to take \(ncv \ge 2\cdot nev\).

Definition at line 312 of file SymGEigsSolver.h.


The documentation for this class was generated from the following file: