Class inte_double_exp_boost (o2scl)

O2scl : Class List

template<class fp_25_t = o2fp_25, class fp_35_t = o2fp_35, class fp_50_t = o2fp_50, class fp_100_t = o2fp_100>
class inte_double_exp_boost

Double exponential integration class with multiprecision (Boost)

This class uses tanh_sinh for finite intervals, exp_sinh for half-infinite integration limits, and sinh_sinh for infinite integration limits.

If the default value of tol_rel is used, then this class uses the square root of numeric_limits::epsilon for the relative tolerance. For double precision numbers, this tolerance is usually about \( 10^{-8} \). If the final uncertainty exceeds this value, then the error handler is called, unless err_nonconv is false. Internally, the boost integration function is called with a tolerance which is a factor of 10 smaller, because this is often necessary to ensure convergence.

The multiprecision integration functions require a template function input, and their default tolerance is given by \( 10^{-d} \) where \( d \) is numeric_limits::digits10 .

Note

The uncertainties reported by this class depend on those returned by the boost integration object and are occasionally be underestimated.

Note

The default maximum refinement level may be insufficient, especially for high-precision types or multiprecision integration, and can be changed with set_max_refine().

Warning

For sufficiently difficult integrands, the multiprecision integration functions may take a very long time to complete.

Internal functions and data [protected]

size_t max_refine

Maximum refinement level.

template<typename func_t, class fp_t>
inline int integ_err_funct(func_t &&func, fp_t a, fp_t b, fp_t &res, fp_t &err, fp_t &L1norm_loc, double target_tol, double integ_tol)

Internal integration wrapper of the boost function which stores the L1 norm and tests if the uncertainty is sufficiently small.

template<typename func_t, class fp_t>
inline int integ_iu_err_funct(func_t &&func, fp_t a, fp_t &res, fp_t &err, fp_t &L1norm_loc, double target_tol, double integ_tol)

Internal integration wrapper of the boost function which stores the L1 norm and tests if the uncertainty is sufficiently small.

template<typename func_t, class fp_t>
inline int integ_il_err_funct(func_t &&func, fp_t b, fp_t &res, fp_t &err, fp_t &L1norm_loc, double target_tol, double integ_tol)

Internal integration wrapper of the boost function which stores the L1 norm and tests if the uncertainty is sufficiently small.

template<typename func_t, class fp_t>
inline int integ_i_err_funct(func_t &&func, fp_t &res, fp_t &err, fp_t &L1norm_loc, double target_tol, double integ_tol)

Internal integration wrapper of the boost function which stores the L1 norm and tests if the uncertainty is sufficiently small.

template<typename func_t, class fp_t>
inline int integ_err_int(func_t &&func, fp_t a, fp_t b, fp_t &res, fp_t &err, fp_t &L1norm_loc, double target_tol, double integ_tol, double func_tol)

Integrate function func from a to b and place the result in res and the error in err.

There are three tolerances:

  • target_tol is the target tolerance which is sent to the boost integration function. The error value returned by the boost integration function is often larger than this

  • integ_tol is the desired final tolerance of the integration. This function regards the integration as a failure if the error value is larger than integ_tol

  • func_tol is the tolerance for evaluations of the integrand. This value is passed to o2scl::funct_multip.

template<typename func_t, class fp_t>
inline int integ_iu_err_int(func_t &&func, fp_t a, fp_t &res, fp_t &err, fp_t &L1norm_loc, double target_tol, double integ_tol, double func_tol)

Integrate function func from a to \( \infty \) and place the result in res and the error in err.

There are three tolerances:

  • target_tol is the target tolerance which is sent to the boost integration function. The error value returned by the boost integration function is often larger than this

  • integ_tol is the desired final tolerance of the integration. This function regards the integration as a failure if the error value is larger than integ_tol

  • func_tol is the tolerance for evaluations of the integrand. This value is passed to o2scl::funct_multip.

template<typename func_t, class fp_t>
inline int integ_il_err_int(func_t &&func, fp_t b, fp_t &res, fp_t &err, fp_t &L1norm_loc, double target_tol, double integ_tol, double func_tol)

Integrate function func from a to \( \infty \) and place the result in res and the error in err.

There are three tolerances:

  • target_tol is the target tolerance which is sent to the boost integration function. The error value returned by the boost integration function is often larger than this

  • integ_tol is the desired final tolerance of the integration. This function regards the integration as a failure if the error value is larger than integ_tol

  • func_tol is the tolerance for evaluations of the integrand. This value is passed to o2scl::funct_multip.

template<typename func_t, class fp_t>
inline int integ_i_err_int(func_t &&func, fp_t &res, fp_t &err, fp_t &L1norm_loc, double target_tol, double integ_tol, double func_tol)

Integrate function func from a to \( \infty \) and place the result in res and the error in err.

There are three tolerances:

  • target_tol is the target tolerance which is sent to the boost integration function. The error value returned by the boost integration function is often larger than this

  • integ_tol is the desired final tolerance of the integration. This function regards the integration as a failure if the error value is larger than integ_tol

  • func_tol is the tolerance for evaluations of the integrand. This value is passed to o2scl::funct_multip.

Integration settings

double tol_rel

The maximum relative uncertainty in the value of the integral (default \( -1 \))

double tol_abs

The maximum absolute uncertainty in the value of the integral (default \( -1 \))

\note This value is unused by this integrator, but this
is included for compatibility with the other integrators.
double pow_tol_func

Power for tolerance of function evaluations (default 1.33)

int verbose

Verbosity parameter.

bool err_nonconv

If true, call the error handler if the integration does not succeed (default true)

inline void set_max_refine(size_t mr)

Set the maximum refinement level (default 15)

Integration output quantities

double L1norm

\( L_1 \) norm from the last integration

size_t levels

Number of refinement levels in last integral computed.

Constructor

inline inte_double_exp_boost()

Integration functions

template<typename func_t, class fp_t>
inline int integ_err(func_t &func, fp_t a, fp_t b, fp_t &res, fp_t &err)

Integrate function func from a to b and place the result in res and the error in err.

template<typename func_t, class fp_t>
inline int integ_iu_err(func_t &func, fp_t a, fp_t &res, fp_t &err)

Integrate function func from a to b and place the result in res and the error in err.

template<typename func_t, class fp_t>
inline int integ_il_err(func_t &func, fp_t b, fp_t &res, fp_t &err)

Integrate function func from a to b and place the result in res and the error in err.

template<typename func_t, class fp_t>
inline int integ_i_err(func_t &func, fp_t &res, fp_t &err)

Integrate function func from a to b and place the result in res and the error in err.

Multiprecision integration functions

template<typename func_t, class fp_t>
inline int integ_err_multip(func_t &&func, fp_t a, fp_t b, fp_t &res, fp_t &err, double integ_tol = -1.0)

Integrate function func from a to b using multipreicsion, placing the result in res and the error in err.

template<typename func_t, class fp_t>
inline int integ_iu_err_multip(func_t &&func, fp_t a, fp_t &res, fp_t &err, double integ_tol = -1.0)

Integrate function func from a to \( \infty \) using multipreicsion, placing the result in res and the error in err.

template<typename func_t, class fp_t>
inline int integ_il_err_multip(func_t &&func, fp_t b, fp_t &res, fp_t &err, double integ_tol = -1.0)

Integrate function func from \( -\infty \) to b using multipreicsion, placing the result in res and the error in err.

template<typename func_t, class fp_t>
inline int integ_i_err_multip(func_t &&func, fp_t &res, fp_t &err, double integ_tol = -1.0)

Integrate function func from \( -\infty \) to \( \infty \) using multipreicsion, placing the result in res and the error in err.