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.
Constructors
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_set_order
Sets NcmSplineBSpline:order, from $2$ to NCM_SPLINE_BSPLINE_MAX_ORDER. The spline
must be prepared again afterwards.
Properties
NumCosmoMath.SplineBSpline:abstol
The absolute interpolation error requested, see NcmSplineBSpline:reltol; unused
when NcmSplineBSpline:reltol is zero.
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.