Class inte_hcubature (o2scl)¶
-
template<class func_t>
class o2scl::inte_hcubature : public o2scl::inte_cubature_base¶ Adaptive multidimensional integration on hyper-rectangles using cubature rules from the Cubature library.
This class is experimental.
Documentation adapted from Cubature
A cubature rule takes a function and a hypercube and evaluates the function at a small number of points, returning an estimate of the integral as well as an estimate of the error, and also a suggested dimension of the hypercube to subdivide.
Given such a rule, the adaptive integration is simple:
1) Evaluate the cubature rule on the hypercube(s). Stop if converged.
2) Pick the hypercube with the largest estimated error, and divide it in two along the suggested dimension.
3) Goto (1).
The basic algorithm is based on the adaptive cubature described in [Genz80] and subsequently extended to integrating a vector of integrands in [Berntsen91].
Binary heap implementation
Based on [Cormen09] and used as a priority queue of regions to integrate.
-
int use_parallel¶
Desc.
-
inline void heap_free(heap &h)¶
Note that heap_free does not deallocate anything referenced by the items.
-
inline int converged(size_t fdim, const std::vector<esterr> &ee, double reqAbsError, double reqRelError, error_norm norm)¶
Desc.
-
template<class vec_t>
inline int rulecubature(rule &r, size_t fdim, func_t &f, const hypercube &h, size_t maxEval, double reqAbsError, double reqRelError, error_norm norm, vec_t &val, vec_t &err, int parallel)¶ Desc.
-
template<class vec_t>
inline int cubature(size_t fdim, func_t &f, size_t dim, const vec_t &xmin, const vec_t &xmax, size_t maxEval, double reqAbsError, double reqRelError, error_norm norm, vec_t &val, vec_t &err, int parallel)¶ Desc.
-
inline inte_hcubature()¶
Public Types
Protected Functions
-
template<class vec_t>
inline void make_hypercube(size_t dim, const vec_t ¢er, const vec_t &halfwidth, hypercube &h)¶ Desc.
-
template<class vec_t>
inline void make_hypercube_range(size_t dim, const vec_t &xmin, const vec_t &xmax, hypercube &h)¶ Desc.
-
inline int eval_regions(size_t nR, std::vector<region> &R, func_t &f, rule &r)¶
Desc.
Note
All regions must have same fdim
-
inline size_t ls0(size_t n)¶
Functions to loop over points in a hypercube.
Based on orbitrule.cpp in HIntLib-0.0.10
ls0 returns the least-significant 0 bit of n (e.g. it returns 0 if the LSB is 0, it returns 1 if the 2 LSBs are 01, etcetera).
-
inline void evalR_Rfs2(ubvector &pts, size_t pts_ix, size_t dim, std::vector<double> &p, size_t p_ix, const std::vector<double> &c, size_t c_ix, const std::vector<double> &r, size_t r_ix)¶
Evaluate the integration points for all \( 2^n \) points (+/-r,…+/-r)
A Gray-code ordering is used to minimize the number of coordinate updates in p, although this doesn’t matter as much now that we are saving all pts.
-
inline void evalRR0_0fs2(ubvector &pts, size_t pts_ix, size_t dim, std::vector<double> &p, size_t p_ix, const std::vector<double> &c, size_t c_ix, const std::vector<double> &r, size_t r_ix)¶
Desc.
-
inline void evalR0_0fs4d2(ubvector &pts, size_t pts_ix, size_t dim, std::vector<double> &p, size_t p_ix, const std::vector<double> &c, size_t c_ix, const std::vector<double> &r1, size_t r1_ix, const std::vector<double> &r2, size_t r2_ix)¶
Desc.
-
inline size_t num0_0(size_t dim)¶
Desc.
-
inline size_t numR0_0fs(size_t dim)¶
Desc.
-
inline size_t numRR0_0fs(size_t dim)¶
Desc.
-
inline size_t numR_Rfs(size_t dim)¶
Desc.
-
inline int rule75genzmalik_evalError(rule &runder, size_t fdim, func_t &f, size_t nR, std::vector<region> &R)¶
Desc.
-
inline void make_rule75genzmalik(size_t dim, size_t fdim, rule75genzmalik &r)¶
Desc.
-
class heap¶
Desc.
-
class rule¶
Desc.
Subclassed by o2scl::inte_hcubature< func_t >::rule75genzmalik
-
class rule75genzmalik : public o2scl::inte_hcubature<func_t>::rule¶
Desc.
Based on
rule75genzmalik.cpp
in HIntLib-0.0.10: An embedded cubature rule of degree 7 (embedded rule degree 5) from [Genz83].Public Functions
-
inline rule75genzmalik()¶
-
inline rule75genzmalik(const rule75genzmalik &e)¶
-
inline rule75genzmalik &operator=(const rule75genzmalik &e)¶
-
inline rule75genzmalik()¶
-
int use_parallel¶