ARPACK.hh

Go to the documentation of this file.
1 
7 #ifndef ARPACK_hh
8 #define ARPACK_hh
9 
10 #include <cfloat>
11 #include "eigensolver/eigens.hh"
12 
13 namespace concepts {
14  // forward declaration
15  template<typename F>
16  class Operator;
17 } // namespace concepts
18 
19 namespace eigensolver {
20 
21 using concepts::Real;
22 using concepts::Cmplx;
23 
24  // ********************************************************* ArPack **
25 
69  template <typename F, typename G = Real, typename H = Real>
70  class ArPack : public EigenSolver<F> {
71  public:
75  enum which { LM, SM, LR, SR, LI, SI };
92  enum modus { NORMAL = 1, REGINV = 2, SHIFTINV = 3, SHIFTINVIMAG = 4 };
127  concepts::Operator<H>& B, const int kmax = 1,
128  const Real tol = 0.0, const int maxiter = 300,
129  enum which target = SM, enum modus mode = REGINV,
130  const F sigma = 0.0,
131  const concepts::Vector<F>* start = 0,
132  const concepts::Array<F>* resid = 0,
133  const bool schur = false);
134  virtual ~ArPack();
139  virtual const concepts::Array<F>& getEV();
148  virtual uint iterations() const { return (uint)iter_; }
150  virtual uint converged() const { return (uint)k_conv_; }
153  protected:
154  virtual std::ostream& info(std::ostream& os) const;
155  private:
163  int kmax_;
165  int maxiter_;
176  enum which target_;
178  enum modus mode_;
180  const F sigma_;
186  const bool schur_;
188  bool computed_;
192  void compute_();
193 
195  };
196 
197 } // namespace eigensolver
198 
199 #endif // ARPACK_hh
Interafce for eigenvalue solvers.
Definition: eigens.hh:23
void compute_()
Compute eigenpairs.
concepts::Array< F > resid_out_
The residual vector for output:
Definition: ARPACK.hh:190
modus
Specify mode of ARPACK which should be used to compute the Ritz values of OP.
Definition: ARPACK.hh:92
const concepts::Array< F > * resid_in_
Calculate vectors instead of eigenvectors Input of a residual vector (startvector) as array:
Definition: ARPACK.hh:185
concepts::Array< F > eigenvalues_
Storage space for eigenvalues.
Definition: ARPACK.hh:170
const concepts::Vector< F > * start_
Starting vector, if not given ARPACK invents one.
Definition: ARPACK.hh:182
enum modus mode_
Mode in which ARPACK should be used.
Definition: ARPACK.hh:178
ArPack(concepts::Operator< G > &OP, concepts::Operator< F > &A, concepts::Operator< H > &B, const int kmax=1, const Real tol=0.0, const int maxiter=300, enum which target=SM, enum modus mode=REGINV, const F sigma=0.0, const concepts::Vector< F > *start=0, const concepts::Array< F > *resid=0, const bool schur=false)
Constructor.
const bool schur_
Definition: ARPACK.hh:186
virtual uint iterations() const
Returns the number of iterations.
Definition: ARPACK.hh:148
Real tol_
Convergence tolerance for the eigenpairs.
Definition: ARPACK.hh:167
An array of objects.
Definition: bilinearForm.hh:23
virtual uint converged() const
Returns the number of converged eigenpairs.
Definition: ARPACK.hh:150
int kmax_
Number of eigenpairs to be computed.
Definition: ARPACK.hh:163
concepts::Operator< H > & B_
Operator B as described in modus.
Definition: ARPACK.hh:161
enum which target_
Sort of eigenvalues to compute.
Definition: ARPACK.hh:176
concepts::Array< F > eigenvectors_
Storage space for eigenvectors.
Definition: ARPACK.hh:172
which
Specify which of the Ritz values of OP (described in modus) to compute.
Definition: ARPACK.hh:75
concepts::Array< concepts::Vector< F > * > ev_
References into storage for eigenvectors.
Definition: ARPACK.hh:174
bool computed_
Eigenpairs computed?
Definition: ARPACK.hh:188
Abstract class for an operator.
Definition: ARPACK.hh:16
Eigenvalue solver using ARPACK, the routine dnaupd or znaupd.
Definition: ARPACK.hh:70
std::complex< Real > Cmplx
Type for a complex number. It also depends on the setting of Real.
Definition: typedefs.hh:39
concepts::Operator< F > & A_
Stiffness matrix.
Definition: ARPACK.hh:159
virtual const concepts::Array< F > & getEV()
Returns an array with the real parts of the eigenvalues in the first kmax entries and the imaginary p...
const F sigma_
Shift for the shift-invert modes:
Definition: ARPACK.hh:180
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
concepts::Array< F > getRESID()
Returns the RESID vector:
Definition: ARPACK.hh:152
int maxiter_
Maximum number of Arnoldi iterations allowed.
Definition: ARPACK.hh:165
concepts::Operator< G > & OP_
Operator OP as described in modus.
Definition: ARPACK.hh:157
Eigenvalue solvers.
Definition: ARPACK.hh:19
virtual const concepts::Array< concepts::Vector< F > * > & getEF()
Returns an array with the eigenfunctions.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich