Class inte (o2scl)

O2scl : Class List

template<class func_t = funct, class fp_t = double>
class inte

Base integration class [abstract base].

Idea for Future:

It might be useful to have all of the integration classes report the number of function evaluations used in addition to the number of iterations which were taken.

Note

Currently supports only types double and, for some integration methods, long double for the floating point type fp_t . Also, the default values of tol_rel and tol_abs are designed for double precision and likely need to be decreased for long double precision integration.

Subclassed by o2scl::inte_gauss56_cern_base< funct, double >, o2scl::inte_gauss56_cern_base< funct_cdf25, boost::multiprecision::number< boost::multiprecision::cpp_dec_float< 25 > > >, o2scl::inte_gauss56_cern_base< funct_cdf35, boost::multiprecision::number< boost::multiprecision::cpp_dec_float< 35 > > >, o2scl::inte_gauss56_cern_base< funct_cdf50, boost::multiprecision::cpp_dec_float_50 >, o2scl::inte_gauss56_cern_base< funct_ld, long double >, o2scl::inte_gauss_cern< func_t, double >, o2scl::inte_kronrod_gsl< funct >, o2scl::inte_cauchy_cern< func_t, fp_t, weights_t >, o2scl::inte_gauss_cern< func_t, fp_t, weights_t >, o2scl::inte_qag_smooth< func_t >, o2scl::inte_qng_gsl< func_t >, o2scl::inte_transform< func_t, def_inte_t, fp_t >

Public Functions

inline inte()
inline virtual ~inte()
inline fp_t get_error()

Return the numerically estimated error in the result from the last call to integ()

This will quietly return zero if no integrations have been performed or if the integrator does not estimate the error.

inline virtual fp_t integ(func_t &func, fp_t a, fp_t b)

Integrate function func from a to b.

inline virtual fp_t integ_iu(func_t &func, fp_t a)

Integrate function func from a to \( \infty \) .

inline virtual fp_t integ_il(func_t &func, fp_t b)

Integrate function func from \( -\infty \) to b.

inline virtual fp_t integ_i(func_t &func)

Integrate function func from \( -\infty \) to \( \infty \) .

inline virtual 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.

inline virtual int integ_iu_err(func_t &func, fp_t a, fp_t &res, fp_t &err)

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

inline virtual int integ_il_err(func_t &func, fp_t b, fp_t &res, fp_t &err)

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

inline virtual int integ_i_err(func_t &func, fp_t &res, fp_t &err)

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

inline virtual const char *type()

Return string denoting type (“inte”)

Public Members

int verbose

Verbosity.

size_t last_iter

The most recent number of iterations taken.

fp_t tol_rel

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

fp_t tol_abs

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

bool err_nonconv

If true, call the error handler if the routine does not converge or reach the desired tolerance (default true)

If this is false, the function proceeds normally and may provide convergence information in the integer return value.

Protected Attributes

fp_t interror

The uncertainty for the last integration computation.