BINT4(3)

SYNOPSIS
SUBROUTINE BINT4 (X, Y, NDATA, IBCL, IBCR, FBCL, FBCR, KNTOPT, T, + BCOEF, N, K, W)

NAME
bint4 - Compute the B-representation of a cubic spline which interpolates given data.

LIBRARY
SLATEC

CATEGORY
E1A

TYPE
SINGLE PRECISION (BINT4-S, DBINT4-D)

KEYWORDS
B-SPLINE, CUBIC SPLINES, DATA FITTING, INTERPOLATION

AUTHOR
Amos, D. E., (SNLA)

DESCRIPTION
Abstract BINT4 computes the B representation (T,BCOEF,N,K) of a cubic spline (K=4) which interpolates data (X(I)),Y(I))), I=1,NDATA. Parameters IBCL, IBCR, FBCL, FBCR allow the specification of the spline first or second derivative at both X(1) and X(NDATA). When this data is not specified by the problem, it is common practice to use a natural spline by setting second derivatives at X(1) and X(NDATA) to zero (IBCL=IBCR=2,FBCL=FBCR=0.0). The spline is defined on T(4) .LE. X .LE. T(N+1) with (ordered) interior knots at X(I)) values where N=NDATA+2. The knots T(1), T(2), T(3) lie to the left of T(4)=X(1) and the knots T(N+2), T(N+3), T(N+4) lie to the right of T(N+1)=X(NDATA) in increasing order. If no extrapolation outside (X(1),X(NDATA)) is anticipated, the knots T(1)=T(2)=T(3)=T(4)=X(1) and T(N+2)=T(N+3)=T(N+4)= T(N+1)=X(NDATA) can be specified by KNTOPT=1. KNTOPT=2 selects a knot placement for T(1), T(2), T(3) to make the first 7 knots symmetric about T(4)=X(1) and similarly for T(N+2), T(N+3), T(N+4) about T(N+1)=X(NDATA). KNTOPT=3 allows the user to make his own selection, in increasing order, for T(1), T(2), T(3) to the left of X(1) and T(N+2), T(N+3), T(N+4) to the right of X(NDATA) in the work array W(1) through W(6). In any case, the interpolation on T(4) .LE. X .LE. T(N+1) by using function BVALU is unique for given boundary conditions. Description of Arguments Input X - X vector of abscissae of length NDATA, distinct and in increasing order Y - Y vector of ordinates of length NDATA NDATA - number of data points, NDATA .GE. 2 IBCL - selection parameter for left boundary condition IBCL = 1 constrain the first derivative at X(1) to FBCL = 2 constrain the second derivative at X(1) to FBCL IBCR - selection parameter for right boundary condition IBCR = 1 constrain first derivative at X(NDATA) to FBCR IBCR = 2 constrain second derivative at X(NDATA) to FBCR FBCL - left boundary values governed by IBCL FBCR - right boundary values governed by IBCR KNTOPT - knot selection parameter KNTOPT = 1 sets knot multiplicity at T(4) and T(N+1) to 4 = 2 sets a symmetric placement of knots about T(4) and T(N+1) = 3 sets TNP)=WNP) and T(N+1+I)=w(3+I),I=1,3 where WNP),I=1,6 is supplied by the user W - work array of dimension at least 5*(NDATA+2) if KNTOPT=3, then W(1),W(2),W(3) are knot values to the left of X(1) and W(4),W(5),W(6) are knot values to the right of X(NDATA) in increasing order to be supplied by the user Output T - knot array of length N+4 BCOEF - B-spline coefficient array of length N N - number of coefficients, N=NDATA+2 K - order of spline, K=4 Error Conditions Improper input is a fatal error Singular system of equations is a fatal error

REFERENCES
D. E. Amos, Computation with splines and B-splines, Report SAND78-1968, Sandia Laboratories, March 1979. Carl de Boor, Package for calculating with B-splines, SIAM Journal on Numerical Analysis 14, 3 (June 1977), pp. 441-472. Carl de Boor, A Practical Guide to Splines, Applied Mathematics Series 27, Springer-Verlag, New York, 1978.

ROUTINES CALLED
BNFAC, BNSLV, BSPVD, R1MACH, XERMSG

REVISION HISTORY (YYMMDD)
800901 DATE WRITTEN
890531 Changed all specific intrinsics to generic. (WRB)
890531 REVISION DATE from Version 3.2
891214 Prologue converted to Version 4.0 format. (BAB)
900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
900326 Removed duplicate information from DESCRIPTION section. (WRB)
920501 Reformatted the REFERENCES section. (WRB)