
7 Dec
2006
7 Dec
'06
3:52 p.m.
On Dec 7, 2006, at 4:22 PM, Neal Becker wrote:
Starting with basics. Here is my idea for a family of 1-d integrators:
template<typename func_t> struct arg { typedef typename func_t::arg_t type; };
template<typename func_t> struct ret { typedef typename func_t::ret_t type; };
template<typename func_t, typename arg_t=typename arg<func_t>::type, typename ret_t=typename ret<func_t>::type> struct trap_1d { ret_t operator() (arg_t lower, arg_t upper); };
I have neither real objections on the template parameters, nor on making the integrator a functor. But I just have one simple question: what should trap_1d::operator() return? succesive refinements of the integral when called multiple times?