![]() |
![]() |
![]() |
NumCosmo Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
Synopsis
struct NcmSpline; struct NcmSplineClass; const gdouble bterm; const gdouble cterm; const gdouble dterm; void ncm_spline_clear (NcmSpline **s
); NcmSpline * ncm_spline_copy (const NcmSpline *s
); NcmSpline * ncm_spline_copy_empty (const NcmSpline *s
); gdouble ncm_spline_eval (const NcmSpline *s
,const gdouble x
); gdouble ncm_spline_eval_deriv (const NcmSpline *s
,const gdouble x
); gdouble ncm_spline_eval_deriv2 (const NcmSpline *s
,const gdouble x
); gdouble ncm_spline_eval_integ (const NcmSpline *s
,const gdouble x0
,const gdouble x1
); void ncm_spline_free (NcmSpline *s
); guint ncm_spline_get_index (const NcmSpline *s
,const gdouble x
); NcmVector * ncm_spline_get_xv (NcmSpline *s
); NcmVector * ncm_spline_get_yv (NcmSpline *s
); gboolean ncm_spline_is_empty (const NcmSpline *s
); gsize ncm_spline_min_size (const NcmSpline *s
); NcmSpline * ncm_spline_new (const NcmSpline *s
,NcmVector *xv
,NcmVector *yv
,const gboolean init
); NcmSpline * ncm_spline_new_array (const NcmSpline *s
,GArray *x
,GArray *y
,const gboolean init
); NcmSpline * ncm_spline_new_data (const NcmSpline *s
,gdouble *x
,gdouble *y
,const gsize len
,const gboolean init
); void ncm_spline_prepare (NcmSpline *s
); void ncm_spline_prepare_base (NcmSpline *s
); NcmSpline * ncm_spline_ref (NcmSpline *s
); NcmSpline * ncm_spline_set (NcmSpline *s
,NcmVector *xv
,NcmVector *yv
,gboolean init
); void ncm_spline_set_array (NcmSpline *s
,GArray *x
,GArray *y
,gboolean init
); void ncm_spline_set_data_static (NcmSpline *s
,gdouble *x
,gdouble *y
,gsize len
,gboolean init
); void ncm_spline_set_xv (NcmSpline *s
,NcmVector *xv
,gboolean init
); void ncm_spline_set_yv (NcmSpline *s
,NcmVector *yv
,gboolean init
); const gdouble r1; const gdouble r12; const gdouble r2;
Description
This class comprises all functions to provide a NcmSpline, together with all necessary methods.
Details
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.
|
a NcmSpline. |
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_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_eval ()
gdouble ncm_spline_eval (const NcmSpline *s
,const gdouble x
);
|
a constant NcmSpline. |
|
x-coordinate value. |
Returns : |
The interpolated value of a function computed at x . |
ncm_spline_eval_deriv ()
gdouble ncm_spline_eval_deriv (const NcmSpline *s
,const gdouble x
);
|
a constant NcmSpline. |
|
x-coordinate value. |
Returns : |
The derivative of an interpolated function computed at x . |
ncm_spline_eval_deriv2 ()
gdouble ncm_spline_eval_deriv2 (const NcmSpline *s
,const gdouble x
);
|
a constant NcmSpline. |
|
x-coordinate value. |
Returns : |
The second derivative of an interpolated function computed at x . |
ncm_spline_eval_integ ()
gdouble ncm_spline_eval_integ (const NcmSpline *s
,const gdouble x0
,const gdouble x1
);
|
a constant NcmSpline. |
|
lower integration limit. |
|
upper integration limit. |
Returns : |
The numerical integral of an interpolated function over the range [x0 , x1 ]. |
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.
|
a NcmSpline. |
ncm_spline_get_index ()
guint ncm_spline_get_index (const NcmSpline *s
,const gdouble x
);
|
a constant NcmSpline. |
|
a value of the abscissa axis. |
Returns : |
The index of the lower knot of the interval x belongs to. |
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_min_size ()
gsize ncm_spline_min_size (const NcmSpline *s
);
|
a constant NcmSpline. |
Returns : |
Minimum number of knots required. |
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_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).
|
a NcmSpline. |
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.
|
a NcmSpline. |
ncm_spline_ref ()
NcmSpline * ncm_spline_ref (NcmSpline *s
);
FIXME
|
a NcmSpline. |
Returns : |
FIXME. [transfer full] |
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_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.
|
a NcmSpline. |
|
GArray of knots. |
|
GArray of the values of the function, to be interpolated, computed at x . |
|
TRUE to prepare s or FALSE to not prepare it. |
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.
|
a NcmSpline. |
|
array of knots. |
|
array of the values of the function, to be interpolated, computed at x . |
|
lenght of x and y . |
|
TRUE to prepare s or FALSE to not prepare it. |
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.