Scythe-1.0.3
template<typename T , typename FUNCTOR >
T scythe::intsimp ( FUNCTOR  fun,
a,
b,
unsigned int  N 
)

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.
Exceptions:
scythe_invalid_arg(Level 1)
See also:
adaptsimp(FUNCTOR fun, T a, T b, unsigned int& N, double tol = 1e-5)
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 SCYTHE_CHECK_10.

Referenced by adaptsimp().