Top | ![]() |
![]() |
![]() |
![]() |
Functions
void | (*NcmIntegralNDF) () |
void | (*NcmIntegralNDGetDimensions) () |
NcmIntegralND * | ncm_integral_nd_ref () |
void | ncm_integral_nd_free () |
void | ncm_integral_nd_clear () |
void | ncm_integral_nd_set_method () |
void | ncm_integral_nd_set_error () |
void | ncm_integral_nd_set_maxeval () |
void | ncm_integral_nd_set_reltol () |
void | ncm_integral_nd_set_abstol () |
NcmIntegralNDMethod | ncm_integral_nd_get_method () |
NcmIntegralNDError | ncm_integral_nd_get_error () |
guint | ncm_integral_nd_get_maxeval () |
gdouble | ncm_integral_nd_get_reltol () |
gdouble | ncm_integral_nd_get_abstol () |
void | ncm_integral_nd_eval () |
Properties
double | abstol | Read / Write / Construct |
NcmIntegralNDError | error | Read / Write / Construct |
guint | maxeval | Read / Write / Construct |
NcmIntegralNDMethod | method | Read / Write / Construct |
double | reltol | Read / Write / Construct |
Types and Values
enum | NcmIntegralNDMethod |
enum | NcmIntegralNDError |
#define | NCM_INTEGRAL_ND_DEFAULT_RELTOL |
#define | NCM_INTEGRAL_ND_DEFAULT_ABSTOL |
Description
This object is used to perform n-dimensional integration of a function using different methods.
The integration can be performed using the cubature library. The cubature library is a library for adaptive multidimensional integration. The original code can be found at https://github.com/stevengj/cubature .
Functions
NcmIntegralNDF ()
void (*NcmIntegralNDF) (NcmIntegralND *intnd
,NcmVector *x
,guint dim
,guint npoints
,guint fdim
,NcmVector *fval
);
The type of the function that must be implemented by a subclass of NcmIntegralND.
This function receives npoints
points in the array x
(size dim
* npoints
), and
returns an array (size fdim
* npoints
) of npoints
values of the integrand at all
points in x
. The x
is an array of doubles in row-major order
(i.e. the first dim
elements of x
are the coordinates of the first point, the next
dim
elements are the coordinates of the second point, and so on). The return value
is an array of fdim
values of the integrand at all points in x
(e.g. the first
fdim
elements are the values of the integrand at the first point, the next fdim
elements are the values of the integrand at the second point, and so on).
Parameters
NcmIntegralNDGetDimensions ()
void (*NcmIntegralNDGetDimensions) (NcmIntegralND *intnd
,guint *dim
,guint *fdim
);
The type of the function that must be implemented by a subclass of NcmIntegralND.
This function returns the dimension of the integral argument and the dimension of the function to be integrated.
ncm_integral_nd_ref ()
NcmIntegralND *
ncm_integral_nd_ref (NcmIntegralND *intnd
);
Increases the reference count of intnd
by one.
ncm_integral_nd_free ()
void
ncm_integral_nd_free (NcmIntegralND *intnd
);
Decreases the reference count of intnd
by one.
ncm_integral_nd_clear ()
void
ncm_integral_nd_clear (NcmIntegralND **intnd
);
If *intnd
is different from NULL, decreases the reference
count of *intnd
by one and sets *intnd
to NULL.
ncm_integral_nd_set_method ()
void ncm_integral_nd_set_method (NcmIntegralND *intnd
,NcmIntegralNDMethod method
);
Sets the integration method to use.
ncm_integral_nd_set_error ()
void ncm_integral_nd_set_error (NcmIntegralND *intnd
,NcmIntegralNDError error
);
Sets the error measure to use.
ncm_integral_nd_set_maxeval ()
void ncm_integral_nd_set_maxeval (NcmIntegralND *intnd
,guint maxeval
);
Sets the maximum number of function evaluations to use. Zero means unlimited.
ncm_integral_nd_set_reltol ()
void ncm_integral_nd_set_reltol (NcmIntegralND *intnd
,gdouble reltol
);
Sets the relative tolerance reltol
to use.
ncm_integral_nd_set_abstol ()
void ncm_integral_nd_set_abstol (NcmIntegralND *intnd
,gdouble abstol
);
Sets the absolute tolerance reltol
to use.
ncm_integral_nd_get_method ()
NcmIntegralNDMethod
ncm_integral_nd_get_method (NcmIntegralND *intnd
);
ncm_integral_nd_eval ()
void ncm_integral_nd_eval (NcmIntegralND *intnd
,const NcmVector *xi
,const NcmVector *xf
,NcmVector *res
,NcmVector *err
);
Evaluated the integral $I_F(x_i, x_f) = \int_{x_i}^{x_f}F(x)\mathrm{d}x$.
Types and Values
enum NcmIntegralNDMethod
The type of the method used to perform the integral.
Members
adapative integration by partitioning the integration domain ("h-adaptive") and using the same fixed-degree quadrature in each subdomain, recursively, until convergence is achieved. |
||
adaptive integration by increasing the degree of (tensor-product Clenshaw-Curtis) quadrature rules ("p-adaptive"), rather than subdividing the domain ("h-adaptive"). Possibly better for smooth integrands in low dimensions. |
||
same as |
||
same as |
enum NcmIntegralNDError
The type of the error estimation used to perform the integral.
Members
error is estimated for each integrand separately |
||
error is estimated for each pair of integrands |
||
error is estimated for the L2 norm of the vector of integrands |
||
error is estimated for the L1 norm of the vector of integrands |
||
error is estimated for the L-infinity norm of the vector of integrands |
Property Details
The “abstol”
property
“abstol” double
Integral absolute tolerance.
Owner: NcmIntegralND
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 0
The “error”
property
“error” NcmIntegralNDError
Error measure.
Owner: NcmIntegralND
Flags: Read / Write / Construct
Default value: NCM_INTEGRAL_ND_ERROR_INDIVIDUAL
The “maxeval”
property
“maxeval” guint
Maximum number of function evaluations (0 means unlimited).
Owner: NcmIntegralND
Flags: Read / Write / Construct
Default value: 0
The “method”
property
“method” NcmIntegralNDMethod
Integration method.
Owner: NcmIntegralND
Flags: Read / Write / Construct
Default value: NCM_INTEGRAL_ND_METHOD_CUBATURE_H