Top |
GObject ╰── NcmSpline2d ├── NcmSpline2dBicubic ├── NcmSpline2dGsl ╰── NcmSpline2dSpline
This class comprises all functions to provide a NcmSpline2d, get its properties and evaluate it given an interpolation method.
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 s2d
.
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 |
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
].
[skip]
s2d |
||
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 |
void
ncm_spline2d_prepare (NcmSpline2d *s2d
);
This function prepares the bi-dimensional spline s2d
such that one can evaluate it (ncm_spline2d_eval),
as well as to compute its integration in x, y or both directions.
NcmSpline2d *
ncm_spline2d_copy_empty (const NcmSpline2d *s2d
);
This function copies the bidimensional spline s2d
into an initialized
empty NcmSpline2d of a specific type.
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.
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
.
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 |
NcmSpline2d *
ncm_spline2d_ref (NcmSpline2d *s2d
);
Atomically increases the reference count of s2d
by one.
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.
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.
void ncm_spline2d_use_acc (NcmSpline2d *s2d
,gboolean use_acc
);
Whether to use accelerated bsearch to find the right knots. When enabled evaluation functions are not reentrant.
void ncm_spline2d_set_init (NcmSpline2d *s2d
,gboolean init
);
Whether to mark the NcmSpline2d as initialized. This method is intended for internal use only.
NcmSpline *
ncm_spline2d_peek_spline (NcmSpline2d *s2d
);
Get the NcmSpline of the NcmSpline2d. This method is intended for internal use only.
NcmVector *
ncm_spline2d_peek_xv (NcmSpline2d *s2d
);
Get the NcmVector of knots in the x-direction. This method is intended for internal use only.
NcmVector *
ncm_spline2d_peek_yv (NcmSpline2d *s2d
);
Get the NcmVector of knots in the y-direction. This method is intended for internal use only.
NcmMatrix *
ncm_spline2d_peek_zm (NcmSpline2d *s2d
);
Get the NcmMatrix of the values of the function, to be interpolated, computed at the knots. This method is intended for internal use only.
The NcmMatrix of the values of the function, to be interpolated, computed at the knots.
[transfer none]
gsl_interp_accel *
ncm_spline2d_peek_acc_x (NcmSpline2d *s2d
);
Get the gsl_interp_accel of the NcmSpline2d in the x-direction. This method is intended for internal use only.
[skip]
gsl_interp_accel *
ncm_spline2d_peek_acc_y (NcmSpline2d *s2d
);
Get the gsl_interp_accel of the NcmSpline2d in the y-direction. This method is intended for internal use only.
[skip]
gboolean
ncm_spline2d_is_init (NcmSpline2d *s2d
);
Whether the NcmSpline2d is initialized.
gboolean
ncm_spline2d_has_no_stride (NcmSpline2d *s2d
);
Whether the NcmSpline2d has stride 1 in both knots vectors.
gboolean
ncm_spline2d_using_acc (NcmSpline2d *s2d
);
Whether the NcmSpline2d is using accelerated bsearch to find the right knots.
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
.
[virtual int_dx]
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
.
[virtual int_dy]
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
].
[virtual int_dxdy]
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.
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.
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
.
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
.
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
].
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
].
gdouble ncm_spline2d_deriv_dzdx (NcmSpline2d *s2d
,gdouble x
,gdouble y
);
[virtual dzdx]
gdouble ncm_spline2d_deriv_dzdy (NcmSpline2d *s2d
,gdouble x
,gdouble y
);
[virtual dzdy]
gdouble ncm_spline2d_deriv_d2zdxy (NcmSpline2d *s2d
,gdouble x
,gdouble y
);
[virtual d2zdxy]
gdouble ncm_spline2d_deriv_d2zdx2 (NcmSpline2d *s2d
,gdouble x
,gdouble y
);
[virtual d2zdx2]
gdouble ncm_spline2d_deriv_d2zdy2 (NcmSpline2d *s2d
,gdouble x
,gdouble y
);
[virtual d2zdy2]
void ncm_spline2d_eval_vec_y (NcmSpline2d *s2d
,gdouble x
,const NcmVector *y
,GArray *order
,GArray *res
);
Computes the interpolated values of a function computed at the point (x
, y
) for
each element of y
. The order of the indices of y
is given by order
.
“init”
property “init” gboolean
boolean whether to prepare the NcmSpline2d.
Owner: NcmSpline2d
Flags: Read / Write
Default value: FALSE
“spline”
property“spline” NcmSpline *
NcmSpline object used internally.
Owner: NcmSpline2d
Flags: Read / Write / Construct Only
“use-acc”
property “use-acc” gboolean
Use accelerated bsearch.
Owner: NcmSpline2d
Flags: Read / Write
Default value: FALSE