Go to the documentation of this file.00001
00002
00003 #ifndef BiCGStabfabric_hh
00004 #define BiCGStabfabric_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 "bicgstab.hh"
00014 #include "solverFabric.hh"
00015
00016 namespace concepts {
00017
00018
00019
00023 template<typename F, typename G = F>
00024 class BiCGStabFabric : public PrecondSolverFabric<F,G> {
00025 public:
00032 BiCGStabFabric(Real maxeps = EPS,
00033 int maxit = 0, bool relres = false, bool throwing = true)
00034 : maxeps_(maxeps), maxit_(maxit), relres_(relres),
00035 throwing_(throwing) {}
00036 virtual Operator<F>* operator()(Operator<F>& matrix) {
00037 return new BiCGStab<F>(matrix, maxeps_, maxit_, relres_, throwing_);
00038 }
00039 virtual Operator<F>* operator()(Operator<F>& matrix, Operator<G>& precond)
00040 {
00041 return new BiCGStab<F>(matrix, precond, maxeps_, maxit_, relres_,
00042 throwing_);
00043 }
00044 protected:
00045 virtual std::ostream& info(std::ostream& os) const {
00046 return os << "BiCGStabFabric(maxeps = " << maxeps_ << ", maxit = "
00047 << maxit_ << ", relres = " << relres_ << ')';
00048 }
00049 private:
00051 Real maxeps_;
00053 int maxit_;
00055 bool relres_;
00059 bool throwing_;
00060 };
00061
00062 }
00063
00064 #endif // BiCGStabfabric_hh