Class

NumCosmoMathSplineBSpline

Description [src]

final class NumCosmoMath.SplineBSpline : NumCosmoMath.Spline
{
  /* No available fields */
}

Interpolating B-spline of order 2 to NCM_SPLINE_BSPLINE_MAX_ORDER.

Interpolates the values at the knots of NcmSpline with one control point per knot, B-spline knots placed by gsl_bspline_init_interp(), and a banded collocation solve, so preparation costs $O(n)$. Outside the knots, the value, the derivatives and the integral extrapolate the edge polynomial.

A cubic spline is $C^2$ and its interpolation error stays well above machine precision at any sample density; higher orders reach it. Maximum error at the interval midpoints for a Gaussian of mean $1200$ and standard deviation $300$ sampled uniformly on $[0, 2400]$:

samples degree 3 degree 5 degree 7 degree 9
100 3.4e-07 1.2e-09 2.8e-11 5.2e-13
500 5.2e-10 6.6e-14 6.7e-16 6.7e-16
2000 2.0e-12 4.4e-16 4.4e-16 4.4e-16

On a prepared spline, ncm_spline_eval() may be called concurrently: it uses stack scratch and reads only state fixed by preparation. The derivatives and the integral use the GSL workspace and serialize on an internal lock. Preparing concurrently with any evaluation is not supported, as for every NcmSpline.

Ancestors

Constructors

ncm_spline_bspline_new

Creates an empty interpolating B-spline of order order.

ncm_spline_bspline_new_full

Creates an interpolating B-spline of order order over (xv, yv).

ncm_spline_bspline_new_tol

Creates an empty B-spline that sets its order on preparation, see NcmSplineBSpline:reltol.

Instance methods

ncm_spline_bspline_get_achieved_error

Gets the estimated interpolation error of the order chosen on preparation, see NcmSplineBSpline:reltol.

ncm_spline_bspline_get_order

Gets NcmSplineBSpline:order.

ncm_spline_bspline_set_order

Sets NcmSplineBSpline:order, from $2$ to NCM_SPLINE_BSPLINE_MAX_ORDER. The spline must be prepared again afterwards.

Methods inherited from NcmSpline (46)

Please see NcmSpline for a full list of methods.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

NumCosmoMath.SplineBSpline:abstol

The absolute interpolation error requested, see NcmSplineBSpline:reltol; unused when NcmSplineBSpline:reltol is zero.

NumCosmoMath.SplineBSpline:order

The B-spline order, the polynomial degree plus one.

NumCosmoMath.SplineBSpline:reltol

The relative interpolation error requested, or zero to use NcmSplineBSpline:order.

Properties inherited from NcmSpline (3)
NumCosmoMath.Spline:length

The number of knots.

NumCosmoMath.Spline:x

The knot vector.

NumCosmoMath.Spline:y

The value vector.

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 NumCosmoMathSplineBSplineClass {
  NcmSplineClass parent_class;
  
}

No description available.

Class members
parent_class: NcmSplineClass

No description available.