gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
ppvalu.f
Go to the documentation of this file.
1  double precision function ppvalu (break, coef, l, k, x, jderiv )
2 
3 c*********************************************************************72
4 c
5 cc PPVALU evaluates a piecewise polynomial function or its derivative.
6 c
7 c from * a practical guide to splines * by c. de boor
8 calls interv
9 calculates value at x of jderiv-th derivative of pp fct from pp-repr
10 c
11 c****** i n p u t ******
12 c break, coef, l, k.....forms the pp-representation of the function f
13 c to be evaluated. specifically, the j-th derivative of f is
14 c given by
15 c
16 c (d**j)f(x) = coef(j+1,i) + h*(coef(j+2,i) + h*( ... (coef(k-1,i) +
17 c + h*coef(k,i)/(k-j-1))/(k-j-2) ... )/2)/1
18 c
19 c with h = x - break(i), and
20 c
21 c i = max( 1 , max( j , break(j) .le. x , 1 .le. j .le. l ) ).
22 c
23 c x.....the point at which to evaluate.
24 c jderiv.....integer giving the order of the derivative to be evaluat-
25 c ed. a s s u m e d to be zero or positive.
26 c
27 c****** o u t p u t ******
28 c ppvalu.....the value of the (jderiv)-th derivative of f at x.
29 c
30 c****** m e t h o d ******
31 c the interval index i , appropriate for x , is found through a
32 c call to interv . the formula above for the jderiv-th derivative
33 c of f is then evaluated (by nested multiplication).
34 c
35  implicit none
36 
37  integer jderiv,k,l, i,m,ndummy
38  double precision break(l+1),coef(k,l),x, fmmjdr,h
39  ppvalu = 0.0d+00
40  fmmjdr = k - jderiv
41 c derivatives of order k or higher are identically zero.
42  if (fmmjdr .le. 0.0d+00) go to 99
43 c
44 c find index i of largest breakpoint to the left of x .
45  call interv ( break, l+1, x, i, ndummy )
46 c
47 c Evaluate jderiv-th derivative of i-th polynomial piece at x .
48  h = x - break(i)
49  m = k
50  9 ppvalu = (ppvalu/fmmjdr)*h + coef(m,i)
51  m = m - 1
52  fmmjdr = fmmjdr - 1.0d+00
53  if (fmmjdr .gt. 0.0d+00) go to 9
54  99 return
55  end
double precision function ppvalu(break, coef, l, k, x, jderiv)
Definition: ppvalu.f:2
subroutine interv(xt, lxt, x, left, mflag)
Definition: interv.f:2
gtkIOStream: /tmp/gtkiostream/src/deBoor/ppvalu.f Source File
GTK+ IOStream  Beta