Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

eigensolver/ARPACK.hh
Go to the documentation of this file.
00001 // ARPACK eigensolver using dnaupd (Real) or znaupd (Cmplx)
00002 
00003 #ifndef ARPACK_hh
00004 #define ARPACK_hh
00005 
00006 #include <cfloat>
00007 #include "eigensolver/eigens.hh"
00008 
00009 namespace concepts {
00010   // forward declaration
00011   template<typename F>
00012   class Operator;
00013 } // namespace concepts
00014 
00015 namespace eigensolver {
00016 
00017 using concepts::Real;
00018 using concepts::Cmplx;
00019 
00020   // ********************************************************* ArPack **
00021 
00065   template <typename F, typename G = Real, typename H = Real>
00066   class ArPack : public EigenSolver<F> {
00067   public:
00071     enum which { LM, SM, LR, SR, LI, SI };
00088     enum modus { NORMAL = 1, REGINV = 2, SHIFTINV = 3, SHIFTINVIMAG = 4 };
00121     ArPack(concepts::Operator<G>& OP,
00122            concepts::Operator<F>& A,
00123            concepts::Operator<H>& B, const int kmax = 1,
00124            const Real tol = 0.0, const int maxiter = 300,
00125            enum which target = SM, enum modus mode = REGINV,
00126            const F sigma = 0.0,
00127            const concepts::Vector<F>* start = 0,
00128            const concepts::Array<F>* resid = 0,
00129            const bool schur = false);
00130     virtual ~ArPack();
00135     virtual const concepts::Array<F>& getEV();
00142     virtual const concepts::Array<concepts::Vector<F>*>& getEF();
00144     virtual uint iterations() const { return (uint)iter_; }
00146     virtual uint converged() const { return (uint)k_conv_; }
00148     concepts::Array<F> getRESID() { return resid_out_; }
00149   protected:
00150     virtual std::ostream& info(std::ostream& os) const;
00151   private:
00153     concepts::Operator<G>& OP_;
00155     concepts::Operator<F>& A_;
00157     concepts::Operator<H>& B_;
00159     int kmax_;
00161     int maxiter_;
00163     Real tol_;
00164     int numop_, numopb_, numreo_, k_conv_, iter_;
00166     concepts::Array<F> eigenvalues_;
00168     concepts::Array<F> eigenvectors_;
00170     concepts::Array<concepts::Vector<F>*> ev_;
00172     enum which target_;
00174     enum modus mode_;
00176     const F sigma_;
00178     const concepts::Vector<F>* start_;
00181     const concepts::Array<F>* resid_in_;
00182     const bool schur_;
00184     bool computed_;
00186     concepts::Array<F> resid_out_;
00188     void compute_();
00189 
00190     void computeCmplx_();
00191   };
00192 
00193 } // namespace eigensolver
00194 
00195 #endif // ARPACK_hh

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)