Listing 1: The definition for an Integrator base class.
template <class C /* a container */, class T> class Integrator
protected:
C statevector;
T t, h;
// a pointer to the function to be integrated
void (*return_derivs)(const C& x, const T t, C& deriv);
Integrator (const C&, const T, const T,
void (*)(const C&, const T, C&));
public:
virtual ~Integrator() { }
virtual void step(void) = 0;
virtual void set_step_size(T new_h) {h = new_h;}
T current_time(void) const {return(t);}
void get_state(C&, T&) const;
};