Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Seldon::SparseEigenProblem< T, MatStiff, MatMass > Class Template Referenceabstract

computation of a few eigenvalues for sparse matrices More...

#include <EigenvalueSolver.hxx>

Inheritance diagram for Seldon::SparseEigenProblem< T, MatStiff, MatMass >:
Seldon::EigenProblem_Base< T, MatStiff, Matrix< double, Symmetric, ArrayRowSymSparse > >

Public Types

typedef MatMass::value_type MassValue
 
enum  
 several available modes to find eigenvalues (Arpack) More...
 
enum  
 parts of the spectrum (near from 0, at infinity or around a given value) More...
 
enum  
 different sorting strategies
 
enum  
 different solvers (Anasazi) More...
 
enum  
 orthogonalization managers (Anasazi)
 
enum  
 several available modes to find eigenvalues (Arpack) More...
 
enum  
 real part, imaginary part or complex solution
 

Public Member Functions

 SparseEigenProblem ()
 default constructor
 
void SelectCholeskySolver (int type)
 sets Cholesky solver to use
 
void FactorizeCholeskyMass ()
 computes Cholesky factorisation of M from matrix M
 
template<class Storage , class Alloc >
void FactorizeCholeskyMass (double &, Matrix< double, Symmetric, Storage, Alloc > &M)
 intermediary function
 
template<class T0 , class T1 , class Prop , class Storage , class Alloc >
void FactorizeCholeskyMass (T0 &, Matrix< T1, Prop, Storage, Alloc > &M)
 intermediary function
 
template<class TransStatus , class T0 >
void MltCholeskyMass (const TransStatus &transA, Vector< T0 > &X)
 computes L X or L^T x if M = L L^T
 
template<class TransStatus , class T0 >
void SolveCholeskyMass (const TransStatus &transA, Vector< T0 > &X)
 computes L^-1 X or L^-T x if M = L L^T
 
template<class TransStatus >
void MltCholeskyMass (const TransStatus &transA, Vector< complex< double > > &X)
 computes L X or L^T x if M = L L^T
 
template<class TransStatus >
void MltCholeskyMass (const TransStatus &transA, Vector< complex< double > > &X, double &)
 computes L X or L^T x if M = L L^T
 
template<class TransStatus >
void MltCholeskyMass (const TransStatus &transA, Vector< complex< double > > &X, complex< double > &)
 computes L X or L^T x if M = L L^T
 
template<class TransStatus >
void SolveCholeskyMass (const TransStatus &transA, Vector< complex< double > > &X)
 computes L^-1 X or L^-T x if M = L L^T
 
template<class TransStatus >
void SolveCholeskyMass (const TransStatus &transA, Vector< complex< double > > &X, double &)
 computes L^-1 X or L^-T x if M = L L^T
 
template<class TransStatus >
void SolveCholeskyMass (const TransStatus &transA, Vector< complex< double > > &X, complex< double > &)
 computes L^-1 X or L^-T x if M = L L^T
 
void ComputeAndFactorizeStiffnessMatrix (const T &a, const T &b)
 computes and factorizes a M + b K where M is the mass matrix and K the stiffness matrix
 
void ComputeAndFactorizeStiffnessMatrix (const complex< T > &a, const complex< T > &b, bool real_p=true)
 computes and factorizes matrix (a M + b K) for complex values of a and b
 
template<class T0 >
void ComputeAndFactorizeComplexMatrix (const complex< T0 > &a, const complex< T0 > &b, bool real_p=true)
 intermediary function
 
void ComputeAndFactorizeComplexMatrix (const complex< double > &a, const complex< double > &b, bool real_p=true)
 computes and factorizes matrix (a M + b K) for complex values of a and b
 
template<class T0 >
void ComputeSolution (const Vector< T0 > &X, Vector< T0 > &Y)
 solves (a M + b K) Y = X with stored factorization
 
template<class TransA , class T0 >
void ComputeSolution (const TransA &transA, const Vector< T0 > &X, Vector< T0 > &Y)
 solves (a M + b K) Y = X or transpose system
 
template<class TransA >
void ComputeComplexSolution (const TransA &, const Vector< double > &X, Vector< double > &Y)
 solves (a M + b K) Y = X when a and b are complex
 
template<class TransA >
void ComputeComplexSolution (const TransA &, const Vector< complex< double > > &X, Vector< complex< double > > &Y)
 intermediary function
 
void Clear ()
 clears memory used by the object
 
void SelectCholeskySolver (int type)
 
void InitMatrix (MatStiff &)
 
void InitMatrix (MatStiff &, MatMass &)
 
void ComputeDiagonalMass ()
 computation of diagonal of mass matrix
 
void FactorizeCholeskyMass ()
 
template<class Storage >
void FactorizeCholeskyMass (Matrix< Treal, Symmetric, Storage > &M)
 intermediary function
 
template<class T0 , class Prop , class Storage >
void FactorizeCholeskyMass (Matrix< T0, Prop, Storage > &M)
 intermediary function
 
void MltCholeskyMass (const SeldonTranspose &transA, Vector< Treal > &X)
 computes L X or L^T x if M = L L^T
 
void MltCholeskyMass (const SeldonTranspose &transA, Vector< Tcplx > &X)
 computes L X or L^T x if M = L L^T
 
void SolveCholeskyMass (const SeldonTranspose &transA, Vector< Treal > &X)
 computes L^-1 X or L^-T x if M = L L^T
 
void SolveCholeskyMass (const SeldonTranspose &transA, Vector< Tcplx > &X)
 computes L^-1 X or L^-T x if M = L L^T
 
void MltMass (const Vector< Treal > &X, Vector< Treal > &Y)
 multiplication by mass matrix
 
void MltMass (const Vector< Tcplx > &X, Vector< Tcplx > &Y)
 multiplication by mass matrix
 
void MltMass (const SeldonTranspose &, const Vector< Treal > &X, Vector< Treal > &Y)
 multiplication by mass matrix
 
void MltMass (const SeldonTranspose &, const Vector< Tcplx > &X, Vector< Tcplx > &Y)
 multiplication by mass matrix
 
void MltStiffness (const Vector< Treal > &X, Vector< Treal > &Y)
 multiplication by stiffness matrix
 
void MltStiffness (const Vector< Tcplx > &X, Vector< Tcplx > &Y)
 multiplication by stiffness matrix
 
void MltStiffness (const T &coef_mass, const T &coef_stiff, const Vector< Treal > &X, Vector< Treal > &Y)
 multiplication by stiffness and mass matrix
 
void MltStiffness (const T &coef_mass, const T &coef_stiff, const Vector< Tcplx > &X, Vector< Tcplx > &Y)
 multiplication by stiffness and mass matrix
 
void MltStiffness (const SeldonTranspose &, const Vector< Treal > &X, Vector< Treal > &Y)
 multiplication by stiffness matrix
 
void MltStiffness (const SeldonTranspose &, const Vector< Tcplx > &X, Vector< Tcplx > &Y)
 multiplication by stiffness matrix
 
void ComputeAndFactoRealMatrix (const Treal &, const Treal &a, const Treal &b, int which)
 computes and factorizes a M + b K where M is the mass matrix and K the stiffness matrix
 
void ComputeAndFactoRealMatrix (const Tcplx &, const Treal &a, const Treal &b, int which)
 computes and factorizes a M + b K where M is the mass matrix and K the stiffness matrix
 
void ComputeAndFactorizeStiffnessMatrix (const Treal &a, const Treal &b, int which=EigenProblem_Base< T >::COMPLEX_PART)
 computes and factorizes a M + b K M is the mass matrix and K the stiffness matrix
 
void ComputeAndFactorizeStiffnessMatrix (const Tcplx &a, const Tcplx &b, int which=EigenProblem_Base< T >::COMPLEX_PART)
 computes and factorizes matrix (a M + b K) for complex values of a and b
 
void ComputeSolution (const Vector< Treal > &X, Vector< Treal > &Y)
 solves (a M + b K) Y = X with stored factorization
 
void ComputeSolution (const Vector< Tcplx > &X, Vector< Tcplx > &Y)
 solves (a M + b K) Y = X with stored factorization
 
void ComputeSolution (const SeldonTranspose &transA, const Vector< Treal > &X, Vector< Treal > &Y)
 solves (a M + b K) Y = X with stored factorization
 
void ComputeSolution (const SeldonTranspose &transA, const Vector< Tcplx > &X, Vector< Tcplx > &Y)
 solves (a M + b K) Y = X or transpose system
 
void DistributeEigenvectors (Matrix< T, General, ColMajor > &eigen_vec)
 changes final eigenvectors if needed
 
void Clear ()
 
void Init (int n)
 initialisation of the size of the eigenvalue problem
 
void InitMatrix (MatStiff &, Matrix< double, Symmetric, ArrayRowSymSparse > &)
 initialization of a generalized eigenvalue problem More...
 
int GetComputationalMode () const
 returns the spectral transformation used for evaluation of eigenvalues
 
int GetComputationalMode () const
 
void SetComputationalMode (int mode)
 sets the spectral transformation used for evaluation of eigenvalues
 
void SetComputationalMode (int mode)
 
int GetNbAskedEigenvalues () const
 returns the number of eigenvalues asked by the user
 
void SetNbAskedEigenvalues (int n)
 sets the number of eigenvalues to compute
 
int GetNbAdditionalEigenvalues () const
 returns the additional number of eigenvalues
 
int GetNbAdditionalEigenvalues () const
 
void SetNbAdditionalEigenvalues (int n)
 sets the number of additional eigenvalues
 
void SetNbAdditionalEigenvalues (int n)
 
int GetNbBlocks () const
 returns the number of blocks used in blocked solvers
 
void SetNbBlocks (int)
 returns the number of blocks used in blocked solvers
 
int GetNbMaximumRestarts () const
 returns the restart parameter used in blocked solvers
 
void SetNbMaximumRestarts (int)
 sets the restart parameter used in blocked solvers
 
int GetOrthoManager () const
 returns orthogonalization manager set in Anasazi
 
int GetEigensolverType () const
 returns the solver used in Anasazi
 
void SetEigensolverType (int type)
 sets the solver used in Anasazi
 
int GetTypeSpectrum () const
 returns the spectrum desired (large, small eigenvalues, etc)
 
int GetTypeSorting () const
 returns how eigenvalues are sorted (real, imaginary part or modulus)
 
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 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...
 
double GetLowerBoundInterval () const
 returns lower bound of the interval where eigenvalues are searched
 
double GetUpperBoundInterval () const
 returns upper bound of the interval where eigenvalues are searched
 
void SetIntervalSpectrum (double, double)
 sets the interval where eigenvalues are searched
 
void SetCholeskyFactoForMass (bool chol=true)
 indicates the use of Cholesky factorisation in order to solve a standard eigenvalue problem instead of a generalized one
 
void SetCholeskyFactoForMass (bool chol=true)
 
bool UseCholeskyFactoForMass () const
 returns true if Cholesky factorisation has to be used for mass matrix
 
bool UseCholeskyFactoForMass () const
 
void SetDiagonalMass (bool diag=true)
 indicates that the mass matrix is diagonal
 
void SetDiagonalMass (bool diag=true)
 
bool DiagonalMass () const
 returns true if the mass matrix is diagonal
 
bool DiagonalMass () const
 
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 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
 
void PrintErrorInit () const
 prints error of initialization and aborts program
 
void PrintErrorInit () const
 
bool IsSymmetricProblem () const
 returns true if the matrix is symmetric
 
bool IsHermitianProblem () const
 returns true if the matrix is hermitian
 
void FactorizeDiagonalMass ()
 computation of D^1/2 from D
 
virtual void FactorizeDiagonalMass ()=0
 
void MltInvSqrtDiagonalMass (Vector< T0 > &X)
 multiplication of X by D^-1/2
 
virtual void MltInvSqrtDiagonalMass (Vector< Treal > &X)=0
 
virtual void MltInvSqrtDiagonalMass (Vector< Tcplx > &X)=0
 
void MltSqrtDiagonalMass (Vector< T0 > &X)
 multiplication of X by D^1/2
 
virtual void MltSqrtDiagonalMass (Vector< Treal > &X)=0
 
virtual void MltSqrtDiagonalMass (Vector< Tcplx > &X)=0
 
void ComputeMassForCholesky ()
 computation of mass matrix
 
virtual void ComputeMassForCholesky ()
 
void ComputeMassMatrix ()
 computation of mass matrix M
 
virtual void ComputeMassMatrix ()
 
void ComputeStiffnessMatrix ()
 computation of stiffness matrix K
 
void ComputeStiffnessMatrix (const T &a, const T &b)
 computation of matrix a M + b*K
 
virtual void ComputeStiffnessMatrix ()
 
virtual void ComputeStiffnessMatrix (const T &a, const T &b)
 
void MltCholeskyMass (const TransStatus &transA, Vector< T > &X)
 computation of L X or L^T x if M = L L^T
 
void SolveCholeskyMass (const TransStatus &transA, Vector< T > &X)
 computation of L^-1 X or L^-T x if M = L L^T
 
AnasaziParamGetAnasaziParameters ()
 returns parameters specific to Anasazi
 
SlepcParamGetSlepcParameters ()
 returns parameters specific to Slepc
 
FeastParamGetFeastParameters ()
 returns parameters specific to Feast
 
virtual void GetSqrtDiagonal (Vector< T > &)=0
 

Protected Types

typedef ClassComplexType< T >::Tcplx Complexe
 
typedef ClassComplexType< T >::Tcplx Tcplx
 
typedef ClassComplexType< T >::Treal Treal
 

Protected Member Functions

int RetrieveLocalNumbers (MatStiff &K)
 

Protected Attributes

SparseDirectSolver< T > mat_lu
 LU factorisation of sparse matrix.
 
SparseDirectSolver< Complexe > mat_lu_cplx
 factorisation of complex system
 
SparseCholeskySolver< double > chol_facto_mass_matrix
 Cholesky factorisation of mass matrix if required.
 
Vector< double > Xchol_real
 temporary vectors for Cholesky
 
Vector< double > Xchol_imag
 
bool imag_solution
 if true, we take imaginary part of (K - sigma M)^-1
 
SparseDirectSolver< Treal > mat_lu_real
 LU factorisation of sparse matrix.
 
SparseDirectSolver< Tcplx > mat_lu_cplx
 factorisation of complex system
 
SparseCholeskySolver< Treal > chol_facto_mass_matrix
 Cholesky factorisation of mass matrix if required.
 
Vector< Treal > Xchol_real
 temporary vectors for Cholesky
 
Vector< Treal > Xchol_imag
 
MatMass * Mh
 
MatStiff * Kh
 
bool distributed
 
int nloc
 
Vector< int > local_col_numbers
 
Vector< int > * ProcSharingRows
 
Vector< Vector< int > > * SharingRowNumbers
 
int nodl_scalar_
 
int nb_unknowns_scal_
 
int eigenvalue_computation_mode
 mode used to find eigenvalues (regular, shifted, Cayley, etc)
 
int nb_eigenvalues_wanted
 number of eigenvalues to be computed
 
int nb_add_eigenvalues
 additional number of eigenvalues More...
 
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 ?
 
bool use_cholesky
 if true, the generalized problem is reduced to a standard problem More...
 
bool diagonal_mass
 if true, the generalized problem is reduced to a standard problem More...
 
double stopping_criterion
 threshold for Arpack's iterative process
 
int nb_maximum_iterations
 Maximal number of iterations.
 
int nb_prod
 number of matrix-vector products
 
int n_
 size of the problem
 
shift
 shift sigma (if type_spectrum = centered_eigenvalues)
 
shift_imag
 
int nb_arnoldi_vectors
 number of Arnoldi vectors
 
bool automatic_selection_arnoldi_vectors
 if true nb_arnoldi_vectors is automatically computed
 
int print_level
 print level
 
Vector< MassValue > sqrt_diagonal_mass
 diagonal D^1/2 if the mass matrix is diagonal positive
 
bool complex_system
 if true consider Real( (a M + bK)^-1) or Imag( (a M + b K)^-1 ) or the whole system, a and/or b being complex
 
int type_solver
 which solver ?
 
int ortho_manager
 orthogonalization manager
 
int nb_blocks
 number of blocks for blocked solvers
 
int restart_number
 restart parameter for blocked solvers
 
double emin_interval
 interval where eigenvalues are searched
 
double emax_interval
 
int selected_part
 
AnasaziParam anasazi_param
 additional parameters for Anasazi
 
SlepcParam slepc_param
 additional parameters for Slepc
 
FeastParam feast_param
 additional parameters for Feast
 

Detailed Description

template<class T, class MatStiff, class MatMass = Matrix<double, Symmetric, ArrayRowSymSparse>>
class Seldon::SparseEigenProblem< T, MatStiff, MatMass >

computation of a few eigenvalues for sparse matrices

Definition at line 396 of file EigenvalueSolver.hxx.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

several available modes to find eigenvalues (Arpack)

REGULAR_MODE : Regular mode standard problem => no linear system to solve generalized problem => M^-1 K x = lambda x (inverse of M required) SHIFTED_MODE : Shifted mode standard problem => (K - sigma I)^-1 X = lambda X generalized problem => (K - sigma M)^-1 M X = lambda X BUCKLING_MODE : Buckling mode (real symmetric problem) generalized problem => (K - sigma M)^-1 K X = lambda X CAYLEY_MODE : Cayley mode (real symmetric problem) generalized problem => (K - sigma M)^-1 (K + sigma M) X = lambda X INVERT_MODE : Shifted mode on matrix M^-1 K
IMAG_SHIFTED_MODE : using Imag( (K - sigma M)^-1 M) instead of Real( (K - sigma M)^-1 M) mode 4 in Arpack (dnaupd.f)

Definition at line 441 of file VirtualEigenvalueSolver.hxx.

◆ anonymous enum

anonymous enum
inherited

several available modes to find eigenvalues (Arpack)

REGULAR_MODE : Regular mode standard problem => no linear system to solve generalized problem => M^-1 K x = lambda x (inverse of M required) SHIFTED_MODE : Shifted mode standard problem => (K - sigma I)^-1 X = lambda X generalized problem => (K - sigma M)^-1 M X = lambda X BUCKLING_MODE : Buckling mode (real symmetric problem) generalized problem => (K - sigma M)^-1 K X = lambda X CAYLEY_MODE : Cayley mode (real symmetric problem) generalized problem => (K - sigma M)^-1 (K + sigma M) X = lambda X INVERT_MODE : Shifted mode on matrix M^-1 K
IMAG_SHIFTED_MODE : using Imag( (K - sigma M)^-1 M) instead of Real( (K - sigma M)^-1 M) mode 4 in Arpack (dnaupd.f)

Definition at line 38 of file EigenvalueSolver.hxx.

◆ 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 47 of file EigenvalueSolver.hxx.

◆ anonymous enum

anonymous enum
inherited

different solvers (Anasazi)

SOLVER_LOBPCG : Locally Optimal Block Preconditioned Conjugate Gradient SOLVER_BKS : Block Krylov Schur SOLVER_BD : Block Davidson

Definition at line 58 of file EigenvalueSolver.hxx.

Member Function Documentation

◆ GetImagShiftValue()

T Seldon::EigenProblem_Base< T, MatStiff, Matrix< double, Symmetric, ArrayRowSymSparse > >::GetImagShiftValue
inherited

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 288 of file EigenvalueSolver.cxx.

◆ GetShiftValue()

T Seldon::EigenProblem_Base< T, MatStiff, Matrix< double, Symmetric, ArrayRowSymSparse > >::GetShiftValue
inherited

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 274 of file EigenvalueSolver.cxx.

◆ InitMatrix()

void Seldon::EigenProblem_Base< T, MatStiff, Matrix< double, Symmetric, ArrayRowSymSparse > >::InitMatrix ( MatStiff &  K,
MatMass &  M 
)
inherited

initialization of a generalized eigenvalue problem

Mass matrix M and stiffness matrix K are given in argument we will search (lambda, x) such as K x = lambda M x

Definition at line 117 of file EigenvalueSolver.cxx.

◆ SetTypeSpectrum() [1/2]

void Seldon::EigenProblem_Base< T, MatStiff, Matrix< double, Symmetric, ArrayRowSymSparse > >::SetTypeSpectrum ( int  type,
const complex< T > &  val,
int  type_sort = SORTED_MODULUS 
)
inherited

sets which eigenvalues are searched

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

Definition at line 332 of file EigenvalueSolver.cxx.

◆ SetTypeSpectrum() [2/2]

void Seldon::EigenProblem_Base< T, MatStiff, Matrix< double, Symmetric, ArrayRowSymSparse > >::SetTypeSpectrum ( int  type,
const T &  val,
int  type_sort = SORTED_MODULUS 
)
inherited

sets which eigenvalues are searched

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

Definition at line 317 of file EigenvalueSolver.cxx.

Member Data Documentation

◆ diagonal_mass

bool Seldon::EigenProblem_Base< T, MatStiff, Matrix< double, Symmetric, ArrayRowSymSparse > >::diagonal_mass
protectedinherited

if true, the generalized problem is reduced to a standard problem

if M is diagonal, one can seek eigenvalues of the standard problem M^-1/2 K M^-1/2 x = lambda x

Definition at line 98 of file EigenvalueSolver.hxx.

◆ nb_add_eigenvalues

int Seldon::EigenProblem_Base< T, MatStiff, Matrix< double, Symmetric, ArrayRowSymSparse > >::nb_add_eigenvalues
protectedinherited

additional number of eigenvalues

Sometimes Arpack finds more converged eigenvalues than asked it is needed to store these eigenvalues and eigenvalues to avoid segmentation fault

Definition at line 77 of file EigenvalueSolver.hxx.

◆ use_cholesky

bool Seldon::EigenProblem_Base< T, MatStiff, Matrix< double, Symmetric, ArrayRowSymSparse > >::use_cholesky
protectedinherited

if true, the generalized problem is reduced to a standard problem

If matrix M is symmetric definite positive, one may compute Cholesky factorisation of M = L L^T, and find eigenvalues of the standard problem : L^-1 K L^-T x = lambda x

Definition at line 91 of file EigenvalueSolver.hxx.


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