spli2d Subroutine

subroutine spli2d(tau, gtau, t, n, k, m, work, q, bcoef, iflag)

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

! SPLI2D produces a interpolatory tensor product spline.

Discussion:

SPLI2D is an extended version of SPLINT.

SPLI2D produces the B-spline coefficients BCOEF(J,.) of the 
spline of order K with knots T(1:N+K), which takes on 
the value GTAU(I,J) at TAU(I), I=1,..., N, J=1,...,M.

The I-th equation of the linear system

  A * BCOEF = B

for the B-spline coefficients of the interpolant enforces 
interpolation at TAU(I), I=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.

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.

 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), contains the data point abscissas.
TAU must be strictly increasing

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

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

Input, integer ( kind = 4 ) N, the number of data points and the 
dimension of the spline space SPLINE(K,T)

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

Input, integer ( kind = 4 ) M, the number of data sets.

Work space, real ( kind = 8 ) WORK(N).

Output, real ( kind = 8 ) Q(2*K-1)*N, the triangular 
factorization of the coefficient matrix of the linear 
system for the B-spline coefficients of the spline interpolant.
The B-spline coefficients for the interpolant of an additional 
data set ( TAU(I), HTAU(I) ), I=1,...,N  with the same data 
abscissae can be obtained without going through all the 
calculations in this routine, simply by loading HTAU into 
BCOEF and then using the statement
  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 indicator.
1, no error.   
2, an error occurred, which may have been caused by 
   singularity of the linear system.

Arguments

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

Calls

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