Spline Autoknots

Spline Autoknots — Automatic generation of the knots of a spline

Synopsis

#define             NCM_SPLINE_FUNC_DEFAULT_MAX_NODES
#define             NCM_SPLINE_KNOT_DIFF_TOL
enum                NcmSplineFuncType;
void                ncm_spline_set_func                 (NcmSpline *s,
                                                         NcmSplineFuncType ftype,
                                                         gsl_function *F,
                                                         gdouble xi,
                                                         gdouble xf,
                                                         gsize max_nodes,
                                                         gdouble rel_error);

Description

This set of functions implements 4 different methods to automatically determine the NcmVector of knots of a NcmSpline given a relative error between the function to be interpolated and the spline result.

Details

NCM_SPLINE_FUNC_DEFAULT_MAX_NODES

#define NCM_SPLINE_FUNC_DEFAULT_MAX_NODES 10000

NCM_SPLINE_KNOT_DIFF_TOL

#define NCM_SPLINE_KNOT_DIFF_TOL (GSL_DBL_EPSILON * 1.0e2)

enum NcmSplineFuncType

typedef enum {
  NCM_SPLINE_FUNCTION_4POINTS,
  NCM_SPLINE_FUNCTION_2x2POINTS,
  NCM_SPLINE_FUNCTION_SPLINE,
  NCM_SPLINE_FUNCTION_SPLINE_LNKNOT,
} NcmSplineFuncType;

FIXME

NCM_SPLINE_FUNCTION_4POINTS

FIXME

NCM_SPLINE_FUNCTION_2x2POINTS

FIXME

NCM_SPLINE_FUNCTION_SPLINE

FIXME

NCM_SPLINE_FUNCTION_SPLINE_LNKNOT

FIXME

ncm_spline_set_func ()

void                ncm_spline_set_func                 (NcmSpline *s,
                                                         NcmSplineFuncType ftype,
                                                         gsl_function *F,
                                                         gdouble xi,
                                                         gdouble xf,
                                                         gsize max_nodes,
                                                         gdouble rel_error);

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

s :

a NcmSpline.

ftype :

a NcmSplineFuncType.

F :

function to be approximated by spline functions.

xi :

lower knot.

xf :

upper knot.

max_nodes :

maximum number of knots.

rel_error :

relative error between the function to be interpolated and the spline result.