Next: , Previous: Constructing the knots vector, Up: Basis Splines   [Index]


40.4 Evaluation of B-splines

Function: int gsl_bspline_eval (const double x, gsl_vector * B, gsl_bspline_workspace * w)

This function evaluates all B-spline basis functions at the position x and stores them in the vector B, so that the i-th element is B_i(x). The vector B must be of length n = nbreak + k - 2. This value may also be obtained by calling gsl_bspline_ncoeffs. Computing all the basis functions at once is more efficient than computing them individually, due to the nature of the defining recurrence relation.

Function: int gsl_bspline_eval_nonzero (const double x, gsl_vector * Bk, size_t * istart, size_t * iend, gsl_bspline_workspace * w)

This function evaluates all potentially nonzero B-spline basis functions at the position x and stores them in the vector Bk, so that the i-th element is B_(istart+i)(x). The last element of Bk is B_(iend)(x). The vector Bk must be of length k. By returning only the nonzero basis functions, this function allows quantities involving linear combinations of the B_i(x) to be computed without unnecessary terms (such linear combinations occur, for example, when evaluating an interpolated function).

Function: size_t gsl_bspline_ncoeffs (gsl_bspline_workspace * w)

This function returns the number of B-spline coefficients given by n = nbreak + k - 2.