EigenvalueSolver.hxx
1 #ifndef SELDON_FILE_EIGENVALUE_SOLVER_HXX
2 
3 namespace Seldon
4 {
5 
7 
16  template<class T, class MatStiff = Matrix<T>,
17  class MatMass = Matrix<double> >
19  {
20  public :
22 
38  enum {REGULAR_MODE, SHIFTED_MODE, IMAG_SHIFTED_MODE, INVERT_MODE,
39  BUCKLING_MODE, CAYLEY_MODE};
40 
42 
47  enum {SMALL_EIGENVALUES, LARGE_EIGENVALUES, CENTERED_EIGENVALUES};
48 
50  enum {SORTED_REAL, SORTED_IMAG, SORTED_MODULUS};
51 
53 
58  enum {SOLVER_LOBPCG, SOLVER_BKS, SOLVER_BD};
59 
61  enum {ORTHO_DGKS, ORTHO_SVQB};
62 
64  typedef typename MatMass::value_type MassValue;
65 
66  protected :
69 
72 
74 
78 
81 
84 
86 
92 
94 
99 
102 
105 
107  int nb_prod;
108 
110  int n_;
111 
113  T shift, shift_imag;
114 
117 
120 
122 
125 
129 
131  MatMass* Mh;
132 
134  MatStiff* Kh;
135 
136 #ifdef SELDON_WITH_MPI
137  MPI_Intracomm comm;
139 #endif
140 
143 
144  /**************************
145  * Parameters for Anasazi *
146  **************************/
147 
150 
153 
156 
157  /************************
158  * Parameters for Feast *
159  ************************/
160 
162  double emin_interval, emax_interval;
163 
164  public :
165 
167 
168  // initialization
169  void Init(int n);
170 
171  void InitMatrix(MatStiff&);
172  void InitMatrix(MatStiff&, MatMass& );
173 
174  // basic functions
175  int GetComputationalMode() const;
176  void SetComputationalMode(int mode);
177 
178 #ifdef SELDON_WITH_MPI
179  void SetCommunicator(MPI_Comm& comm_);
180  MPI_Intracomm& GetCommunicator();
181 #endif
182 
183  int GetNbAskedEigenvalues() const;
184  void SetNbAskedEigenvalues(int n);
185 
186  int GetNbAdditionalEigenvalues() const;
187  void SetNbAdditionalEigenvalues(int n);
188 
189  int GetNbBlocks() const;
190  void SetNbBlocks(int);
191  int GetNbMaximumRestarts() const;
192  void SetNbMaximumRestarts(int);
193  int GetOrthoManager() const;
194 
195  int GetEigensolverType() const;
196  void SetEigensolverType(int type);
197 
198  int GetTypeSpectrum() const;
199  int GetTypeSorting() const;
200  T GetShiftValue() const;
201  T GetImagShiftValue() const;
202  void SetShiftValue(const T&);
203  void SetImagShiftValue(const T&);
204 
205  void SetTypeSpectrum(int type, const T& val,
206  int type_sort = SORTED_MODULUS);
207 
208  void SetTypeSpectrum(int type, const complex<T>& val,
209  int type_sort = SORTED_MODULUS);
210 
211  double GetLowerBoundInterval() const;
212  double GetUpperBoundInterval() const;
213 
214  void SetIntervalSpectrum(double, double);
215 
216  void SetCholeskyFactoForMass(bool chol = true);
217  bool UseCholeskyFactoForMass() const;
218 
219  void SetDiagonalMass(bool diag = true);
220  bool DiagonalMass() const;
221 
222  void SetStoppingCriterion(double eps);
223  double GetStoppingCriterion() const;
224  void SetNbMaximumIterations(int n);
225  int GetNbMaximumIterations() const;
226 
227  int GetNbMatrixVectorProducts() const;
228 
229  int GetNbArnoldiVectors() const;
230  void SetNbArnoldiVectors(int n);
231 
232  int GetM() const;
233  int GetN() const;
234 
235  int GetPrintLevel() const;
236  void SetPrintLevel(int lvl);
237 
238  void IncrementProdMatVect();
239 
240  void PrintErrorInit() const;
241  bool IsSymmetricProblem() const;
242  bool IsHermitianProblem() const;
243 
244  // mass matrix stuff
245  void FactorizeDiagonalMass();
246  template<class T0> void MltInvSqrtDiagonalMass(Vector<T0>& X);
247  template<class T0> void MltSqrtDiagonalMass(Vector<T0>& X);
248 
249  void ComputeDiagonalMass();
250  void ComputeMassForCholesky();
251 
252  void ComputeMassMatrix();
253  void MltMass(const Vector<T>& X, Vector<T>& Y);
254 
255  // stiffness matrix stuff
256  void ComputeStiffnessMatrix();
257  void ComputeStiffnessMatrix(const T& a, const T& b);
258 
259  void MltStiffness(const Vector<T>& X, Vector<T>& Y);
260  void MltStiffness(const T& a, const T& b, const Vector<T>& X, Vector<T>& Y);
261 
262  // functions to overload (factorisation of mass and/or stiffness matrix)
263  void ComputeAndFactorizeStiffnessMatrix(const T& a, const T& b);
264  void ComputeAndFactorizeStiffnessMatrix(const complex<T>& a,
265  const complex<T>& b,
266  bool real_p = true);
267 
268  template<class T0>
269  void ComputeSolution(const Vector<T0>& X, Vector<T0>& Y);
270 
271  template<class TransA, class T0>
272  void ComputeSolution(const TransA& transA,
273  const Vector<T0>& X, Vector<T0>& Y);
274 
275  void FactorizeCholeskyMass();
276 
277  template<class TransStatus>
278  void MltCholeskyMass(const TransStatus& transA, Vector<T>& X);
279 
280  template<class TransStatus>
281  void SolveCholeskyMass(const TransStatus& transA, Vector<T>& X);
282 
283  void Clear();
284 
285  // modification of eigenvectors to take into account
286  // the use of matrix D^-1/2 K D^-1/2 or L^-1 K L^-T instead of K
287  // => eigenvectors are recovered by multiplying them by matrix D^1/2 or by L^T
288  template<class EigenPb, class Vector1, class Matrix1, class T0>
289  friend void ApplyScalingEigenvec(EigenPb& var,
290  Vector1& eigen_values,
291  Vector1& lambda_imag,
292  Matrix1& eigen_vectors,
293  const T0& shiftr, const T0& shifti);
294 
295  template<class EigenPb, class Vector1, class Matrix1, class T0>
296  friend void ApplyScalingEigenvec(EigenPb& var,
297  Vector1& eigen_values,
298  Vector1& lambda_imag,
299  Matrix1& eigen_vectors,
300  const complex<T0>& shiftr,
301  const complex<T0>& shifti);
302 
303  };
304 
305 
306  // sorting eigenvalues
307  template<class T, class Storage1, class Storage2,
308  class Alloc1, class Alloc2>
309  void SortEigenvalues(Vector<T>& lambda_r, Vector<T>& lambda_i,
312  int type_spectrum, int type_sort,
313  const T& shift_r, const T& shift_i);
314 
315  // sorting eigenvalues
316  template<class T, class Storage1, class Storage2,
317  class Alloc1, class Alloc2>
318  void SortEigenvalues(Vector<complex<T> >& lambda_r,
319  Vector<complex<T> >& lambda_i,
320  Matrix<complex<T>, General, Storage1, Alloc1>& eigen_old,
321  Matrix<complex<T>, General, Storage2, Alloc2>& eigen_new,
322  int type_spectrum, int type_sort,
323  const complex<T>& shift_r, const complex<T>& shift_i);
324 
325 
327  template<class T, class Prop, class Storage,
328  class Tmass = double, class PropM = Symmetric,
329  class StorageM = RowSymPacked>
331  : public EigenProblem_Base<T, Matrix<T, Prop, Storage>,
332  Matrix<Tmass, PropM, StorageM> >
333  {
334  protected :
337 
340 
343 
346 
347  public :
348 
350 
351  void FactorizeCholeskyMass();
352 
353  template<class TransStatus, class T0>
354  void MltCholeskyMass(const TransStatus& transA, Vector<T0>& X);
355 
356  template<class TransStatus, class T0>
357  void SolveCholeskyMass(const TransStatus& transA, Vector<T0>& X);
358 
359  template<class TransStatus>
360  void MltCholeskyMass(const TransStatus& transA,
361  Vector<complex<double> >& X);
362 
363  template<class TransStatus>
364  void SolveCholeskyMass(const TransStatus& transA,
365  Vector<complex<double> >& X);
366 
367  void ComputeAndFactorizeStiffnessMatrix(const T& a, const T& b);
368  void ComputeAndFactorizeStiffnessMatrix(const complex<T>& a,
369  const complex<T>& b,
370  bool real_p = true);
371 
372  template<class T0>
373  void ComputeAndFactorizeComplexMatrix(const complex<T0>& a,
374  const complex<T0>& b,
375  bool real_p = true);
376 
377  void ComputeAndFactorizeComplexMatrix(const complex<double>& a,
378  const complex<double>& b,
379  bool real_p = true);
380 
381  template<class T0>
382  void ComputeSolution(const Vector<T0>& X, Vector<T0>& Y);
383 
384  template<class TransA, class T0>
385  void ComputeSolution(const TransA& transA,
386  const Vector<T0>& X, Vector<T0>& Y);
387 
388  void Clear();
389 
390  };
391 
392 
394  template<class T, class MatStiff,
397  : public EigenProblem_Base<T, MatStiff, MatMass>
398  {
399  public :
400  typedef typename MatMass::value_type MassValue;
401 
402  protected :
403  typedef typename ClassComplexType<T>::Tcplx Complexe;
404 
407 
410 
413 
416 
419 
420  public :
421 
423 
424  void SelectCholeskySolver(int type);
425  void FactorizeCholeskyMass();
426 
427  template<class Storage, class Alloc>
429 
430  template<class T0, class T1, class Prop, class Storage, class Alloc>
432 
433  template<class TransStatus, class T0>
434  void MltCholeskyMass(const TransStatus& transA, Vector<T0>& X);
435 
436  template<class TransStatus, class T0>
437  void SolveCholeskyMass(const TransStatus& transA, Vector<T0>& X);
438 
439  template<class TransStatus>
440  void MltCholeskyMass(const TransStatus& transA,
441  Vector<complex<double> >& X);
442 
443  template<class TransStatus>
444  void MltCholeskyMass(const TransStatus& transA,
445  Vector<complex<double> >& X, double&);
446 
447  template<class TransStatus>
448  void MltCholeskyMass(const TransStatus& transA,
449  Vector<complex<double> >& X, complex<double>&);
450 
451  template<class TransStatus>
452  void SolveCholeskyMass(const TransStatus& transA,
453  Vector<complex<double> >& X);
454 
455  template<class TransStatus>
456  void SolveCholeskyMass(const TransStatus& transA,
457  Vector<complex<double> >& X, double&);
458 
459  template<class TransStatus>
460  void SolveCholeskyMass(const TransStatus& transA,
461  Vector<complex<double> >& X, complex<double>&);
462 
463  void ComputeAndFactorizeStiffnessMatrix(const T& a, const T& b);
464  void ComputeAndFactorizeStiffnessMatrix(const complex<T>& a,
465  const complex<T>& b,
466  bool real_p = true);
467 
468  template<class T0>
469  void ComputeAndFactorizeComplexMatrix(const complex<T0>& a,
470  const complex<T0>& b,
471  bool real_p = true);
472 
473  void ComputeAndFactorizeComplexMatrix(const complex<double>& a,
474  const complex<double>& b,
475  bool real_p = true);
476 
477  template<class T0>
478  void ComputeSolution(const Vector<T0>& X, Vector<T0>& Y);
479 
480  template<class TransA, class T0>
481  void ComputeSolution(const TransA& transA,
482  const Vector<T0>& X, Vector<T0>& Y);
483 
484  template<class TransA>
485  void ComputeComplexSolution(const TransA&,
486  const Vector<double>& X, Vector<double>& Y);
487 
488  template<class TransA>
489  void ComputeComplexSolution(const TransA&,
490  const Vector<complex<double> >& X,
491  Vector<complex<double> >& Y);
492 
493  void Clear();
494 
495  };
496 
497 
499  template<class T, class MatStiff>
501  : public EigenProblem_Base<T, MatStiff,
502  Matrix<double, Symmetric, ArrayRowSymSparse> >
503  {
504  public :
505 
507 
508  };
509 
510 
513  {
514  public :
515  enum {DEFAULT, ARPACK, ANASAZI, FEAST};
516 
517  static int default_solver;
518 
519  static int GetDefaultSolver();
520 
521  };
522 
523  template<class EigenPb, class Vector1, class Vector2,
524  class T, class Prop, class Storage, class Alloc3>
525  void GetEigenvaluesEigenvectors(EigenPb& var_eig, Vector1& lambda,
526  Vector2& lambda_imag,
528 
529 }
530 
531 #define SELDON_FILE_EIGENVALUE_SOLVER_HXX
532 #endif
533 
Seldon::EigenProblem_Base::IsSymmetricProblem
bool IsSymmetricProblem() const
returns true if the matrix is symmetric
Definition: EigenvalueSolver.cxx:547
Seldon::EigenProblem_Base::IsHermitianProblem
bool IsHermitianProblem() const
returns true if the matrix is hermitian
Definition: EigenvalueSolver.cxx:568
Seldon::EigenProblem_Base::PrintErrorInit
void PrintErrorInit() const
prints error of initialization and aborts program
Definition: EigenvalueSolver.cxx:538
Seldon::EigenProblem_Base::GetTypeSpectrum
int GetTypeSpectrum() const
returns the spectrum desired (large, small eigenvalues, etc)
Definition: EigenvalueSolver.cxx:253
Seldon::DenseEigenProblem
computation of a few eigenvalues for dense matrices
Definition: EigenvalueSolver.hxx:330
Seldon::EigenProblem_Base::n_
int n_
size of the problem
Definition: EigenvalueSolver.hxx:110
Seldon::DenseEigenProblem::MltCholeskyMass
void MltCholeskyMass(const TransStatus &transA, Vector< T0 > &X)
computation of L X or L^T X
Definition: EigenvalueSolver.cxx:1247
Seldon::EigenProblem_Base::Init
void Init(int n)
initialisation of the size of the eigenvalue problem
Definition: EigenvalueSolver.cxx:57
Seldon::EigenProblem_Base::shift
T shift
shift sigma (if type_spectrum = centered_eigenvalues)
Definition: EigenvalueSolver.hxx:113
Seldon::EigenProblem_Base::nb_maximum_iterations
int nb_maximum_iterations
Maximal number of iterations.
Definition: EigenvalueSolver.hxx:104
Seldon::DenseEigenProblem::mat_chol
Matrix< Tmass, PropM, StorageM > mat_chol
Cholesky factorisation of mass matrix.
Definition: EigenvalueSolver.hxx:342
Seldon::TypeEigenvalueSolver
list of availables eigenvalue solvers
Definition: EigenvalueSolver.hxx:512
Seldon::SparseEigenProblem::ComputeComplexSolution
void ComputeComplexSolution(const TransA &, const Vector< double > &X, Vector< double > &Y)
solves (a M + b K) Y = X when a and b are complex
Definition: EigenvalueSolver.cxx:1880
Seldon::SparseEigenProblem::chol_facto_mass_matrix
SparseCholeskySolver< double > chol_facto_mass_matrix
Cholesky factorisation of mass matrix if required.
Definition: EigenvalueSolver.hxx:412
Seldon::SparseEigenProblem
computation of a few eigenvalues for sparse matrices
Definition: EigenvalueSolver.hxx:396
Seldon::EigenProblem_Base::EigenProblem_Base
EigenProblem_Base()
default constructor
Definition: EigenvalueSolver.cxx:15
Seldon::SparseEigenProblem::mat_lu_cplx
SparseDirectSolver< Complexe > mat_lu_cplx
factorisation of complex system
Definition: EigenvalueSolver.hxx:409
Seldon::EigenProblem_Base::eigenvalue_computation_mode
int eigenvalue_computation_mode
mode used to find eigenvalues (regular, shifted, Cayley, etc)
Definition: EigenvalueSolver.hxx:68
Seldon::SparseEigenProblem::ComputeAndFactorizeComplexMatrix
void ComputeAndFactorizeComplexMatrix(const complex< T0 > &a, const complex< T0 > &b, bool real_p=true)
intermediary function
Definition: EigenvalueSolver.cxx:1737
Seldon::EigenProblem_Base::SetNbMaximumRestarts
void SetNbMaximumRestarts(int)
sets the restart parameter used in blocked solvers
Definition: EigenvalueSolver.cxx:189
Seldon::MatrixFreeEigenProblem::MatrixFreeEigenProblem
MatrixFreeEigenProblem()
default constructor
Definition: EigenvalueSolver.cxx:1926
Seldon::SparseEigenProblem::FactorizeCholeskyMass
void FactorizeCholeskyMass()
computes Cholesky factorisation of M from matrix M
Definition: EigenvalueSolver.cxx:1481
Seldon::EigenProblem_Base::GetLowerBoundInterval
double GetLowerBoundInterval() const
returns lower bound of the interval where eigenvalues are searched
Definition: EigenvalueSolver.cxx:358
Seldon::EigenProblem_Base::GetTypeSorting
int GetTypeSorting() const
returns how eigenvalues are sorted (real, imaginary part or modulus)
Definition: EigenvalueSolver.cxx:261
Seldon::DenseEigenProblem::ComputeSolution
void ComputeSolution(const Vector< T0 > &X, Vector< T0 > &Y)
solution of (a M + b K) Y = X
Definition: EigenvalueSolver.cxx:1410
Seldon::EigenProblem_Base::SetNbMaximumIterations
void SetNbMaximumIterations(int n)
sets the maximal number of iterations allowed for the iterative algorithm
Definition: EigenvalueSolver.cxx:438
Seldon::EigenProblem_Base::SetPrintLevel
void SetPrintLevel(int lvl)
sets the level of verbosity
Definition: EigenvalueSolver.cxx:506
Seldon::Vector< MassValue >
Seldon::EigenProblem_Base::ComputeAndFactorizeStiffnessMatrix
void ComputeAndFactorizeStiffnessMatrix(const T &a, const T &b)
computation of matrix a M + b K and factorisation of this matrix
Definition: EigenvalueSolver.cxx:758
Seldon::Vector2
Vector of vectors.
Definition: Vector2.hxx:53
Seldon::SparseEigenProblem::Clear
void Clear()
clears memory used by the object
Definition: EigenvalueSolver.cxx:1913
Seldon::EigenProblem_Base::GetComputationalMode
int GetComputationalMode() const
returns the spectral transformation used for evaluation of eigenvalues
Definition: EigenvalueSolver.cxx:133
Seldon::SortEigenvalues
void SortEigenvalues(Vector< T > &lambda_r, Vector< T > &lambda_i, Matrix< T, General, Storage1, Alloc1 > &eigen_old, Matrix< T, General, Storage2, Alloc2 > &eigen_new, int type_spectrum, int type_sort, const T &shift_r, const T &shift_i)
sorting eigenvalues
Definition: EigenvalueSolver.cxx:1040
Seldon::EigenProblem_Base::SetNbArnoldiVectors
void SetNbArnoldiVectors(int n)
sets the number of Arnoldi vectors to use
Definition: EigenvalueSolver.cxx:473
Seldon::DenseEigenProblem::Clear
void Clear()
clearing variables used for eigenvalue resolution
Definition: EigenvalueSolver.cxx:1443
Seldon::EigenProblem_Base::nb_arnoldi_vectors
int nb_arnoldi_vectors
number of Arnoldi vectors
Definition: EigenvalueSolver.hxx:116
Seldon::MatrixFreeEigenProblem
computation of a few eigenvalues with only matrix-vector product
Definition: EigenvalueSolver.hxx:500
Seldon::EigenProblem_Base::MltStiffness
void MltStiffness(const Vector< T > &X, Vector< T > &Y)
matrix vector product with stifness matrix Y = K X
Definition: EigenvalueSolver.cxx:709
Seldon::Matrix
Definition: SeldonHeader.hxx:226
Seldon::EigenProblem_Base::ComputeStiffnessMatrix
void ComputeStiffnessMatrix()
computation of stiffness matrix K
Definition: EigenvalueSolver.cxx:691
Seldon::EigenProblem_Base::GetN
int GetN() const
returns number of columns
Definition: EigenvalueSolver.cxx:490
Seldon::EigenProblem_Base::ComputeDiagonalMass
void ComputeDiagonalMass()
computation of diagonal of mass matrix
Definition: EigenvalueSolver.cxx:634
Seldon::EigenProblem_Base::MassValue
MatMass::value_type MassValue
type for number stored in mass matrix
Definition: EigenvalueSolver.hxx:64
Seldon::EigenProblem_Base::nb_blocks
int nb_blocks
number of blocks for blocked solvers
Definition: EigenvalueSolver.hxx:152
Seldon::EigenProblem_Base::ComputeMassMatrix
void ComputeMassMatrix()
computation of mass matrix M
Definition: EigenvalueSolver.cxx:663
Seldon::EigenProblem_Base::ortho_manager
int ortho_manager
orthogonalization manager
Definition: EigenvalueSolver.hxx:149
Seldon::EigenProblem_Base::diagonal_mass
bool diagonal_mass
if true, the generalized problem is reduced to a standard problem
Definition: EigenvalueSolver.hxx:98
Seldon::SparseEigenProblem::SparseEigenProblem
SparseEigenProblem()
default constructor
Definition: EigenvalueSolver.cxx:1461
Seldon::EigenProblem_Base::SetEigensolverType
void SetEigensolverType(int type)
sets the solver used in Anasazi
Definition: EigenvalueSolver.cxx:213
Seldon::SparseEigenProblem::MltCholeskyMass
void MltCholeskyMass(const TransStatus &transA, Vector< T0 > &X)
computes L X or L^T x if M = L L^T
Definition: EigenvalueSolver.cxx:1526
Seldon::EigenProblem_Base::SetNbAskedEigenvalues
void SetNbAskedEigenvalues(int n)
sets the number of eigenvalues to compute
Definition: EigenvalueSolver.cxx:237
Seldon::EigenProblem_Base::stopping_criterion
double stopping_criterion
threshold for Arpack's iterative process
Definition: EigenvalueSolver.hxx:101
Seldon::SparseDirectSolver
Class grouping different direct solvers.
Definition: SparseDirectSolver.hxx:26
Seldon::SparseEigenProblem::ComputeSolution
void ComputeSolution(const Vector< T0 > &X, Vector< T0 > &Y)
solves (a M + b K) Y = X with stored factorization
Definition: EigenvalueSolver.cxx:1845
Seldon::DenseEigenProblem::mat_lu
Matrix< T, Prop, Storage > mat_lu
LU factorisation of matrix.
Definition: EigenvalueSolver.hxx:336
Seldon::EigenProblem_Base::GetNbAskedEigenvalues
int GetNbAskedEigenvalues() const
returns the number of eigenvalues asked by the user
Definition: EigenvalueSolver.cxx:149
Seldon::EigenProblem_Base::SetStoppingCriterion
void SetStoppingCriterion(double eps)
modifies the stopping critertion
Definition: EigenvalueSolver.cxx:421
Seldon::EigenProblem_Base::automatic_selection_arnoldi_vectors
bool automatic_selection_arnoldi_vectors
if true nb_arnoldi_vectors is automatically computed
Definition: EigenvalueSolver.hxx:119
Seldon::TypeEigenvalueSolver::GetDefaultSolver
static int GetDefaultSolver()
returns the default eigenvalue solver (linear eigenproblem)
Definition: EigenvalueSolver.cxx:1936
Seldon::DenseEigenProblem::Xchol_real
Vector< Tmass > Xchol_real
temporary vectors for Cholesky
Definition: EigenvalueSolver.hxx:345
Seldon::RowSymPacked
Definition: Storage.hxx:157
Seldon::EigenProblem_Base::nb_prod
int nb_prod
number of matrix-vector products
Definition: EigenvalueSolver.hxx:107
Seldon::EigenProblem_Base::MltInvSqrtDiagonalMass
void MltInvSqrtDiagonalMass(Vector< T0 > &X)
multiplication of X by D^-1/2
Definition: EigenvalueSolver.cxx:614
Seldon::EigenProblem_Base::ComputeSolution
void ComputeSolution(const Vector< T0 > &X, Vector< T0 > &Y)
solving the linear system (a M + b K) Y = X
Definition: EigenvalueSolver.cxx:781
Seldon::EigenProblem_Base::IncrementProdMatVect
void IncrementProdMatVect()
increment of the number of matrix vector products
Definition: EigenvalueSolver.cxx:514
Seldon::EigenProblem_Base::SetNbAdditionalEigenvalues
void SetNbAdditionalEigenvalues(int n)
sets the number of additional eigenvalues
Definition: EigenvalueSolver.cxx:245
Seldon::EigenProblem_Base::nb_eigenvalues_wanted
int nb_eigenvalues_wanted
number of eigenvalues to be computed
Definition: EigenvalueSolver.hxx:71
Seldon::EigenProblem_Base::SolveCholeskyMass
void SolveCholeskyMass(const TransStatus &transA, Vector< T > &X)
computation of L^-1 X or L^-T x if M = L L^T
Definition: EigenvalueSolver.cxx:819
Seldon::EigenProblem_Base::restart_number
int restart_number
restart parameter for blocked solvers
Definition: EigenvalueSolver.hxx:155
Seldon::EigenProblem_Base::InitMatrix
void InitMatrix(MatStiff &)
initialization of a standard eigenvalue problem
Definition: EigenvalueSolver.cxx:93
Seldon::EigenProblem_Base::Clear
void Clear()
memory release
Definition: EigenvalueSolver.cxx:827
Seldon::EigenProblem_Base::use_cholesky
bool use_cholesky
if true, the generalized problem is reduced to a standard problem
Definition: EigenvalueSolver.hxx:91
Seldon::EigenProblem_Base::sqrt_diagonal_mass
Vector< MassValue > sqrt_diagonal_mass
diagonal D^1/2 if the mass matrix is diagonal positive
Definition: EigenvalueSolver.hxx:124
Seldon::EigenProblem_Base::FactorizeDiagonalMass
void FactorizeDiagonalMass()
computation of D^1/2 from D
Definition: EigenvalueSolver.cxx:604
Seldon::EigenProblem_Base::GetStoppingCriterion
double GetStoppingCriterion() const
returns the stopping criterion
Definition: EigenvalueSolver.cxx:430
Seldon::SparseEigenProblem::ComputeAndFactorizeStiffnessMatrix
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
Definition: EigenvalueSolver.cxx:1635
Seldon::EigenProblem_Base::Mh
MatMass * Mh
mass matrix
Definition: EigenvalueSolver.hxx:131
Seldon::General
Definition: Properties.hxx:26
Seldon::EigenProblem_Base::type_solver
int type_solver
which solver ?
Definition: EigenvalueSolver.hxx:142
Seldon::SparseCholeskySolver< double >
Seldon::EigenProblem_Base::MltMass
void MltMass(const Vector< T > &X, Vector< T > &Y)
matrix vector product with mass matrix Y = M X
Definition: EigenvalueSolver.cxx:672
Seldon::EigenProblem_Base::SetCholeskyFactoForMass
void SetCholeskyFactoForMass(bool chol=true)
indicates the use of Cholesky factorisation in order to solve a standard eigenvalue problem instead o...
Definition: EigenvalueSolver.cxx:387
Seldon::EigenProblem_Base::DiagonalMass
bool DiagonalMass() const
returns true if the mass matrix is diagonal
Definition: EigenvalueSolver.cxx:412
Seldon::EigenProblem_Base::GetUpperBoundInterval
double GetUpperBoundInterval() const
returns upper bound of the interval where eigenvalues are searched
Definition: EigenvalueSolver.cxx:367
Seldon::EigenProblem_Base::type_spectrum_wanted
int type_spectrum_wanted
which spectrum ? Near from Zero ? Near from Infinity ? or near from a value ?
Definition: EigenvalueSolver.hxx:80
Seldon::EigenProblem_Base::emin_interval
double emin_interval
interval where eigenvalues are searched
Definition: EigenvalueSolver.hxx:162
Seldon::EigenProblem_Base::SetIntervalSpectrum
void SetIntervalSpectrum(double, double)
sets the interval where eigenvalues are searched
Definition: EigenvalueSolver.cxx:376
Seldon::EigenProblem_Base::GetEigensolverType
int GetEigensolverType() const
returns the solver used in Anasazi
Definition: EigenvalueSolver.cxx:205
Seldon::EigenProblem_Base::GetImagShiftValue
T GetImagShiftValue() const
returns the imaginary part of shift value used
Definition: EigenvalueSolver.cxx:288
Seldon::DenseEigenProblem::DenseEigenProblem
DenseEigenProblem()
default constructor
Definition: EigenvalueSolver.cxx:1215
Seldon::EigenProblem_Base
Base class to solve an eigenvalue problem.
Definition: EigenvalueSolver.hxx:18
Seldon::EigenProblem_Base::nb_add_eigenvalues
int nb_add_eigenvalues
additional number of eigenvalues
Definition: EigenvalueSolver.hxx:77
Seldon::EigenProblem_Base::GetM
int GetM() const
returns number of rows
Definition: EigenvalueSolver.cxx:482
Seldon::DenseEigenProblem::FactorizeCholeskyMass
void FactorizeCholeskyMass()
Cholesky factorisation of mass matrix.
Definition: EigenvalueSolver.cxx:1225
Seldon::EigenProblem_Base::SetNbBlocks
void SetNbBlocks(int)
returns the number of blocks used in blocked solvers
Definition: EigenvalueSolver.cxx:173
Seldon::EigenProblem_Base::type_sort_eigenvalues
int type_sort_eigenvalues
large eigenvalues because of their real part, imaginary part or magnitude ?
Definition: EigenvalueSolver.hxx:83
Seldon::EigenProblem_Base::GetNbAdditionalEigenvalues
int GetNbAdditionalEigenvalues() const
returns the additional number of eigenvalues
Definition: EigenvalueSolver.cxx:157
Seldon::EigenProblem_Base::SetTypeSpectrum
void SetTypeSpectrum(int type, const T &val, int type_sort=SORTED_MODULUS)
sets which eigenvalues are searched
Definition: EigenvalueSolver.cxx:317
Seldon::EigenProblem_Base::UseCholeskyFactoForMass
bool UseCholeskyFactoForMass() const
returns true if Cholesky factorisation has to be used for mass matrix
Definition: EigenvalueSolver.cxx:396
Seldon::DenseEigenProblem::pivot
Vector< int > pivot
pivot used by the LU factorisation
Definition: EigenvalueSolver.hxx:339
Seldon::EigenProblem_Base::Kh
MatStiff * Kh
stiffness matrix
Definition: EigenvalueSolver.hxx:134
Seldon::EigenProblem_Base::SetDiagonalMass
void SetDiagonalMass(bool diag=true)
indicates that the mass matrix is diagonal
Definition: EigenvalueSolver.cxx:404
Seldon::SparseEigenProblem::imag_solution
bool imag_solution
if true, we take imaginary part of (K - sigma M)^-1
Definition: EigenvalueSolver.hxx:418
Seldon::Symmetric
Definition: Properties.hxx:30
Seldon::EigenProblem_Base::GetPrintLevel
int GetPrintLevel() const
returns level of verbosity
Definition: EigenvalueSolver.cxx:498
Seldon::EigenProblem_Base::ApplyScalingEigenvec
friend void ApplyScalingEigenvec(EigenPb &var, Vector1 &eigen_values, Vector1 &lambda_imag, Matrix1 &eigen_vectors, const T0 &shiftr, const T0 &shifti)
modification of eigenvectors to take into account scaling by mass matrix
Definition: EigenvalueSolver.cxx:846
Seldon::SparseEigenProblem::SolveCholeskyMass
void SolveCholeskyMass(const TransStatus &transA, Vector< T0 > &X)
computes L^-1 X or L^-T x if M = L L^T
Definition: EigenvalueSolver.cxx:1536
Seldon::EigenProblem_Base::GetShiftValue
T GetShiftValue() const
returns the shift value used
Definition: EigenvalueSolver.cxx:274
Seldon::SparseEigenProblem::Xchol_real
Vector< double > Xchol_real
temporary vectors for Cholesky
Definition: EigenvalueSolver.hxx:415
Seldon::DenseEigenProblem::SolveCholeskyMass
void SolveCholeskyMass(const TransStatus &transA, Vector< T0 > &X)
computation of L^-1 X or L^-T X
Definition: EigenvalueSolver.cxx:1258
Seldon
Seldon namespace.
Definition: Array.cxx:24
Seldon::EigenProblem_Base::MltCholeskyMass
void MltCholeskyMass(const TransStatus &transA, Vector< T > &X)
computation of L X or L^T x if M = L L^T
Definition: EigenvalueSolver.cxx:809
Seldon::EigenProblem_Base::complex_system
bool complex_system
if true consider Real( (a M + bK)^-1) or Imag( (a M + b K)^-1 ) or the whole system,...
Definition: EigenvalueSolver.hxx:128
Seldon::EigenProblem_Base::GetNbMatrixVectorProducts
int GetNbMatrixVectorProducts() const
returns the number of matrix-vector products performed since last call to Init
Definition: EigenvalueSolver.cxx:457
Seldon::SparseEigenProblem::mat_lu
SparseDirectSolver< T > mat_lu
LU factorisation of sparse matrix.
Definition: EigenvalueSolver.hxx:406
Seldon::EigenProblem_Base::GetNbMaximumRestarts
int GetNbMaximumRestarts() const
returns the restart parameter used in blocked solvers
Definition: EigenvalueSolver.cxx:181
Seldon::EigenProblem_Base::ComputeMassForCholesky
void ComputeMassForCholesky()
computation of mass matrix
Definition: EigenvalueSolver.cxx:654
Seldon::DenseEigenProblem::ComputeAndFactorizeStiffnessMatrix
void ComputeAndFactorizeStiffnessMatrix(const T &a, const T &b)
computation and factorisation of a M + b K
Definition: EigenvalueSolver.cxx:1310
Seldon::EigenProblem_Base::GetNbBlocks
int GetNbBlocks() const
returns the number of blocks used in blocked solvers
Definition: EigenvalueSolver.cxx:165
Seldon::EigenProblem_Base::GetOrthoManager
int GetOrthoManager() const
returns orthogonalization manager set in Anasazi
Definition: EigenvalueSolver.cxx:197
Seldon::EigenProblem_Base::print_level
int print_level
print level
Definition: EigenvalueSolver.hxx:121
Seldon::EigenProblem_Base::SetComputationalMode
void SetComputationalMode(int mode)
sets the spectral transformation used for evaluation of eigenvalues
Definition: EigenvalueSolver.cxx:141
Seldon::DenseEigenProblem::ComputeAndFactorizeComplexMatrix
void ComputeAndFactorizeComplexMatrix(const complex< T0 > &a, const complex< T0 > &b, bool real_p=true)
computation and factorisation of a M + b K
Definition: EigenvalueSolver.cxx:1397
Seldon::EigenProblem_Base::SetShiftValue
void SetShiftValue(const T &)
Sets the real part of shift value.
Definition: EigenvalueSolver.cxx:296
Seldon::SparseEigenProblem::SelectCholeskySolver
void SelectCholeskySolver(int type)
sets Cholesky solver to use
Definition: EigenvalueSolver.cxx:1472
Seldon::EigenProblem_Base::SetImagShiftValue
void SetImagShiftValue(const T &)
Sets the imaginary part of shift value.
Definition: EigenvalueSolver.cxx:304
Seldon::EigenProblem_Base::GetNbArnoldiVectors
int GetNbArnoldiVectors() const
returns the number of Arnoldi vectors to use
Definition: EigenvalueSolver.cxx:465
Seldon::EigenProblem_Base::GetNbMaximumIterations
int GetNbMaximumIterations() const
returns the maximal number of iterations allowed for the iterative algorithm
Definition: EigenvalueSolver.cxx:447
Seldon::EigenProblem_Base::MltSqrtDiagonalMass
void MltSqrtDiagonalMass(Vector< T0 > &X)
multiplication of X by D^1/2
Definition: EigenvalueSolver.cxx:624
Seldon::EigenProblem_Base::FactorizeCholeskyMass
void FactorizeCholeskyMass()
computation of Cholesky factorisation of M from matrix M
Definition: EigenvalueSolver.cxx:799