File: integrate_function_adapt_simpson_abstract.h

package info (click to toggle)
concurrentqueue 1.0.3%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,648 kB
  • sloc: cpp: 37,303; makefile: 88; ansic: 67; python: 46; sh: 18
file content (34 lines) | stat: -rw-r--r-- 1,224 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (C) 2013 Steve Taylor (steve98654@gmail.com)
// License: Boost Software License  See LICENSE.txt for the full license.
#undef DLIB_INTEGRATE_FUNCTION_ADAPT_SIMPSON_ABSTRACTh_
#ifdef DLIB_INTEGRATE_FUNCTION_ADAPT_SIMPSON_ABSTRACTh_

namespace dlib
{

    template <typename T, typename funct>
    T integrate_function_adapt_simp(
        const funct& f, 
        T a, 
        T b, 
        T tol = 1e-10
    );
    /*!
        requires 
            - b > a
            - tol > 0
            - T should be either float, double, or long double
            - The expression f(a) should be a valid expression that evaluates to a T.
              I.e. f() should be a real valued function of a single variable.
        ensures
            - returns an approximation of the integral of f over the domain [a,b] using the
              adaptive Simpson method outlined in Gander, W. and W. Gautshi, "Adaptive
              Quadrature -- Revisited" BIT, Vol. 40, (2000), pp.84-101
            - tol is a tolerance parameter that determines the overall accuracy of
              approximated integral.  We suggest a default value of 1e-10 for tol. 
    !*/

}

#endif // DLIB_INTEGRATE_FUNCTION_ADAPT_SIMPSON_ABSTRACTh_