Scythe-1.0.3
template<typename T , typename FUNCTOR >
T scythe::adaptsimp ( FUNCTOR  fun,
a,
b,
unsigned int  N,
double  tol = 1e-5 
)

Calculate the definite integral of a function from a to b.

This function calculates the definite integral of a univariate function on the interval $[a,b]$.

Parameters:
funThe function (or functor) whose definite integral is to be calculated. This function should both take and return a single argument of type T.
aThe starting value of the interval.
bThe ending value of the interval.
NThe number of subintervals to calculate. Increasing this number will improve the accuracy of the estimate but will also increase run-time.
tolThe accuracy required. Both accuracy and run-time decrease as this number increases.
Exceptions:
scythe_invalid_arg(Level 1)
See also:
intsimp(FUNCTOR fun, T a, T b, unsigned int& N)
Note:
Users will typically wish to implement fun in terms of a functor. Using a functor provides a generic way in which to evaluate functions with more than one parameter. Furthermore, although one can pass a function pointer to this routine, the compiler cannot inline and fully optimize code referenced by function pointers.

References fabs(), intsimp(), and SCYTHE_CHECK_10.