All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
o2scl::inte_multi_comp< func_t, vec_t > Class Template Reference

Naive multi-dimensional integration over a hypercube. More...

Detailed Description

template<class func_t = multi_funct11, class vec_t = boost::numeric::ublas::vector<double>>
class o2scl::inte_multi_comp< func_t, vec_t >

Naively combine several one-dimensional integration objects from class inte in order to perform a multi-dimensional integration over a region defined by constant limits. For more general regions of integration, use children of the class inte_gen.

The 1-dimensional integration routines are specified in the function set_oned_inte().

The integration routines are called in order of the index specified in the function set_oned_inte(). For n-dimensional integration, n one-dimensional integration objects should be specified, with indexes 0 through n-1. The integration routines are called in order of their index, so that the outermost integration is done by the routine specified with index 0.

\[ \int_{x_0=a_0}^{x_0=b_0} \int_{x_1=a_1}^{x_1=b_1} ... \int_{x_{\mathrm{n}-1}=a_{\mathrm{n}-1}}^ {x_{\mathrm{n}-1}=b_{\mathrm{n}-1}} f(x_0,x_1,...,x_{\mathrm{n}}) \]

No error estimate is performed. Error estimation for multiple dimension integrals is provided by the Monte Carlo integration classes (see o2scl::mcarlo).

Idea for Future:

Create a function to set an entire array of one-dimensional integration objects at once?

Convert the inte<funct> ** to a std::vector<inte<funct> *>

Definition at line 74 of file inte_multi_comp.h.

#include <inte_multi_comp.h>

Inheritance diagram for o2scl::inte_multi_comp< func_t, vec_t >:
o2scl::inte_multi< func_t, vec_t >

Public Member Functions

int set_oned_inte (inte<> &it, size_t i)
 Set the one-dimensional integration object with index i.
 
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 $ x_i=a_i $ to $ x_i=b_i $ for $ 0<i< $ ndim-1. More...
 
virtual const char * type ()
 Return string denoting type ("inte_multi_comp")
 
- Public Member Functions inherited from o2scl::inte_multi< func_t, vec_t >
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. More...
 
double get_error ()
 Return the error in the result from the last call to minteg() or minteg_err() More...
 
const char * type ()
 Return string denoting type ("inte_multi")
 

Data Fields

size_t max_dim
 The maxiumum number of integration dimensions (default 100)
 
- Data Fields inherited from o2scl::inte_multi< func_t, vec_t >
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 Member Functions

double odfunc (double x, size_t &ix)
 The one-dimensional integration function. More...
 

Protected Attributes

const vec_t * ax
 The user-specified upper limits.
 
const vec_t * bx
 The user-specified lower limits.
 
vec_t * cx
 The independent variable vector.
 
func_t * mf
 The user-specified function.
 
size_t ndim
 The user-specified number of dimensions.
 
size_t nint
 The size of the integration object arrays.
 
inte ** iptrs
 Pointers to the integration objects.
 
bool * tptrs
 Flag indicating if integration object has been set.
 
- Protected Attributes inherited from o2scl::inte_multi< func_t, vec_t >
double interror
 The uncertainty for the last integration computation.
 

Member Function Documentation

template<class func_t = multi_funct11, class vec_t = boost::numeric::ublas::vector<double>>
virtual int o2scl::inte_multi_comp< func_t, vec_t >::minteg_err ( func_t &  func,
size_t  n,
const vec_t &  a,
const vec_t &  b,
double &  res,
double &  err 
)
inlinevirtual

The function set_oned_inte() must be used first to set the one-dimensional routines to use.

Implements o2scl::inte_multi< func_t, vec_t >.

Definition at line 159 of file inte_multi_comp.h.

template<class func_t = multi_funct11, class vec_t = boost::numeric::ublas::vector<double>>
double o2scl::inte_multi_comp< func_t, vec_t >::odfunc ( double  x,
size_t &  ix 
)
inlineprotected

This function to send to the integrators

Definition at line 208 of file inte_multi_comp.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).
Hosted at Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads..