
7 Dec
2006
7 Dec
'06
3:22 p.m.
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 thought about having the integrator type (romberg, trap, etc) be specified as the 1st template parameter, but offhand I don't see what value that adds. Any thoughts?