Class

NumCosmoMathSpline

Description [src]

abstract class NumCosmoMath.Spline : GObject.Object
{
  /* No available fields */
}

Base class for implementing splines.

This class comprises all functions to provide a NcmSpline, together with all necessary methods.

Ancestors

Functions

ncm_spline_clear

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.

Instance methods

ncm_spline_acc

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.

ncm_spline_copy

This function copies the two NcmVector of the spline s into those two NcmVector of a new NcmSpline.

ncm_spline_copy_empty

This function copies the spline s into an initialized empty NcmSpline of a specific type.

ncm_spline_eval
No description available.

ncm_spline_eval_deriv
No description available.

ncm_spline_eval_deriv2
No description available.

ncm_spline_eval_deriv_idx

Evaluates the derivative of the spline at x using the provided index i. This function is useful when multiple splines share the same x vector and the index is already known, avoiding redundant binary searches.

ncm_spline_eval_deriv_nmax
No description available.

ncm_spline_eval_idx

Evaluates the spline at x using the provided index i. This function is useful when multiple splines share the same x vector and the index is already known, avoiding redundant binary searches.

ncm_spline_eval_integ
No description available.

ncm_spline_eval_integ_idx

Evaluates the integral of the spline from xi to xf using the provided indices i and f. This function is useful when multiple splines share the same x vector and the indices are already known, avoiding redundant binary searches.

ncm_spline_free

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_get_bounds

This function returns the lower and upper bound of s.

ncm_spline_get_index
No description available.

ncm_spline_get_len

This function gets the length of the spline.

ncm_spline_get_xv

This function returns the s NcmVector of knots.

ncm_spline_get_yv

This function returns the s NcmVector of the values of the function to be interpolated.

ncm_spline_is_empty
No description available.

ncm_spline_is_init

This function returns TRUE if s is initialized or FALSE otherwise.

ncm_spline_min_size
No description available.

ncm_spline_new

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

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

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_peek_acc

This function returns the spline accelerator if it is enabled. Otherwise, it returns NULL.

ncm_spline_peek_xv

This function returns the s NcmVector of knots.

ncm_spline_peek_yv

This function returns the s NcmVector of the values of the function to be interpolated.

ncm_spline_post_prepare

Computes lookup buckets for the spline s to enable efficient evaluations using #ncm_spline_eval. This function is always called by #ncm_spline_prepare() after all necessary preparations are completed.

ncm_spline_prepare

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

This function computes the second derivatives of s and it is used to prepare a bi-dimensional spline.

ncm_spline_ref

Increases the reference count of s by one.

ncm_spline_set

This function sets both xv and yv vectors to s. The two vectors must have the same length.

ncm_spline_set_array

This function sets x as the knot vector and y as the function values vector of the spline.

ncm_spline_set_data_static

This function sets x as the knot vector and y as the function values vector of the spline.

ncm_spline_set_func

This function automatically determines the knots of s in the interval [xi, xf] given a ftype and rel_error.

ncm_spline_set_func1

This function automatically determines the knots of s in the interval [xi, xf] given a ftype and rel_error.

ncm_spline_set_func_grid

This function fills the spline s with the function F values in a uniform grid within the range [xi, xf] and a total of nnodes knots.

ncm_spline_set_func_grid1

This function fills the spline s with the function F values in a uniform grid within the range [xi, xf] and a total of nnodes knots.

ncm_spline_set_func_scale

This function automatically determines the knots of s in the interval [xi, xf] given a ftype and rel_error.

ncm_spline_set_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

This function sets xv as the knot vector of the spline.

ncm_spline_set_yv

This function sets yv as the function values vector. This NcmVector yv comprises the function values computed at the knots of the spline.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

NumCosmoMath.Spline:length

The spline length (total number of knots).

NumCosmoMath.Spline:x

NcmVector with the spline knots.

NumCosmoMath.Spline:y

NcmVector with the spline values.

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct NumCosmoMathSplineClass {
  const gchar* (* name) (
    NcmSpline* s
  );
  void (* reset) (
    NcmSpline* s
  );
  void (* prepare) (
    NcmSpline* s
  );
  void (* prepare_base) (
    NcmSpline* s
  );
  gsize (* min_size) (
    const NcmSpline* s
  );
  gdouble (* eval) (
    const NcmSpline* s,
    const gdouble x
  );
  gdouble (* deriv) (
    const NcmSpline* s,
    const gdouble x
  );
  gdouble (* deriv2) (
    const NcmSpline* s,
    const gdouble x
  );
  gdouble (* deriv_nmax) (
    const NcmSpline* s,
    const gdouble x
  );
  gdouble (* integ) (
    const NcmSpline* s,
    const gdouble xi,
    const gdouble xf
  );
  NcmSpline* (* copy_empty) (
    const NcmSpline* s
  );
  gdouble (* eval_idx) (
    const NcmSpline* s,
    const gdouble x,
    const gsize i
  );
  gdouble (* deriv_idx) (
    const NcmSpline* s,
    const gdouble x,
    const gsize i
  );
  gdouble (* integ_idx) (
    const NcmSpline* s,
    const gdouble xi,
    const gsize i,
    const gdouble xf,
    const gsize f
  );
  
}

No description available.

Class members
name: const gchar* (* name) ( NcmSpline* s )

No description available.

reset: void (* reset) ( NcmSpline* s )

No description available.

prepare: void (* prepare) ( NcmSpline* s )

No description available.

prepare_base: void (* prepare_base) ( NcmSpline* s )

No description available.

min_size: gsize (* min_size) ( const NcmSpline* s )

No description available.

eval: gdouble (* eval) ( const NcmSpline* s, const gdouble x )

No description available.

deriv: gdouble (* deriv) ( const NcmSpline* s, const gdouble x )

No description available.

deriv2: gdouble (* deriv2) ( const NcmSpline* s, const gdouble x )

No description available.

deriv_nmax: gdouble (* deriv_nmax) ( const NcmSpline* s, const gdouble x )

No description available.

integ: gdouble (* integ) ( const NcmSpline* s, const gdouble xi, const gdouble xf )

No description available.

copy_empty: NcmSpline* (* copy_empty) ( const NcmSpline* s )

No description available.

eval_idx: gdouble (* eval_idx) ( const NcmSpline* s, const gdouble x, const gsize i )

No description available.

deriv_idx: gdouble (* deriv_idx) ( const NcmSpline* s, const gdouble x, const gsize i )

No description available.

integ_idx: gdouble (* integ_idx) ( const NcmSpline* s, const gdouble xi, const gsize i, const gdouble xf, const gsize f )

No description available.

Virtual methods

NumCosmoMath.SplineClass.copy_empty

This function copies the spline s into an initialized empty NcmSpline of a specific type.

NumCosmoMath.SplineClass.deriv
No description available.

NumCosmoMath.SplineClass.deriv2
No description available.

NumCosmoMath.SplineClass.deriv_idx
No description available.

NumCosmoMath.SplineClass.deriv_nmax
No description available.

NumCosmoMath.SplineClass.eval
No description available.

NumCosmoMath.SplineClass.eval_idx

Evaluates the spline at x using the provided index i. This function is useful when multiple splines share the same x vector and the index is already known, avoiding redundant binary searches.

NumCosmoMath.SplineClass.integ
No description available.

NumCosmoMath.SplineClass.integ_idx
No description available.

NumCosmoMath.SplineClass.min_size
No description available.

NumCosmoMath.SplineClass.name
No description available.

NumCosmoMath.SplineClass.prepare

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).

NumCosmoMath.SplineClass.prepare_base

This function computes the second derivatives of s and it is used to prepare a bi-dimensional spline.

NumCosmoMath.SplineClass.reset
No description available.