Top |
This class comprises all functions to provide a NcmSpline, together with all necessary methods.
NcmSpline *
ncm_spline_copy_empty (const NcmSpline *s
);
This function copies the spline s
into an initialized empty NcmSpline of a specific type.
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.
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
.
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
.
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
.
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.
NcmSpline *
ncm_spline_ref (NcmSpline *s
);
Increases the reference count of s
by one.
void ncm_spline_acc (NcmSpline *s
,gboolean enable
);
Enables or disables spline accelerator. Note that, if
enabled, the spline becomes non-reentrant. In other words,
if enable
is TRUE, the spline evaluation is not thread safe.
Therefore, it should not be called concomitantly by two different threads.
Warning: the accelerator must be reset if the spline's size changes, otherwise, it can accessan out-of-bound index.
gsl_interp_accel *
ncm_spline_peek_acc (NcmSpline *s
);
This function returns the spline accelerator if it is enabled. Otherwise, it returns NULL.
[skip]
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.
void ncm_spline_set_xv (NcmSpline *s
,NcmVector *xv
,gboolean init
);
This function sets xv
as the knot vector of the spline.
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.
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.
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.
guint
ncm_spline_get_len (NcmSpline *s
);
This function gets the length of the spline.
NcmVector *
ncm_spline_get_xv (NcmSpline *s
);
This function returns the s
NcmVector of knots.
NcmVector *
ncm_spline_get_yv (NcmSpline *s
);
This function returns the s
NcmVector of the values of the function to be interpolated.
NcmVector *
ncm_spline_peek_xv (NcmSpline *s
);
This function returns the s
NcmVector of knots.
NcmVector *
ncm_spline_peek_yv (NcmSpline *s
);
This function returns the s
NcmVector of the values of the function to be interpolated.
void ncm_spline_get_bounds (NcmSpline *s
,gdouble *lb
,gdouble *ub
);
This function returns the lower and upper bound of s
.
gboolean
ncm_spline_is_init (NcmSpline *s
);
This function returns TRUE if s
is initialized or FALSE otherwise.
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.
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.
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).
void
ncm_spline_prepare_base (NcmSpline *s
);
This function computes the second derivatives of s
and it is used to prepare a
bidimensional spline.
gdouble ncm_spline_eval_deriv_nmax (const NcmSpline *s
,const gdouble x
);
gdouble ncm_spline_eval_integ (const NcmSpline *s
,const gdouble x0
,const gdouble x1
);