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

#include <Spectra/GenEigsBase.h>

Public Member Functions

void init (const Scalar *init_resid)
 
void init ()
 
int compute (int maxit=1000, Scalar tol=1e-10, int sort_rule=LARGEST_MAGN)
 
int info () const
 
int num_iterations () const
 
int num_operations () const
 
ComplexVector eigenvalues () const
 
ComplexMatrix eigenvectors (int nvec) const
 
ComplexMatrix eigenvectors () const
 

Detailed Description

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

This is the base class for general eigen solvers, mainly for internal use. It is kept here to provide the documentation for member functions of concrete eigen solvers such as GenEigsSolver and GenEigsRealShiftSolver.

Definition at line 41 of file GenEigsBase.h.

Member Function Documentation

◆ init() [1/2]

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
void Spectra::GenEigsBase< Scalar, SelectionRule, OpType, BOpType >::init ( const Scalar *  init_resid)
inline

Initializes the solver by providing an initial residual vector.

Parameters
init_residPointer to the initial residual vector.

Spectra (and also ARPACK) uses an iterative algorithm to find eigenvalues. This function allows the user to provide the initial residual vector.

Definition at line 308 of file GenEigsBase.h.

◆ init() [2/2]

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
void Spectra::GenEigsBase< Scalar, SelectionRule, OpType, BOpType >::init ( )
inline

Initializes the solver by providing a random initial residual vector.

This overloaded function generates a random initial residual vector (with a fixed random seed) for the algorithm. Elements in the vector follow independent Uniform(-0.5, 0.5) distribution.

Definition at line 336 of file GenEigsBase.h.

◆ compute()

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
int Spectra::GenEigsBase< Scalar, SelectionRule, OpType, BOpType >::compute ( int  maxit = 1000,
Scalar  tol = 1e-10,
int  sort_rule = LARGEST_MAGN 
)
inline

Conducts the major computation procedure.

Parameters
maxitMaximum number of iterations allowed in the algorithm.
tolPrecision parameter for the calculated eigenvalues.
sort_ruleRule to sort the eigenvalues and eigenvectors. Supported values are Spectra::LARGEST_MAGN, Spectra::LARGEST_REAL, Spectra::LARGEST_IMAG, Spectra::SMALLEST_MAGN, Spectra::SMALLEST_REAL and Spectra::SMALLEST_IMAG, for example LARGEST_MAGN indicates that eigenvalues with largest magnitude come first. Note that this argument is only used to sort the final result, and the selection rule (e.g. selecting the largest or smallest eigenvalues in the full spectrum) is specified by the template parameter SelectionRule of GenEigsSolver.
Returns
Number of converged eigenvalues.

Definition at line 363 of file GenEigsBase.h.

◆ info()

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
int Spectra::GenEigsBase< Scalar, SelectionRule, OpType, BOpType >::info ( ) const
inline

Returns the status of the computation. The full list of enumeration values can be found in Enumerations.

Definition at line 392 of file GenEigsBase.h.

◆ num_iterations()

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
int Spectra::GenEigsBase< Scalar, SelectionRule, OpType, BOpType >::num_iterations ( ) const
inline

Returns the number of iterations used in the computation.

Definition at line 397 of file GenEigsBase.h.

◆ num_operations()

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
int Spectra::GenEigsBase< Scalar, SelectionRule, OpType, BOpType >::num_operations ( ) const
inline

Returns the number of matrix operations used in the computation.

Definition at line 402 of file GenEigsBase.h.

◆ eigenvalues()

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
ComplexVector Spectra::GenEigsBase< Scalar, SelectionRule, OpType, BOpType >::eigenvalues ( ) const
inline

Returns the converged eigenvalues.

Returns
A complex-valued vector containing the eigenvalues. Returned vector type will be Eigen::Vector<std::complex<Scalar>, ...>, depending on the template parameter Scalar defined.

Definition at line 411 of file GenEigsBase.h.

◆ eigenvectors() [1/2]

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
ComplexMatrix Spectra::GenEigsBase< Scalar, SelectionRule, OpType, BOpType >::eigenvectors ( int  nvec) const
inline

Returns the eigenvectors associated with the converged eigenvalues.

Parameters
nvecThe number of eigenvectors to return.
Returns
A complex-valued matrix containing the eigenvectors. Returned matrix type will be Eigen::Matrix<std::complex<Scalar>, ...>, depending on the template parameter Scalar defined.

Definition at line 441 of file GenEigsBase.h.

◆ eigenvectors() [2/2]

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
ComplexMatrix Spectra::GenEigsBase< Scalar, SelectionRule, OpType, BOpType >::eigenvectors ( ) const
inline

Returns all converged eigenvectors.

Definition at line 469 of file GenEigsBase.h.


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