Public Types | Public Member Functions | Protected Attributes | List of all members
Seldon::GeneralEigenProblem< T > Class Template Reference

class for solving a general eigenproblem with parameter T (double or complex) More...

#include <VirtualEigenvalueSolver.hxx>

Inheritance diagram for Seldon::GeneralEigenProblem< T >:
Seldon::GeneralEigenProblem_Base Seldon::PolynomialEigenProblem_Base< T > Seldon::PolynomialEigenProblem< T > Seldon::PolynomialDenseEigenProblem< T, Prop, Storage > Seldon::PolynomialSparseEigenProblem< T, MatStiff, MatMass >

Public Types

typedef ClassComplexType< T >::Tcplx Tcplx
 
typedef ClassComplexType< T >::Treal Treal
 
enum  { SMALL_EIGENVALUES, LARGE_EIGENVALUES, CENTERED_EIGENVALUES }
 parts of the spectrum (near from 0, at infinity or around a given value) More...
 
enum  { SORTED_REAL, SORTED_IMAG, SORTED_MODULUS, SORTED_USER }
 different sorting strategies
 

Public Member Functions

 GeneralEigenProblem ()
 default constructor
 
GetShiftValue () const
 returns the shift value used More...
 
GetImagShiftValue () const
 returns the imaginary part of shift value used More...
 
void SetShiftValue (const T &)
 Sets the real part of shift value.
 
void SetImagShiftValue (const T &)
 Sets the imaginary part of shift value.
 
void GetComplexShift (const Treal &, const Treal &, Tcplx &) const
 forms the complex shift from real and imaginary part
 
void GetComplexShift (const Tcplx &, const Tcplx &, Tcplx &) const
 forms the complex shift from real and imaginary part
 
void SetTypeSpectrum (int type, const T &val, int type_sort=SORTED_MODULUS)
 sets which eigenvalues are searched More...
 
void SetTypeSpectrum (int type, const complex< T > &val, int type_sort=SORTED_MODULUS)
 sets which eigenvalues are searched More...
 
void SetUserComparisonClass (EigenvalueComparisonClass< T > *ev)
 sets the class where two eigenvalues can be compared
 
void FillComplexEigenvectors (int m, const Tcplx &Emid, Treal eps, const Vector< Tcplx > &lambda_cplx, const Matrix< Tcplx, General, ColMajor > &Ecplx, Vector< T > &Lr, Vector< T > &Li, Matrix< T, General, ColMajor > &E)
 
virtual void DistributeEigenvectors (Matrix< T, General, ColMajor > &eigen_vec)
 changes final eigenvectors if needed
 
void FillComplexEigenvectors (int m, const complex< double > &Emid, double eps, const Vector< complex< double > > &lambda_cplx, const Matrix< complex< double >, General, ColMajor > &Ecplx, Vector< double > &Lr, Vector< double > &Li, Matrix< double, General, ColMajor > &E)
 Fills arrays Lr, Li (eigenvalues) and E (eigenvectors) from complex eigenvectors. More...
 
void FillComplexEigenvectors (int m, const complex< double > &Emid, double eps, const Vector< complex< double > > &lambda_cplx, const Matrix< complex< double >, General, ColMajor > &Ecplx, Vector< complex< double > > &Lr, Vector< complex< double > > &Li, Matrix< complex< double >, General, ColMajor > &E)
 Fills arrays Lr, Li (eigenvalues) and E (eigenvectors) from complex eigenvectors.
 
int GetRankCommunicator () const
 returns rank for the solver communicator
 
int GetGlobalRankCommunicator () const
 returns rank for the global communicator
 
int GetNbAskedEigenvalues () const
 returns the number of eigenvalues asked by the user
 
void SetNbAskedEigenvalues (int n)
 sets the number of eigenvalues to compute
 
int GetTypeSpectrum () const
 returns the spectrum desired (large, small eigenvalues, etc)
 
int GetTypeSorting () const
 returns how eigenvalues are sorted (real, imaginary part or modulus)
 
void SetStoppingCriterion (double eps)
 modifies the stopping critertion
 
double GetStoppingCriterion () const
 returns the stopping criterion
 
void SetNbMaximumIterations (int n)
 sets the maximal number of iterations allowed for the iterative algorithm
 
int GetNbMaximumIterations () const
 returns the maximal number of iterations allowed for the iterative algorithm
 
int GetNbMatrixVectorProducts () const
 returns the number of matrix-vector products performed since last call to Init
 
int GetNbArnoldiVectors () const
 returns the number of Arnoldi vectors to use
 
void SetNbArnoldiVectors (int n)
 sets the number of Arnoldi vectors to use
 
int GetM () const
 returns number of rows
 
int GetGlobalM () const
 returns global number of rows
 
int GetN () const
 returns number of columns
 
int GetPrintLevel () const
 returns level of verbosity
 
void SetPrintLevel (int lvl)
 sets the level of verbosity
 
void IncrementProdMatVect ()
 increment of the number of matrix vector products
 
int GetNbLinearSolves () const
 returns the number of linear solves
 
void IncrementLinearSolves ()
 increments the number of linear solves
 
void Init (int n)
 initialisation of the size of the eigenvalue problem
 
virtual bool IsSymmetricProblem () const
 
virtual bool IsHermitianProblem () const
 

Protected Attributes

shift
 shift sigma (if type_spectrum = centered_eigenvalues)
 
shift_imag
 
EigenvalueComparisonClass< T > * compar_eigenval
 class for comparing eigenvalues
 
int nb_eigenvalues_wanted
 number of eigenvalues to be computed
 
int nb_arnoldi_vectors
 number of Arnoldi vectors
 
bool automatic_selection_arnoldi_vectors
 if true nb_arnoldi_vectors is automatically computed
 
int type_spectrum_wanted
 which spectrum ? Near from Zero ? Near from Infinity ? or near from a value ?
 
int type_sort_eigenvalues
 large eigenvalues because of their real part, imaginary part or magnitude ?
 
double stopping_criterion
 threshold for Arpack's iterative process
 
int nb_maximum_iterations
 Maximal number of iterations.
 
int nb_linear_solves
 number of linear solves
 
int display_every
 
int print_level
 
int nb_prod
 number of matrix-vector products
 
int n_
 size of the problem
 
int nglob
 

Detailed Description

template<class T>
class Seldon::GeneralEigenProblem< T >

class for solving a general eigenproblem with parameter T (double or complex)

Definition at line 349 of file VirtualEigenvalueSolver.hxx.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

parts of the spectrum (near from 0, at infinity or around a given value)

SMALL_EIGENVALUES : seeking eigenvalues near 0 LARGE_EIGENVALUES : seeking largest eigenvalues CENTERED_EIGENVALUES : seeking eigenvalues near the shift sigma

Definition at line 245 of file VirtualEigenvalueSolver.hxx.

Member Function Documentation

◆ FillComplexEigenvectors()

void Seldon::GeneralEigenProblem< double >::FillComplexEigenvectors ( int  m,
const complex< double > &  Emid,
double  eps,
const Vector< complex< double > > &  lambda_cplx,
const Matrix< complex< double >, General, ColMajor > &  Ecplx,
Vector< double > &  Lr,
Vector< double > &  Li,
Matrix< double, General, ColMajor > &  E 
)

Fills arrays Lr, Li (eigenvalues) and E (eigenvectors) from complex eigenvectors.

Lapack convention is used, a complex eigenvector is stored with two columns (real and imaginary part)

Definition at line 633 of file VirtualEigenvalueSolver.cxx.

◆ GetImagShiftValue()

template<class T >
T Seldon::GeneralEigenProblem< T >::GetImagShiftValue

returns the imaginary part of shift value used

If type_spectrum_wanted is set to CENTERED_EIGENVALUES, we search closest eigenvalues to the shift value. Matrix (A - (shift + i shift_imag)*I)^{-1} will be used instead of A shift_imag is accessed only for real unsymmetric problems

Definition at line 497 of file VirtualEigenvalueSolver.cxx.

◆ GetShiftValue()

template<class T >
T Seldon::GeneralEigenProblem< T >::GetShiftValue

returns the shift value used

If type_spectrum_wanted is set to CENTERED_EIGENVALUES, we search closest eigenvalues to the shift value. Matrix (A - (shift + i shift_imag)*I)^{-1} will be used instead of A

Definition at line 483 of file VirtualEigenvalueSolver.cxx.

◆ SetTypeSpectrum() [1/2]

template<class T >
void Seldon::GeneralEigenProblem< T >::SetTypeSpectrum ( int  type,
const complex< T > &  val,
int  type_sort = SORTED_MODULUS 
)

sets which eigenvalues are searched

You can ask small eigenvalues, large, or eigenvalues close to the shift.

Definition at line 559 of file VirtualEigenvalueSolver.cxx.

◆ SetTypeSpectrum() [2/2]

template<class T >
void Seldon::GeneralEigenProblem< T >::SetTypeSpectrum ( int  type,
const T &  val,
int  type_sort = SORTED_MODULUS 
)

sets which eigenvalues are searched

You can ask small eigenvalues, large, or eigenvalues close to the shift.

Definition at line 544 of file VirtualEigenvalueSolver.cxx.


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