Top | ![]() |
![]() |
![]() |
![]() |
Functions
Object Hierarchy
GObject ╰── NcmSpline2d ├── NcmSpline2dBicubic ├── NcmSpline2dGsl ╰── NcmSpline2dSpline
Description
This class comprises all functions to provide a NcmSpline2d, get its properties and evaluate it given an interpolation method.
Functions
ncm_spline2d_set ()
void ncm_spline2d_set (NcmSpline2d *s2d
,NcmVector *xv
,NcmVector *yv
,NcmMatrix *zm
,gboolean init
);
This funtion sets xv
and yv
vectors and zm
matrix to s
.
Parameters
s2d |
||
xv |
a NcmVector of knots. |
|
yv |
a NcmVector of knots. |
|
zm |
a NcmMatrix of the values of the function, to be interpolated, computed at |
|
init |
TRUE to prepare the NcmSpline2d or FALSE to not prepare it. |
ncm_spline2d_set_function ()
void ncm_spline2d_set_function (NcmSpline2d *s2d
,NcmSplineFuncType ftype
,gsl_function *Fx
,gsl_function *Fy
,gdouble xl
,gdouble xu
,gdouble yl
,gdouble yu
,gdouble rel_err
);
This function automatically determines the knots of s2d
in the intervals [xl
, xu
] and
[yl
, yu
] given a ftype
and rel_error
.
The functions Fx
and Fy
are the bidimensional function given at specific values of y and x, respectively.
These x and y values must be in the the intervals [xl
, xu
] and [yl
, yu
].
Parameters
s2d |
a NcmSpline2d. |
|
ftype |
||
Fx |
function of x variable to be approximated by spline functions. |
|
Fy |
function of y variable to be approximated by spline functions. |
|
xl |
lower knot of x-coordinate. |
|
xu |
upper knot of x-coordinate. |
|
yl |
lower knot of y-coordinate. |
|
yu |
upper knot of y-coordinate. |
|
rel_err |
relative error between the function to be interpolated and the spline result. |
ncm_spline2d_prepare ()
void
ncm_spline2d_prepare (NcmSpline2d *s2d
);
This function prepares the bidimensional spline s2d
such that one can evaluate it (ncm_spline2d_eval),
as well as to compute its integration in x, y or both directions.
ncm_spline2d_copy_empty ()
NcmSpline2d *
ncm_spline2d_copy_empty (const NcmSpline2d *s2d
);
This function copies the bidimensional spline s2d
into an initialized
empty NcmSpline2d of a specific type.
ncm_spline2d_copy ()
NcmSpline2d *
ncm_spline2d_copy (NcmSpline2d *s2d
);
This function copies the two NcmVector and the NcmMatrix of the bidimensional
spline s2d
into those two NcmVector and NcmMatrix of a new NcmSpline2d.
ncm_spline2d_new ()
NcmSpline2d * ncm_spline2d_new (const NcmSpline2d *s2d
,NcmVector *xv
,NcmVector *yv
,NcmMatrix *zm
,gboolean init
);
This function returns a new NcmSpline2d, where the knots of this new spline are given
in the NcmVector xv
and yv
. The values of the function, at those knots, to be interpolated are
given in the NcmMatrix zm
.
Parameters
s2d |
a constant NcmSpline2d. |
|
xv |
NcmVector of knots. |
|
yv |
NcmVector of knots. |
|
zm |
NcmMatrix of the values of the function, to be interpolated, computed at |
|
init |
TRUE to prepare the new NcmSpline2d or FALSE to not prepare it. |
ncm_spline2d_free ()
void
ncm_spline2d_free (NcmSpline2d *s2d
);
Atomically decrements the reference count of s2d
by one. If the reference count drops to 0,
all memory allocated by s2d
is released.
ncm_spline2d_clear ()
void
ncm_spline2d_clear (NcmSpline2d **s2d
);
Atomically decrements the reference count of s2d
by one. If the reference count drops to 0,
all memory allocated by s2d
is released. Set pointer to NULL.
ncm_spline2d_integ_dx ()
gdouble ncm_spline2d_integ_dx (NcmSpline2d *s2d
,gdouble xl
,gdouble xu
,gdouble y
);
This function computes the integration in x over the interval [xl
, xu
] and
at y
.
Parameters
s2d |
a NcmSpline2d. |
|
xl |
lower limit of integration. |
|
xu |
upper limit of integration. |
|
y |
y-coordinate value. |
ncm_spline2d_integ_dy ()
gdouble ncm_spline2d_integ_dy (NcmSpline2d *s2d
,gdouble x
,gdouble yl
,gdouble yu
);
This function computes the integration in y over the interval [yl
, yu
] and
at x
.
Parameters
s2d |
a NcmSpline2d. |
|
x |
x-coordinate value. |
|
yl |
lower limit of integration. |
|
yu |
upper limit of integration. |
ncm_spline2d_integ_dxdy ()
gdouble ncm_spline2d_integ_dxdy (NcmSpline2d *s2d
,gdouble xl
,gdouble xu
,gdouble yl
,gdouble yu
);
This function computes the integration in both x and y directions over the intervals
[xl
, xu
] and [yl
, yu
].
ncm_spline2d_integ_dx_spline ()
NcmSpline * ncm_spline2d_integ_dx_spline (NcmSpline2d *s2d
,gdouble xl
,gdouble xu
);
This function computes the integral in x of the bidimensional interpolated function
over the range [xl
, xu
] resulting in a one dimensional function.
ncm_spline2d_integ_dy_spline ()
NcmSpline * ncm_spline2d_integ_dy_spline (NcmSpline2d *s2d
,gdouble yl
,gdouble yu
);
This function computes the integral in y of the bidimensional interpolated function
over the range [yl
, yu
] resulting in a one dimensional function.
ncm_spline2d_integ_dx_spline_val ()
gdouble ncm_spline2d_integ_dx_spline_val (NcmSpline2d *s2d
,gdouble xl
,gdouble xu
,gdouble y
);
This function calls ncm_spline2d_integ_dx_spline and evaluates the resulting
NcmSpline at y
.
Parameters
s2d |
a NcmSpline2d. |
|
xl |
lower limit of integration. |
|
xu |
upper limit of integration. |
|
y |
y-coordinate value. |
ncm_spline2d_integ_dy_spline_val ()
gdouble ncm_spline2d_integ_dy_spline_val (NcmSpline2d *s2d
,gdouble x
,gdouble yl
,gdouble yu
);
This function calls ncm_spline2d_integ_dy_spline and evaluates the resulting
NcmSpline at x
.
Parameters
s2d |
a NcmSpline2d. |
|
x |
x-coordinate value. |
|
yl |
lower limit of integration. |
|
yu |
upper limit of integration. |
ncm_spline2d_integ_dxdy_spline_x ()
gdouble ncm_spline2d_integ_dxdy_spline_x (NcmSpline2d *s2d
,gdouble xl
,gdouble xu
,gdouble yl
,gdouble yu
);
This function calls ncm_spline2d_integ_dx_spline and integrates the resulting
NcmSpline over the interval [yl
, yu
].
Parameters
s2d |
a NcmSpline2d. |
|
xl |
lower limit of integration in the x-direction. |
|
xu |
upper limit of integration in the x-direction. |
|
yl |
lower limit of integration in the y-direction. |
|
yu |
upper limit of integration in the y-direction. |
ncm_spline2d_integ_dxdy_spline_y ()
gdouble ncm_spline2d_integ_dxdy_spline_y (NcmSpline2d *s2d
,gdouble xl
,gdouble xu
,gdouble yl
,gdouble yu
);
This function calls ncm_spline2d_integ_dy_spline and integrates the resulting
NcmSpline over the interval [xl
, xu
].
Parameters
s2d |
a NcmSpline2d. |
|
xl |
lower limit of integration in the x-direction. |
|
xu |
upper limit of integration in the x-direction. |
|
yl |
lower limit of integration in the y-direction. |
|
yu |
upper limit of integration in the y-direction. |