|
NAG[e02bbc] NAG[nag_1d_spline_evaluate] - Evaluation of fitted cubic spline, function only
|
|
Calling Sequence
e02bbc(x, s, spline_data, 'fail'=fail)
nag_1d_spline_evaluate(. . .)
Parameters
|
x - float;
|
|
|
On entry: the argument at which the cubic spline is to be evaluated.
|
|
Constraint: . .
|
|
|
s - assignable;
|
|
|
Note: On exit the variable s will have a value of type float.
|
|
On exit: the value of the spline, .
|
|
|
spline_data - table;
|
|
|
A Maple table, which should be generated using NAG[Nag_Spline], corresponding to the Nag_Spline structure.
|
|
Constraint: . .
|
|
lamda - Vector(datatype=float[8])
|
|
Constraint: the must be in non-decreasing order with . .
|
|
c - Vector(datatype=float[8])
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_1d_spline_evaluate (e02bbc) evaluates a cubic spline from its B-spline representation.
|
|
Error Indicators and Warnings
|
|
"NE_ABSCI_OUTSIDE_KNOT_INTVL"
On entry, x must satisfy : , , . In this case s is set arbitrarily to zero.
"NE_INT_ARG_LT"
On entry, n must not be less than 8: .
|
|
Further Comments
|
|
The time taken by nag_1d_spline_evaluate (e02bbc) is approximately C seconds, where C is a machine-dependent constant.
Note: the function does not test all the conditions on the knots given in the description of lamda in Section [Parameters], since to do this would result in a computation time approximately linear in instead of . All the conditions are tested in e02bac (nag_1d_spline_fit_knots), however, and the knots returned by e01bac (nag_1d_spline_interpolant) or e02bec (nag_1d_spline_fit) will satisfy the conditions.
|
|
|
Examples
|
|
>
|
m := 9:
ncap := 4:
ncap7 := ncap+7:
spline_data := NAG:-Nag_Spline():
spline_data['n'] := ncap7:
spline_data['lamda'] := Vector(ncap7,[1, 1, 1, 1, 3, 6, 8, 9, 9, 9, 9 ],
datatype=float[8]):
spline_data['c'] := Vector(ncap7,[ 1, 2, 4, 7, 6, 4, 3 ],
datatype=float[8]):
a := spline_data['lamda'][4]:
b := spline_data['lamda'][ncap+4]:
for r from 1 to m do
x := ((m-r)*a+(r-1)*b)/(m-1):
NAG:-e02bbc(x, s, spline_data):
print(s);
end do:
|
|
|
See Also
|
|
Cox M G (1972a) 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
e02 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|