![]() |
![]() |
![]() |
NumCosmo Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
Synopsis
#define NC_INT_ABS_ERROR #define NC_INT_ALG #define NC_INT_ERROR #define NC_INT_PARTITION struct NcIntegralFixed; struct NcIntegrand2dim; gint nc_integral_cached_0_x (NcFunctionCache *cache
,gsl_function *F
,gdouble x
,gdouble *result
,gdouble *error
); gint nc_integral_cached_x_inf (NcFunctionCache *cache
,gsl_function *F
,gdouble x
,gdouble *result
,gdouble *error
); void nc_integral_fixed_calc_nodes (NcIntegralFixed *intf
,gsl_function *F
); void nc_integral_fixed_free (NcIntegralFixed *intf
); gdouble nc_integral_fixed_integ_mult (NcIntegralFixed *intf
,gsl_function *F
); gdouble nc_integral_fixed_integ_posdef_mult (NcIntegralFixed *intf
,gsl_function *F
,gdouble max
,gdouble reltol
); NcIntegralFixed * nc_integral_fixed_new (gulong n_nodes
,gulong rule_n
,gdouble xl
,gdouble xu
); gdouble nc_integral_fixed_nodes_eval (NcIntegralFixed *intf
); gsl_integration_workspace ** nc_integral_get_workspace (); gint nc_integral_locked_a_b (gsl_function *F
,gdouble a
,gdouble b
,gdouble abstol
,gdouble reltol
,gdouble *result
,gdouble *error
); gint nc_integral_locked_a_inf (gsl_function *F
,gdouble a
,gdouble abstol
,gdouble reltol
,gdouble *result
,gdouble *error
); gboolean ncm_integrate_2dim (NcIntegrand2dim *integ
,gdouble xi
,gdouble yi
,gdouble xf
,gdouble yf
,gdouble epsrel
,gdouble epsabs
,gdouble *result
,gdouble *error
);
Details
nc_integral_cached_0_x ()
gint nc_integral_cached_0_x (NcFunctionCache *cache
,gsl_function *F
,gdouble x
,gdouble *result
,gdouble *error
);
This function searchs for the nearest x_near value previously chosed as the upper integration limit and perform the integration at [x_near, x] interval. This result is summed to that obtained at [0, x_near] and then it is saved in the cache.
|
a pointer to NcFunctionCache. |
|
a gsl_function wich is the integrand. |
|
upper integration limit. |
|
a pointer to a gdouble in which the function stores the result. |
|
a pointer to a gdouble in which the function stores the estimated error. |
Returns : |
the error code returned by gsl_integration_qag. |
nc_integral_cached_x_inf ()
gint nc_integral_cached_x_inf (NcFunctionCache *cache
,gsl_function *F
,gdouble x
,gdouble *result
,gdouble *error
);
This function searchs for the nearest x_near value previously chosed as the lower integration limit and perform the integration at \f$ [x, x_{near}] \f$ interval. This result is summed to that obtained at \f$ [x_{near}, \infty] \f$ and then it is saved in the cache.
|
a pointer to NcFunctionCache. |
|
a gsl_function wich is the integrand. |
|
lower integration limit. |
|
a pointer to a gdouble in which the function stores the result. |
|
a pointer to a gdouble in which the function stores the estimated error. |
Returns : |
the error code returned by gsl_integration_qagiu. |
nc_integral_fixed_calc_nodes ()
void nc_integral_fixed_calc_nodes (NcIntegralFixed *intf
,gsl_function *F
);
This function FIXME
|
a pointer to NcIntegralFixed. |
|
a pointer to a gsl_function. |
nc_integral_fixed_free ()
void nc_integral_fixed_free (NcIntegralFixed *intf
);
This function frees the memory associated to NcIntegralFixed.
|
a pointer to NcIntegralFixed. |
nc_integral_fixed_integ_mult ()
gdouble nc_integral_fixed_integ_mult (NcIntegralFixed *intf
,gsl_function *F
);
This function
|
a pointer to NcIntegralFixed. |
|
a pointer to gsl_function. |
Returns : |
FIXME |
nc_integral_fixed_integ_posdef_mult ()
gdouble nc_integral_fixed_integ_posdef_mult (NcIntegralFixed *intf
,gsl_function *F
,gdouble max
,gdouble reltol
);
This function
|
a pointer to NcIntegralFixed. |
|
a pointer to gsl_function. |
|
FIXME |
|
FIXME |
Returns : |
FIXME |
nc_integral_fixed_new ()
NcIntegralFixed * nc_integral_fixed_new (gulong n_nodes
,gulong rule_n
,gdouble xl
,gdouble xu
);
This function prepares the NcIntegralFixed with a grid with n_nodes - 1 intervals beteween xl and xu. In each interval it uses a fixed order (rule_n) Gauss-Legendre integration rule to determine the interval inner points. This results in a grid with (n_nodes - 1) * rule_n points.
|
number of nodes in the full interval. |
|
order of the Gauss-Legendre integration rule to be applied in each interval. |
|
the interval lower limit. |
|
the interval upper limit. |
Returns : |
a pointer to the newly created NcIntegralFixed structure. |
nc_integral_fixed_nodes_eval ()
gdouble nc_integral_fixed_nodes_eval (NcIntegralFixed *intf
);
This function
|
a pointer to NcIntegralFixed. |
Returns : |
FIXME |
nc_integral_get_workspace ()
gsl_integration_workspace ** nc_integral_get_workspace ();
This function provides a workspace to be used by numerical integration functions of GSL. It keeps a internal pool of workspaces and allocate a new one if the function is called and the pool is empty. It is designed to be used in a multithread enviroment. The workspace must be unlocked in order to return to the pool. This must be done using the ncm_memory_pool_return.
Returns : |
a pointer to gsl_integration_workspace structure. |
nc_integral_locked_a_b ()
gint nc_integral_locked_a_b (gsl_function *F
,gdouble a
,gdouble b
,gdouble abstol
,gdouble reltol
,gdouble *result
,gdouble *error
);
This function uses a workspace from the pool and gsl_integration_qag function to perform the numerical integration in the [a, b] interval.
|
a gsl_function wich is the integrand. |
|
lower integration limit. |
|
upper integration limit. |
|
absolute tolerance. |
|
relative tolerance. |
|
a pointer to a gdouble in which the function stores the result. |
|
a pointer to a gdouble in which the function stores the estimated error. |
Returns : |
the error code returned by gsl_integration_qag. |
nc_integral_locked_a_inf ()
gint nc_integral_locked_a_inf (gsl_function *F
,gdouble a
,gdouble abstol
,gdouble reltol
,gdouble *result
,gdouble *error
);
This function uses a workspace from the pool and gsl_integration_qagiu function to perform the numerical integration in the \f$ [a, \infty] \f$ interval.
|
a gsl_function wich is the integrand. |
|
lower integration limit. |
|
absolute tolerance. |
|
relative tolerance. |
|
a pointer to a gdouble in which the function stores the result. |
|
a pointer to a gdouble in which the function stores the estimated error. |
Returns : |
the error code returned by gsl_integration_qagiu. |
ncm_integrate_2dim ()
gboolean ncm_integrate_2dim (NcIntegrand2dim *integ
,gdouble xi
,gdouble yi
,gdouble xf
,gdouble yf
,gdouble epsrel
,gdouble epsabs
,gdouble *result
,gdouble *error
);
This function FIXME
|
a pointer to NcIntegrand2dim. |
|
gbouble which is the lower integration limit of variable x. |
|
gbouble which is the lower integration limit of variable y. |
|
gbouble which is the upper integration limit of variable x. |
|
gbouble which is the upper integration limit of variable y. |
|
relative error |
|
absolute error |
|
a pointer to a gdouble in which the function stores the result. |
|
a pointer to a gdouble in which the function stores the estimated error. |
Returns : |
a gboolean |