23#ifndef quantlib_exp_sinh_integral_hpp
24#define quantlib_exp_sinh_integral_hpp
30#if BOOST_VERSION >= 106900
31#define QL_BOOST_HAS_EXP_SINH
33#include <boost/math/quadrature/exp_sinh.hpp>
41 class ExpSinhIntegral :
public Integrator {
44 Real relTolerance = std::sqrt(std::numeric_limits<Real>::epsilon()),
45 Size maxRefinements = 9)
47 relTolerance_(relTolerance),
48 exp_sinh_(maxRefinements) {}
54 Real value = exp_sinh_.integrate(
56 relTolerance_, &error);
66 Real value = exp_sinh_.integrate(
71 a,
b, relTolerance_, &error);
78 const Real relTolerance_;
79 mutable boost::math::quadrature::exp_sinh<Real> exp_sinh_;
91 QL_FAIL(
"boost version 1.69 or higher is required in order to use ExpSinhIntegral");
95 QL_FAIL(
"boost version 1.69 or higher is required in order to use ExpSinhIntegral");
100 QL_FAIL(
"boost version 1.69 or higher is required in order to use ExpSinhIntegral");
Real integrate(const ext::function< Real(Real)> &f) const
ExpSinhIntegral(Real relTolerance=0, Size maxRefinements=0)
Real integrate(const ext::function< Real(Real)> &f, Real a, Real b) const override
Integrator(Real absoluteAccuracy, Size maxEvaluations)
void increaseNumberOfEvaluations(Size increase) const
void setAbsoluteError(Real error) const
void setNumberOfEvaluations(Size evaluations) const
template class providing a null value for a given type.
#define QL_FAIL(message)
throw an error (possibly with file and line information)
ext::function< Real(Real)> b
std::size_t Size
size of a container
Integrators base class definition.