00001 #ifndef SOLVER_H
00002 #define SOLVER_H
00003
00004
00005 #include <lac/vector.h>
00006 #include <lac/solver_control.h>
00007 #include <base/subscriptor.h>
00008 #include <lac/vector_memory.h>
00009
00010
00011 template <class VECTOR = ::Vector<double> >
00012 class Solver : public ::Subscriptor
00013 {
00014 public:
00029 Solver (::SolverControl &solver_control,
00030 ::VectorMemory<VECTOR> &vector_memory);
00031
00050 Solver (::SolverControl &solver_control);
00051
00056 ::SolverControl & control() const;
00057
00058 protected:
00065 mutable ::PrimitiveVectorMemory<VECTOR> static_vector_memory;
00066
00070 ::SolverControl &cntrl;
00071
00075 ::VectorMemory<VECTOR> &memory;
00076 };
00077
00078
00079
00080 template<class VECTOR>
00081 inline
00082 Solver<VECTOR>::Solver (::SolverControl &solver_control,
00083 ::VectorMemory<VECTOR> &vector_memory)
00084 :
00085 cntrl(solver_control),
00086 memory(vector_memory)
00087 {}
00088
00089
00090
00091 template<class VECTOR>
00092 inline
00093 Solver<VECTOR>::Solver (::SolverControl &solver_control)
00094 :
00095 cntrl(solver_control),
00096 memory(static_vector_memory)
00097 {}
00098
00099
00100
00101 template <class VECTOR>
00102 inline
00103 ::SolverControl &
00104 Solver<VECTOR>::control() const
00105 {
00106 return cntrl;
00107 }
00108
00109
00110 #endif // SOLVER_H
00111