e02bb evaluates a cubic spline from its B-spline representation.
Public Shared Sub e02bb ( _ ncap7 As Integer, _ lamda As Double(), _ c As Double(), _ x As Double, _ <OutAttribute> ByRef s As Double, _ <OutAttribute> ByRef ifail As Integer _ )
public: static void e02bb( int ncap7, array<double>^ lamda, array<double>^ c, double x, [OutAttribute] double% s, [OutAttribute] int% ifail )
- Type: System..::..Int32On entry: , where is the number of intervals (one greater than the number of interior knots, i.e., the knots strictly within the range to ) over which the spline is defined.Constraint: .
- Type: array<System..::..Double>()An array of size [ncap7]On entry: must be set to the value of the th member of the complete set of knots, , for .Constraint: the must be in nondecreasing order with .
- Type: array<System..::..Double>()An array of size [ncap7]On entry: the coefficient of the B-spline , for . The remaining elements of the array are not referenced.
- Type: System..::..DoubleOn entry: the argument at which the cubic spline is to be evaluated.Constraint: .
- Type: System..::..Double%On exit: the value of the spline, .
e02bb evaluates the cubic spline at a prescribed argument from its augmented knot set , for , (see (E02BAF not in this release)) and from the coefficients , for in its B-spline representation
Here , where is the number of intervals of the spline, and denotes the normalized B-spline of degree defined upon the knots . The prescribed argument must satisfy .
It is assumed that , for , and .
If is a point at which knots coincide, is discontinuous at ; in this case, s contains the value defined as is approached from the right.
The method employed is that of evaluation by taking convex combinations due to de Boor (1972). For further details of the algorithm and its use see Cox (1972) and Cox and Hayes (1973).
Cox M G (1972) The numerical evaluation of B-splines J. Inst. Math. Appl. 10 134–149
Cox M G (1978) The numerical evaluation of a spline from its B-spline representation J. Inst. Math. Appl. 21 135–143
Cox M G and Hayes J G (1973) Curve fitting: a guide and suite of algorithms for the non-specialist user NPL Report NAC26 National Physical Laboratory
de Boor C (1972) On calculating with B-splines J. Approx. Theory 6 50–62
Errors or warnings detected by the method:
- , i.e., the number of interior knots is negative.
The computed value of has negligible error in most practical situations. Specifically, this value has an absolute error bounded in modulus by , where is the largest in modulus of and , and is an integer such that . If and are all of the same sign, then the computed value of has a relative error not exceeding in modulus. For further details see Cox (1978).
The time taken is approximately seconds, where c is a machine-dependent constant.
Evaluate at nine equally-spaced points in the interval the cubic spline with (augmented) knots , , , , , , , , , , and normalized cubic B-spline coefficients , , , , , , .
The example program is written in a general form that will enable a cubic spline with intervals, in its normalized cubic B-spline form, to be evaluated at equally-spaced points in the interval . The program is self-starting in that any number of datasets may be supplied.