Top | ![]() |
![]() |
![]() |
![]() |
Functions
NcmSpline * | ncm_spline_copy_empty () |
NcmSpline * | ncm_spline_copy () |
NcmSpline * | ncm_spline_new () |
NcmSpline * | ncm_spline_new_array () |
NcmSpline * | ncm_spline_new_data () |
NcmSpline * | ncm_spline_set () |
NcmSpline * | ncm_spline_ref () |
void | ncm_spline_acc () |
void | ncm_spline_set_len () |
void | ncm_spline_set_xv () |
void | ncm_spline_set_yv () |
void | ncm_spline_set_array () |
void | ncm_spline_set_data_static () |
NcmVector * | ncm_spline_get_xv () |
NcmVector * | ncm_spline_get_yv () |
void | ncm_spline_get_bounds () |
void | ncm_spline_free () |
void | ncm_spline_clear () |
void | ncm_spline_prepare () |
void | ncm_spline_prepare_base () |
gdouble | ncm_spline_eval () |
gdouble | ncm_spline_eval_deriv () |
gdouble | ncm_spline_eval_deriv2 () |
gdouble | ncm_spline_eval_deriv_nmax () |
gdouble | ncm_spline_eval_integ () |
gboolean | ncm_spline_is_empty () |
gsize | ncm_spline_min_size () |
guint | ncm_spline_get_index () |
Description
This class comprises all functions to provide a NcmSpline, together with all necessary methods.
Functions
ncm_spline_copy_empty ()
NcmSpline *
ncm_spline_copy_empty (const NcmSpline *s
);
This function copies the spline s
into an initialized empty NcmSpline of a specific type.
ncm_spline_copy ()
NcmSpline *
ncm_spline_copy (const NcmSpline *s
);
This function copies the two NcmVector of the spline s
into those two
NcmVector of a new NcmSpline.
ncm_spline_new ()
NcmSpline * ncm_spline_new (const NcmSpline *s
,NcmVector *xv
,NcmVector *yv
,const gboolean init
);
This function returns a new NcmSpline, where the knots of this new spline are given
in the NcmVector xv
and the values of the function, at those knots, to be interpolated are
given in the NcmVector yv
.
ncm_spline_new_array ()
NcmSpline * ncm_spline_new_array (const NcmSpline *s
,GArray *x
,GArray *y
,const gboolean init
);
This function returns a new NcmSpline, where the knots of this new spline are given
in the GArray x
and the values of the function, at those knots, to be interpolated are
given in the GArray y
.
ncm_spline_new_data ()
NcmSpline * ncm_spline_new_data (const NcmSpline *s
,gdouble *x
,gdouble *y
,const gsize len
,const gboolean init
);
This function returns a new NcmSpline, where the knots of this new spline are given
in the array x
and the values of the function, at those knots, to be interpolated are
given in the array y
.
ncm_spline_set ()
NcmSpline * ncm_spline_set (NcmSpline *s
,NcmVector *xv
,NcmVector *yv
,gboolean init
);
This funtion sets both xv
and yv
vectors to s
.
The two vectors must have the same length.
ncm_spline_acc ()
void ncm_spline_acc (NcmSpline *s
,gboolean enable
);
Enables or disables spline accelerator. Note that if enabled the spline becomes non-reentrant.
ncm_spline_set_len ()
void ncm_spline_set_len (NcmSpline *s
,guint len
);
This function sets len
as the length of the spline,
it allocates the necessary NcmVector. If it is already
allocated with different length it frees the current vectors
and allocates new ones.
ncm_spline_set_xv ()
void ncm_spline_set_xv (NcmSpline *s
,NcmVector *xv
,gboolean init
);
This function sets xv
as the knot vector of the spline.
ncm_spline_set_yv ()
void ncm_spline_set_yv (NcmSpline *s
,NcmVector *yv
,gboolean init
);
This function sets yv
as the function values vector. This NcmVector yv
comprises the function values computed at the knots of the spline.
ncm_spline_set_array ()
void ncm_spline_set_array (NcmSpline *s
,GArray *x
,GArray *y
,gboolean init
);
This function sets x
as the knot vector and y
as the function values vector
of the spline.
Parameters
s |
a NcmSpline. |
|
x |
GArray of knots. |
[element-type double] |
y |
GArray of the values of the function, to be interpolated, computed at |
[element-type double] |
init |
TRUE to prepare |
ncm_spline_set_data_static ()
void ncm_spline_set_data_static (NcmSpline *s
,gdouble *x
,gdouble *y
,gsize len
,gboolean init
);
This function sets x
as the knot vector and y
as the function values vector
of the spline.
Parameters
s |
a NcmSpline. |
|
x |
array of knots. |
|
y |
array of the values of the function, to be interpolated, computed at |
|
len |
lenght of |
|
init |
TRUE to prepare |
ncm_spline_get_xv ()
NcmVector *
ncm_spline_get_xv (NcmSpline *s
);
This function returns the s
NcmVector of knots.
ncm_spline_get_yv ()
NcmVector *
ncm_spline_get_yv (NcmSpline *s
);
This function returns the s
NcmVector of the values of the function to be interpolated.
ncm_spline_get_bounds ()
void ncm_spline_get_bounds (NcmSpline *s
,gdouble *lb
,gdouble *ub
);
This function returns the lower and upper bound of s
.
ncm_spline_free ()
void
ncm_spline_free (NcmSpline *s
);
Atomically decrements the reference count of s
by one. If the reference count drops to 0,
all memory allocated by s
is released.
ncm_spline_clear ()
void
ncm_spline_clear (NcmSpline **s
);
Atomically decrements the reference count of s
by one. If the reference count drops to 0,
all memory allocated by s
is released. The pointer is set to NULL.
ncm_spline_prepare ()
void
ncm_spline_prepare (NcmSpline *s
);
This function prepares the spline s
such that one can evaluate it (ncm_spline_eval), as well as
to compute its first and second derivatives (ncm_spline_eval_deriv, ncm_spline_eval_deriv2)
and integration (ncm_spline_eval_integ).
ncm_spline_prepare_base ()
void
ncm_spline_prepare_base (NcmSpline *s
);
This function computes the second derivatives of s
and it is used to prepare a
bidimensional spline.
ncm_spline_eval_deriv_nmax ()
gdouble ncm_spline_eval_deriv_nmax (const NcmSpline *s
,const gdouble x
);
ncm_spline_eval_integ ()
gdouble ncm_spline_eval_integ (const NcmSpline *s
,const gdouble x0
,const gdouble x1
);
Property Details
The “length”
property
“length” guint
Spline length.
Flags: Read / Write / Construct Only
Default value: 0
The “x”
property
“x” GVariant *
Spline knots.
Flags: Read / Write
Allowed values: GVariant<ad>
Default value: NULL
The “y”
property
“y” GVariant *
Spline values.
Flags: Read / Write
Allowed values: GVariant<ad>
Default value: NULL