Class documentation of Concepts

Loading...
Searching...
No Matches
cgFabric.hh
Go to the documentation of this file.
1
6#ifndef CGfabric_hh
7#define CGfabric_hh
8
9#if __GNUC__ == 2
10# include <float.h>
11# define EPS DBL_EPSILON
12#else
13# include <limits>
14# define EPS std::numeric_limits<double>::epsilon()
15#endif
16#include "cg.hh"
17#include "solverFabric.hh"
18
19namespace concepts {
20
21 // ************************************************************** CGFabric **
22
26 template<typename F>
27 class CGFabric : public SolverFabric<F> {
28 public:
36 CGFabric(Real maxeps = EPS, int maxit = 0, bool relres = false,
37 bool throwing = true)
38 : maxeps_(maxeps), maxit_(maxit), relres_(relres), throwing_(throwing) {}
39 virtual Operator<F>* operator()(Operator<F>& matrix) {
40 return new CG<F>(matrix, maxeps_, maxit_, relres_, throwing_);
41 }
43 protected:
44 virtual std::ostream& info(std::ostream& os) const {
45 return os << concepts::typeOf(*this)<<"(maxeps = " << maxeps_ << ", maxit = "
46 << maxit_ << ", relres = " << relres_ << ')';
47 }
48 private:
50 Real maxeps_;
52 int maxit_;
54 bool relres_;
58 bool throwing_;
59 };
60
61} // concepts
62
63#endif // CGfabric_hh
CGFabric(Real maxeps=EPS, int maxit=0, bool relres=false, bool throwing=true)
Definition cgFabric.hh:36
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition cgFabric.hh:44
Operator< F > * operator()()
Definition cgFabric.hh:42
std::string typeOf(const T &t)
Definition output.hh:43
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320