Class inte_multi (o2scl)

O2scl : Class List

template<class func_t = multi_funct, class vec_t = boost::numeric::ublas::vector<double>>
class inte_multi

Multi-dimensional integration over a hypercube [abstract base].

Multi-dimensional integration over a region defined by constant limits. For more general regions of integration, use children of the class inte_gen.

Todo

In class inte_multi, the function integ_err() this class could now be made a child of the class inte in the future.

Subclassed by o2scl::mcarlo< multi_funct, boost::numeric::ublas::vector< double >, rng<> >, o2scl::mcarlo< func_t, vec_t, rng_t >

Public Functions

inline inte_multi()
inline virtual ~inte_multi()
inline virtual double minteg(func_t &func, size_t ndim, const vec_t &a, const vec_t &b)

Integrate function func over the hypercube from \( x_i=a_i \) to \( x_i=b_i \) for \( 0<i< \) ndim-1.

virtual int minteg_err(func_t &func, size_t ndim, const vec_t &a, const vec_t &b, double &res, double &err) = 0

Integrate function func over the hypercube from \( x_i=a_i \) to \( x_i=b_i \) for \( 0<i< \) ndim-1.

template<class func2_t>
inline int integ_err(func2_t &f, double a, double b, double &res, double &err)

Integration function f from a to b.

(Note this is a template and thus cannot be virtual)

inline double get_error()

Return the error in the result from the last call to minteg() or minteg_err()

This will quietly return zero if no integrations have been performed.

inline const char *type()

Return string denoting type (“inte_multi”)

Public Members

bool err_nonconv

If true, call the error handler if the routine does not “converge”.

int verbose

Verbosity.

double tol_rel

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

Protected Functions

template<class func2_t>
inline double oned_wrapper(size_t ndim, const vec_t &x, func2_t *f)

A wrapper for integ_err()

Protected Attributes

double interror

The uncertainty for the last integration computation.