Calculate the definite integral of a function from a to b.
This function calculates the definite integral of a univariate function on the interval .
- Parameters:
-
fun | The function (or functor) whose definite integral is to be calculated. This function should both take and return a single argument of type T. |
a | The starting value of the interval. |
b | The ending value of the interval. |
N | The number of subintervals to calculate. Increasing this number will improve the accuracy of the estimate but will also increase run-time. |
- Exceptions:
-
- 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().