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

operator/gmresFabric.hh
Go to the documentation of this file.
00001 // fabric class for GMRes
00002 
00003 #ifndef GMResfabric_hh
00004 #define GMResfabric_hh
00005 
00006 #if __GNUC__ == 2
00007 #  include <float.h>
00008 #  define EPS DBL_EPSILON
00009 #else
00010 #  include <limits>
00011 #  define EPS std::numeric_limits<double>::epsilon()
00012 #endif
00013 #include "operator/gmres.hh"
00014 #include "operator/solverFabric.hh"
00015 
00016 namespace concepts {
00017 
00018   // *********************************************************** GMResFabric **
00019 
00023   template<typename F>
00024   class GMResFabric : public SolverFabric<F> {
00025   public:
00032     GMResFabric(Real maxeps = EPS,
00033                 int maxit = 0, uint rs = 0, uint relres = 0)
00034       : maxeps_(maxeps), maxit_(maxit), rs_(rs), relres_(relres) {}
00035     virtual Operator<F>* operator()(Operator<F>& matrix) {
00036       return new GMRes<F>(matrix, maxeps_, maxit_, rs_, relres_);
00037     }
00038   protected:
00039     virtual std::ostream& info(std::ostream& os) const {
00040       return os << "GMResFabric(maxeps = " << maxeps_ << ", maxit = "
00041                 << maxit_ << ", rs = " << rs_ << ", relres = " 
00042                 << relres_ << ")";
00043     }
00044   private:
00046     Real maxeps_;
00048     int maxit_;
00050     uint rs_;
00052     uint relres_;
00053   };
00054 
00055 } // concepts
00056 
00057 #endif // GMResfabric_hh

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