Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

sinh_sinh

template<class Real>
class sinh_sinh
{
public:
    sinh_sinh(size_t max_refinements = 9);

    template<class F>
    Real integrate(const F f,
                   Real tol = sqrt(std::numeric_limits<Real>::epsilon()),
                   Real* error = nullptr,
                   Real* L1 = nullptr,
                   size_t* levels = nullptr) const;
};

The sinh-sinh quadrature allows computation over the entire real line, and is called as follows:

sinh_sinh<double> integrator;
auto f = [](double x) { return exp(-x*x); };
double error;
double L1;
double Q = integrator.integrate(f, &error, &L1);

Note that the limits of integration are understood to be (-∞, ∞).


PrevUpHomeNext