Skip to content

A C++ port of the adaptive quadrature algorithm by Gander and Gautschi.

License

Notifications You must be signed in to change notification settings

nblinov/Adaptive-Integrator

Repository files navigation

Gauss-Lobatto Adaptive Integrator

A C++ port of the adaptive quadrature algorithm by Gander and Gautschi. The same algorithm is implemented in Numerical Recipes, but their license is very restrictive. I translated the code from the original paper so it can be used freely, as outlined in the MIT License.

Usage

A sample example file,example.cpp, is provided. Simply include the header AdaptiveIntegrator.hpp in your code:

    #include "AdaptiveIntegrator.hpp"

Then create an integrator object specialized for the type of functional you wish to integrate. In the simplest case this is just a normal function with signature double(const double), so the declaration looks like

    AdaptiveIntegrator<double(const double)> test

Finally to integrate your function, func, invoke the integrate method with integral bounds a and b and desired tolerance tol:

    test.integrate(func, a, b, tol)

About

A C++ port of the adaptive quadrature algorithm by Gander and Gautschi.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages