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

#include <Spectra/SymEigsBase.h>

Public Member Functions

void init (const Scalar *init_resid)
 
void init ()
 
Index compute (Index maxit=1000, Scalar tol=1e-10, int sort_rule=LARGEST_ALGE)
 
int info () const
 
Index num_iterations () const
 
Index num_operations () const
 
Vector eigenvalues () const
 
virtual Matrix eigenvectors (Index nvec) const
 
virtual Matrix eigenvectors () const
 

Detailed Description

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

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

Definition at line 45 of file SymEigsBase.h.

Member Function Documentation

◆ init() [1/2]

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
void Spectra::SymEigsBase< 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 279 of file SymEigsBase.h.

◆ init() [2/2]

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
void Spectra::SymEigsBase< 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 307 of file SymEigsBase.h.

◆ compute()

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
Index Spectra::SymEigsBase< Scalar, SelectionRule, OpType, BOpType >::compute ( Index  maxit = 1000,
Scalar  tol = 1e-10,
int  sort_rule = LARGEST_ALGE 
)
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_ALGE, Spectra::LARGEST_MAGN, Spectra::SMALLEST_ALGE and Spectra::SMALLEST_MAGN, for example LARGEST_ALGE indicates that largest eigenvalues 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 SymEigsSolver.
Returns
Number of converged eigenvalues.

Definition at line 332 of file SymEigsBase.h.

◆ info()

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
int Spectra::SymEigsBase< 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 361 of file SymEigsBase.h.

◆ num_iterations()

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

Returns the number of iterations used in the computation.

Definition at line 366 of file SymEigsBase.h.

◆ num_operations()

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

Returns the number of matrix operations used in the computation.

Definition at line 371 of file SymEigsBase.h.

◆ eigenvalues()

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

Returns the converged eigenvalues.

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

Definition at line 380 of file SymEigsBase.h.

◆ eigenvectors() [1/2]

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
virtual Matrix Spectra::SymEigsBase< Scalar, SelectionRule, OpType, BOpType >::eigenvectors ( Index  nvec) const
inlinevirtual

Returns the eigenvectors associated with the converged eigenvalues.

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

Definition at line 410 of file SymEigsBase.h.

◆ eigenvectors() [2/2]

template<typename Scalar, int SelectionRule, typename OpType, typename BOpType>
virtual Matrix Spectra::SymEigsBase< Scalar, SelectionRule, OpType, BOpType >::eigenvectors ( ) const
inlinevirtual

Returns all converged eigenvectors.

Definition at line 438 of file SymEigsBase.h.


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