bvalue Function

function bvalue(t, bcoef, n, k, x, jderiv)

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

! BVALUE evaluates a derivative of a spline from its B-spline representation.

Discussion:

The spline is taken to be continuous from the right.

The nontrivial knot interval (T(I),T(I+1)) containing X is 
located with the aid of INTERV.  The K B-spline coefficients 
of F relevant for this interval are then obtained from BCOEF, 
or are taken to be zero if not explicitly available, and are 
then differenced JDERIV times to obtain the B-spline 
coefficients of (D**JDERIV)F relevant for that interval.

Precisely, with J = JDERIV, we have from X.(12) of the text that:

  (D**J)F = sum ( BCOEF(.,J)*B(.,K-J,T) )

where
                  / BCOEF(.),                    if J == 0
                 /
   BCOEF(.,J) = / BCOEF(.,J-1) - BCOEF(.-1,J-1)
               / -----------------------------,  if 0 < J
              /    (T(.+K-J) - T(.))/(K-J)

Then, we use repeatedly the fact that

  sum ( A(.) * B(.,M,T)(X) ) = sum ( A(.,X) * B(.,M-1,T)(X) )

with
               (X - T(.))*A(.) + (T(.+M-1) - X)*A(.-1)
  A(.,X) =   ---------------------------------------
               (X - T(.))      + (T(.+M-1) - X)

to write (D**J)F(X) eventually as a linear combination of 
B-splines of order 1, and the coefficient for B(I,1,T)(X) 
must then be the desired number (D**J)F(X).
See Chapter X, (17)-(19) of text.

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 ) T(N+K), the knot sequence.  T is assumed 
to be nondecreasing.

Input, real ( kind = 8 ) BCOEF(N), B-spline coefficient sequence.

Input, integer ( kind = 4 ) N, the length of BCOEF.

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

Input, real ( kind = 8 ) X, the point at which to evaluate.

Input, integer ( kind = 4 ) JDERIV, the order of the derivative to 
be evaluated.  JDERIV is assumed to be zero or positive.

Output, real ( kind = 8 ) BVALUE, the value of the (JDERIV)-th 
derivative of the spline at X.

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: t(n+k)
real(kind=8) :: bcoef(n)
integer(kind=4) :: n
integer(kind=4) :: k
real(kind=8) :: x
integer(kind=4) :: jderiv

Return Value real(kind=8)


Calls

proc~~bvalue~2~~CallsGraph proc~bvalue~2 bvalue interv interv proc~bvalue~2->interv