26 #ifndef O2SCL_INTE_MULTI_COMP_H
27 #define O2SCL_INTE_MULTI_COMP_H
31 #include <o2scl/inte_multi.h>
32 #include <o2scl/inte.h>
33 #include <o2scl/funct.h>
34 #include <o2scl/multi_funct.h>
36 #ifndef DOXYGEN_NO_O2NS
76 #ifndef DOXYGEN_INTERNAL
113 O2SCL_ERR(
"Index >= max_dim in inte_multi_comp::set_oned_inte().",
124 }
else if (i>
nint-1) {
130 bool *tptrs_new=
new bool[nint_new];
132 for(
size_t j=0;j<
nint;j++) {
133 iptrs_new[j]=
iptrs[j];
134 tptrs_new[j]=
tptrs[j];
159 virtual int minteg_err(func_t &func,
size_t n,
const vec_t &a,
160 const vec_t &b,
double &res,
double &err) {
164 bool enough_oned=
true;
165 if (n>
nint) enough_oned=
false;
166 for(
size_t i=0;i<n;i++) {
167 if (
tptrs[i]==
false) enough_oned=
false;
170 if (enough_oned==
false) {
171 O2SCL_ERR(
"Too few objects specified with set_ptrs() in minteg().",
187 std::bind(std::mem_fn<
double(
double,
size_t &)>
189 this,std::placeholders::_1,ix);
198 virtual const char *
type() {
return "inte_multi_comp"; }
205 #ifndef DOXYGEN_INTERNAL
214 res=(*mf)(
ndim,(*cx));
220 std::bind(std::mem_fn<
double(
double,
size_t &)>
222 this,std::placeholders::_1,ix_next);
242 #ifndef DOXYGEN_NO_O2NS
virtual const char * type()
Return string denoting type ("inte_multi_comp")
size_t nint
The size of the integration object arrays.
double odfunc(double x, size_t &ix)
The one-dimensional integration function.
std::function< double(double)> funct11
One-dimensional function typedef.
int set_oned_inte(inte<> &it, size_t i)
Set the one-dimensional integration object with index i.
invalid argument supplied by user
vec_t * cx
The independent variable vector.
const vec_t * ax
The user-specified upper limits.
size_t max_dim
The maxiumum number of integration dimensions (default 100)
virtual double integ(func_t &func, double a, double b)
Integrate function func from a to b.
bool * tptrs
Flag indicating if integration object has been set.
Base integration class [abstract base].
const vec_t * bx
The user-specified lower limits.
Multi-dimensional integration over a hypercube [abstract base].
inte ** iptrs
Pointers to the integration objects.
#define O2SCL_ERR(d, n)
Set an error with message d and code n.
size_t ndim
The user-specified number of dimensions.
virtual int minteg_err(func_t &func, size_t n, const vec_t &a, const vec_t &b, double &res, double &err)
Integrate function func over the hypercube from to for ndim-1.
func_t * mf
The user-specified function.
std::function< double(size_t, const boost::numeric::ublas::vector< double > &)> multi_funct11
Multi-dimensional function typedef.
Naive multi-dimensional integration over a hypercube.