Class inte_kronrod_boost (o2scl)

O2scl : Class List

template<size_t rule = 15>
class inte_kronrod_boost

Gauss-Kronrod multiprecision integration class (Boost)

Note

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

Public Functions

inline inte_kronrod_boost()
inline void set_max_depth(size_t md)

Set the maximum number of interval splittings (default 15)

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 fp_t integ(func_t &func, fp_t a, fp_t b)

Integrate function func from a to b.

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.

Public Members

double tol_rel_multip

The maximum relative uncertainty for multipreicsion integrals (default \( -1 \))

double pow_tol_func

Power for tolerance of function evaluations in multiprecision integrations (default 1.33)

double L1norm

L1 norm.

double tol_rel

The maximum relative uncertainty in the value of the integral (default \( 10^{-8} \))

double tol_abs

The maximum absolute uncertainty in the value of the integral (default \( 10^{-8} \))

int verbose

Verbosity parameter.

bool err_nonconv

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

Protected Types

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<25>> cpp_dec_float_25
typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<35>> cpp_dec_float_35
typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<50>> cpp_dec_float_50
typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<100>> cpp_dec_float_100

Protected Functions

template<typename func_t, class fp_t>
inline int integ_err_funct(func_t &f, 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.

This function is used by both integ_err() and integ_err_int() .

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, the internal wrapper which uses a funct_multip object.

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.

This function is used by integ_err_multip()

Protected Attributes

size_t max_depth

Maximum depth.