OscatsIntegrate

OscatsIntegrate — Multivariate Integration

Synopsis

gdouble             (*OscatsIntegrateFunction)          (const GGslVector *x,
                                                         gpointer data);
struct              OscatsIntegrate;
void                oscats_integrate_set_tol            (OscatsIntegrate *integrator,
                                                         gdouble tol);
void                oscats_integrate_set_c_function     (OscatsIntegrate *integrator,
                                                         guint dims,
                                                         OscatsIntegrateFunction f);
gdouble             oscats_integrate_cube               (OscatsIntegrate *integrator,
                                                         GGslVector *mu,
                                                         gdouble delta,
                                                         gpointer data);
gdouble             oscats_integrate_box                (OscatsIntegrate *integrator,
                                                         GGslVector *min,
                                                         GGslVector *max,
                                                         gpointer data);
gdouble             oscats_integrate_ellipse            (OscatsIntegrate *integrator,
                                                         GGslVector *mu,
                                                         GGslMatrix *Sigma,
                                                         gdouble c,
                                                         gpointer data);
gdouble             oscats_integrate_space              (OscatsIntegrate *integrator,
                                                         gpointer data);
void                oscats_integrate_link_point         (OscatsIntegrate *integrator,
                                                         OscatsPoint *point);

Object Hierarchy

  GObject
   +----OscatsIntegrate

Description

Details

OscatsIntegrateFunction ()

gdouble             (*OscatsIntegrateFunction)          (const GGslVector *x,
                                                         gpointer data);


struct OscatsIntegrate

struct OscatsIntegrate;


oscats_integrate_set_tol ()

void                oscats_integrate_set_tol            (OscatsIntegrate *integrator,
                                                         gdouble tol);

Sets the integration tolerance. The default is 1e-6.

integrator :

an OscatsIntegrate

tol :

a tolerance level

oscats_integrate_set_c_function ()

void                oscats_integrate_set_c_function     (OscatsIntegrate *integrator,
                                                         guint dims,
                                                         OscatsIntegrateFunction f);

Sets the function to integrate.

integrator :

an OscatsIntegrate

dims :

the dimension of the function

f :

the function to integrate

oscats_integrate_cube ()

gdouble             oscats_integrate_cube               (OscatsIntegrate *integrator,
                                                         GGslVector *mu,
                                                         gdouble delta,
                                                         gpointer data);

Integrates the set function over [mu-delta, mu+delta].

integrator :

an OscatsIntegrate object with function set

mu :

a vector indicating the center of the cube (or NULL for the origin)

delta :

the half-width of the cube

data :

parameters for the function (or NULL)

Returns :

the value of the integral

oscats_integrate_box ()

gdouble             oscats_integrate_box                (OscatsIntegrate *integrator,
                                                         GGslVector *min,
                                                         GGslVector *max,
                                                         gpointer data);

Integrates the set function over [min, max]

integrator :

an OscatsIntegrate object with function set

min :

the lower bounds

max :

the upper bounds

data :

parameters for the function (or NULL)

Returns :

the value of the integral

oscats_integrate_ellipse ()

gdouble             oscats_integrate_ellipse            (OscatsIntegrate *integrator,
                                                         GGslVector *mu,
                                                         GGslMatrix *Sigma,
                                                         gdouble c,
                                                         gpointer data);

Integrates the set function over the ellipse defined by: (x-mu)' Sigma^-1 (x-mu) <= c.

This is accomplished by transformation of variables: x = Bz + mu, where B is the Cholesky decomposition of Sigma: c Sigma = BB'. The integration is then performed over the sphere ||z||^2 <= 1. Note that Sigma must be symmetric and positive definite.

integrator :

an OscatsIntegrate object with function set

mu :

the center of the ellipse (or NULL for the origin)

Sigma :

the orientation and shape of the ellipse (or NULL for a sphere)

c :

the dilation size of the ellipse (> 0)

data :

parameters for the function (or NULL)

Returns :

the value of the integral

oscats_integrate_space ()

gdouble             oscats_integrate_space              (OscatsIntegrate *integrator,
                                                         gpointer data);

Integrates the set function over the whole space R^n.

integrator :

an OscatsIntegrate object with function set

data :

parameters for the function (or NULL)

Returns :

the value of the integral

oscats_integrate_link_point ()

void                oscats_integrate_link_point         (OscatsIntegrate *integrator,
                                                         OscatsPoint *point);

Links the internal integration variable used by integrator with the continuous dimensions of point so that when the integration variable is changed, point is moved as well. The continuous dimension of point must be the same as the integration dimensions.

integrator :

an OscatsIntegrate object with function already set

point :

an OscatsPoint to link