NcmIntegral1d

NcmIntegral1d — One dimensional integration object.

Stability Level

Stable, unless otherwise indicated

Functions

Properties

double abstol Read / Write / Construct
guint partition Read / Write / Construct
double reltol Read / Write / Construct
guint rule Read / Write / Construct

Types and Values

Object Hierarchy

    GObject
    ╰── NcmIntegral1d
        ╰── NcmIntegral1dPtr

Includes

#include <numcosmo/math/ncm_integral1d.h>

Description

This object is used to perform one dimensional integration.

Functions

NcmIntegral1dF ()

gdouble
(*NcmIntegral1dF) (NcmIntegral1d *int1d,
                   const gdouble x,
                   const gdouble w);

ncm_integral1d_ref ()

NcmIntegral1d *
ncm_integral1d_ref (NcmIntegral1d *int1d);

Increases the reference count of int1d by one.

Parameters

int1d

a NcmIntegral1d

 

Returns

int1d .

[transfer full]


ncm_integral1d_free ()

void
ncm_integral1d_free (NcmIntegral1d *int1d);

Decreases the reference count of int1d by one.

Parameters

int1d

a NcmIntegral1d

 

ncm_integral1d_clear ()

void
ncm_integral1d_clear (NcmIntegral1d **int1d);

If *int1d is different from NULL, decreases the reference count of *int1d by one and sets *int1d to NULL.

Parameters

int1d

a NcmIntegral1d

 

ncm_integral1d_set_partition ()

void
ncm_integral1d_set_partition (NcmIntegral1d *int1d,
                              guint partition);

Sets the max number of subintervals to partition .

Parameters

int1d

a NcmIntegral1d

 

partition

max number of subintervals

 

ncm_integral1d_set_rule ()

void
ncm_integral1d_set_rule (NcmIntegral1d *int1d,
                         guint rule);

Sets the Gauss-Kronrod rule to use.

Parameters

int1d

a NcmIntegral1d

 

rule

Gauss-Kronrod rule

 

ncm_integral1d_set_reltol ()

void
ncm_integral1d_set_reltol (NcmIntegral1d *int1d,
                           gdouble reltol);

Sets the relative tolerance reltol to use.

Parameters

int1d

a NcmIntegral1d

 

reltol

relative tolerance

 

ncm_integral1d_set_abstol ()

void
ncm_integral1d_set_abstol (NcmIntegral1d *int1d,
                           gdouble abstol);

Sets the absolute tolerance reltol to use.

Parameters

int1d

a NcmIntegral1d

 

abstol

absolute tolerance

 

ncm_integral1d_get_partition ()

guint
ncm_integral1d_get_partition (NcmIntegral1d *int1d);

Parameters

int1d

a NcmIntegral1d

 

Returns

the maximum number of subdivisions used.


ncm_integral1d_get_rule ()

guint
ncm_integral1d_get_rule (NcmIntegral1d *int1d);

Parameters

int1d

a NcmIntegral1d

 

Returns

the Gauss-Kronrod rule used.


ncm_integral1d_get_reltol ()

gdouble
ncm_integral1d_get_reltol (NcmIntegral1d *int1d);

Parameters

int1d

a NcmIntegral1d

 

Returns

the relative tolerance used.


ncm_integral1d_get_abstol ()

gdouble
ncm_integral1d_get_abstol (NcmIntegral1d *int1d);

Parameters

int1d

a NcmIntegral1d

 

Returns

the absolute tolerance used.


ncm_integral1d_integrand ()

gdouble
ncm_integral1d_integrand (NcmIntegral1d *int1d,
                          const gdouble x,
                          const gdouble w);

Parameters

int1d

a NcmIntegral1d

 

x

integration variable

 

w

integration weight

 

Returns

the value of the integrand at x .


ncm_integral1d_eval ()

gdouble
ncm_integral1d_eval (NcmIntegral1d *int1d,
                     const gdouble xi,
                     const gdouble xf,
                     gdouble *err);

Evaluated the integral $I_F(x_i, x_f) = \int_{x_i}^{x_f}F(x)\mathrm{d}x$.

Parameters

int1d

a NcmIntegral1d

 

xi

inferior integration limit $x_i$

 

xf

superior integration limit $x_f$

 

err

the error in the integration.

[out]

Returns

the value of the integral $I_F(x_i, x_f)$.


ncm_integral1d_eval_gauss_hermite_p ()

gdouble
ncm_integral1d_eval_gauss_hermite_p (NcmIntegral1d *int1d,
                                     gdouble *err);

Evaluated the integral $H^p_F = \int_{0}^{\infty}e^{-x^2/2}F(x)\mathrm{d}x$.

Parameters

int1d

a NcmIntegral1d

 

err

the error in the integration.

[out]

Returns

the value of the integral $H^p_F$.


ncm_integral1d_eval_gauss_hermite ()

gdouble
ncm_integral1d_eval_gauss_hermite (NcmIntegral1d *int1d,
                                   gdouble *err);

Evaluated the integral $H_F = \int_{-\infty}^{\infty}e^{-x^2/2}F(x)\mathrm{d}x$.

Parameters

int1d

a NcmIntegral1d

 

err

the error in the integration.

[out]

Returns

the value of the integral $H_F$.


ncm_integral1d_eval_gauss_hermite_r_p ()

gdouble
ncm_integral1d_eval_gauss_hermite_r_p (NcmIntegral1d *int1d,
                                       const gdouble r,
                                       gdouble *err);

Evaluated the integral $H^p_F = \int_{0}^{\infty}e^{-x^2r^2/2}F(x)\mathrm{d}x$.

Parameters

int1d

a NcmIntegral1d

 

r

Gaussian scale $r$

 

err

the error in the integration.

[out]

Returns

the value of the integral $H^p_F$.


ncm_integral1d_eval_gauss_hermite_mur ()

gdouble
ncm_integral1d_eval_gauss_hermite_mur (NcmIntegral1d *int1d,
                                       const gdouble r,
                                       const gdouble mu,
                                       gdouble *err);

Evaluated the integral $H_F = \int_{-\infty}^{\infty}e^{-(x-\mu)^2r^2/2}F(x)\mathrm{d}x$.

Parameters

int1d

a NcmIntegral1d

 

r

Gaussian scale $r$

 

mu

Gaussian mean $\mu$

 

err

the error in the integration.

[out]

Returns

the value of the integral $H_F$.


ncm_integral1d_eval_gauss_hermite1_p ()

gdouble
ncm_integral1d_eval_gauss_hermite1_p (NcmIntegral1d *int1d,
                                      gdouble *err);

Evaluated the integral $H^p_F = \int_{0}^{\infty}xe^{-x^2/2}F(x)\mathrm{d}x$.

Parameters

int1d

a NcmIntegral1d

 

err

the error in the integration.

[out]

Returns

the value of the integral $H^p_F$.


ncm_integral1d_eval_gauss_hermite1_r_p ()

gdouble
ncm_integral1d_eval_gauss_hermite1_r_p
                               (NcmIntegral1d *int1d,
                                const gdouble r,
                                gdouble *err);

Evaluated the integral $H^p_F = \int_{0}^{\infty}xe^{-x^2r^2/2}F(x)\mathrm{d}x$.

Parameters

int1d

a NcmIntegral1d

 

r

Gaussian scale $r$

 

err

the error in the integration.

[out]

Returns

the value of the integral $H^p_F$.


ncm_integral1d_eval_gauss_laguerre ()

gdouble
ncm_integral1d_eval_gauss_laguerre (NcmIntegral1d *int1d,
                                    gdouble *err);

Evaluated the integral $L_F = \int_{0}^{\infty}e^{-x}F(x)\mathrm{d}x$.

Parameters

int1d

a NcmIntegral1d

 

err

the error in the integration.

[out]

Returns

the value of the integral $L_F$.


ncm_integral1d_eval_gauss_laguerre_r ()

gdouble
ncm_integral1d_eval_gauss_laguerre_r (NcmIntegral1d *int1d,
                                      const gdouble r,
                                      gdouble *err);

Evaluated the integral $L_F = \int_{0}^{\infty}e^{-xr}F(x)\mathrm{d}x$.

Parameters

int1d

a NcmIntegral1d

 

r

exponential scale $r$

 

err

the error in the integration.

[out]

Returns

the value of the integral $L_F$.

Types and Values

NCM_TYPE_INTEGRAL1D

#define NCM_TYPE_INTEGRAL1D (ncm_integral1d_get_type ())

struct NcmIntegral1dClass

struct NcmIntegral1dClass {
};

NCM_INTEGRAL1D_DEFAULT_PARTITION

#define NCM_INTEGRAL1D_DEFAULT_PARTITION 100000

NCM_INTEGRAL1D_DEFAULT_ALG

#define NCM_INTEGRAL1D_DEFAULT_ALG 6

NCM_INTEGRAL1D_DEFAULT_RELTOL

#define NCM_INTEGRAL1D_DEFAULT_RELTOL 1e-13

NCM_INTEGRAL1D_DEFAULT_ABSTOL

#define NCM_INTEGRAL1D_DEFAULT_ABSTOL 0.0

NcmIntegral1d

typedef struct _NcmIntegral1d NcmIntegral1d;

Property Details

The “abstol” property

  “abstol”                   double

Integral absolute tolerance.

Owner: NcmIntegral1d

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 0


The “partition” property

  “partition”                guint

Integral maximum partititon.

Owner: NcmIntegral1d

Flags: Read / Write / Construct

Allowed values: >= 10

Default value: 100000


The “reltol” property

  “reltol”                   double

Integral relative tolerance.

Owner: NcmIntegral1d

Flags: Read / Write / Construct

Allowed values: [0,1]

Default value: 1e-13


The “rule” property

  “rule”                     guint

Integration rule.

Owner: NcmIntegral1d

Flags: Read / Write / Construct

Allowed values: [1,6]

Default value: 6