splint Subroutine

subroutine splint(tau, gtau, t, n, k, q, bcoef, iflag)

************80

! SPLINT produces the B-spline coefficients BCOEF of an interpolating spline.

Discussion:

The spline is of order K with knots T(1:N+K), and takes on the 
value GTAU(I) at TAU(I), for I = 1 to N.

The I-th equation of the linear system

  A * BCOEF = B

for the B-spline coefficients of the interpolant enforces interpolation
at TAU(1:N).

Hence, B(I) = GTAU(I), for all I, and A is a band matrix with 2*K-1
bands, if it is invertible.

The matrix A is generated row by row and stored, diagonal by diagonal,
in the rows of the array Q, with the main diagonal going
into row K.  See comments in the program.

The banded system is then solved by a call to BANFAC, which 
constructs the triangular factorization for A and stores it again in
Q, followed by a call to BANSLV, which then obtains the solution
BCOEF by substitution.

BANFAC does no pivoting, since the total positivity of the matrix
A makes this unnecessary.

The linear system to be solved is (theoretically) invertible if
and only if
  T(I) < TAU(I) < TAU(I+K), for all I.
Violation of this condition is certain to lead to IFLAG = 2.

Modified:

14 February 2007

Author:

Carl DeBoor

Reference:

Carl DeBoor,
A Practical Guide to Splines,
Springer, 2001,
ISBN: 0387953663,
LC: QA1.A647.v27.

Parameters:

Input, real ( kind = 8 ) TAU(N), the data point abscissas.  The entries in
TAU should be strictly increasing.

Input, real ( kind = 8 ) GTAU(N), the data ordinates.

Input, real ( kind = 8 ) T(N+K), the knot sequence.

Input, integer ( kind = 4 ) N, the number of data points.

Input, integer ( kind = 4 ) K, the order of the spline.

Output, real ( kind = 8 ) Q((2*K-1)*N), the triangular factorization
of the coefficient matrix of the linear system for the B-coefficients 
of the spline interpolant.  The B-coefficients for the interpolant 
of an additional data set can be obtained without going through all 
the calculations in this routine, simply by loading HTAU into BCOEF 
and then executing the call:
  call banslv ( q, 2*k-1, n, k-1, k-1, bcoef )

Output, real ( kind = 8 ) BCOEF(N), the B-spline coefficients of 
the interpolant.

Output, integer ( kind = 4 ) IFLAG, error flag.
1, = success.
2, = failure.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: tau(n)
real(kind=8) :: gtau(n)
real(kind=8) :: t(n+k)
integer(kind=4) :: n
integer(kind=4) :: k
real(kind=8) :: q((2*k-1)*n)
real(kind=8) :: bcoef(n)
integer(kind=4) :: iflag

Calls

proc~~splint~2~~CallsGraph proc~splint~2 splint banfac banfac proc~splint~2->banfac banslv banslv proc~splint~2->banslv bsplvb bsplvb proc~splint~2->bsplvb