comp_gen_inte Class Template Reference

#include <comp_gen_inte.h>

Inheritance diagram for comp_gen_inte:

gen_inte

Detailed Description

template<class param_t, class func_t, class lfunc_t = func_t, class ufunc_t = func_t, class vec_t = ovector_view, class alloc_vec_t = ovector, class alloc_t = ovector_alloc>
class comp_gen_inte< param_t, func_t, lfunc_t, ufunc_t, vec_t, alloc_vec_t, alloc_t >

Naive generalized multi-dimensional integration.

Naively combine several one-dimensional integration objects from class inte in order to perform a multi-dimensional integration. The integration routines are specified in the function set_ptrs().

The integration routines are called in order of their specification in the list inte **ip. For the example of a two-dimensional integration ip[0] is called first with limits a[0] and b[0] and performs the integral of the integral given by ip[1] of the function from a[1] to b[1], both of which may depend explicitly on x[0]. The integral performed is:

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

See the discussion about the functions func, lower and upper in the documentation for the class gen_inte.

Definition at line 66 of file comp_gen_inte.h.


Public Member Functions

 comp_gen_inte ()
virtual ~comp_gen_inte ()
int set_ptrs (inte< od_parms, funct< od_parms > > **ip, int n)
 Designate the pointers to the integration routines.
virtual double ginteg (func_t &func, size_t n, func_t &lower, func_t &upper, param_t &pa)
 Integrate function func from $ {\ell}_i=f_i(x_i) $ to $ u_i=g_i(x_i) $ for $ 0<i<\mathrm{n}-1 $.
virtual const char * type ()
 Return string denoting type ("comp_gen_inte").

Protected Member Functions

double odfunc (double x, od_parms &od)
 The one-dimensional integration function.

Protected Attributes

alloc_t ao
 Memory allocator for objects of type alloc_vec_t.
funct_mfptr_noerr
< comp_gen_inte
< param_t, func_t,
lfunc_t, ufunc_t,
vec_t, alloc_vec_t,
alloc_t >, od_parms > * 
fmn
 The function to send to the integrators.
size_t ndim
 The number of dimensions.
inte< od_parms,
funct< od_parms > > ** 
ptrs
 Pointers to the integration objects.
bool ptrs_set
 True if the integration objects have been specified.

Data Structures

struct  od_parms
 Parameters to send to the 1-d integration functions. More...

Member Function Documentation

int set_ptrs ( inte< od_parms, funct< od_parms > > **  ip,
int  n 
) [inline]

Designate the pointers to the integration routines.

The user can, in principle, specify the one instance of an inte object for several of the pointers, but this is discouraged as most inte objects cannot be used this way. This function will not warn you if some of the pointers specified in ip refer to the same object.

If more 1-d integration routines than necessary are given, the extras will be unused.

Definition at line 123 of file comp_gen_inte.h.


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

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page