gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
setupq.f
Go to the documentation of this file.
1  subroutine setupq ( x, dx, y, npoint, v, qty )
2 
3 c*********************************************************************72
4 c
5 cc SETUPQ is to be called in SMOOTH.
6 c
7 c from * a practical guide to splines * by c. de boor
8 c to be called in s m o o t h
9 c put delx = x(.+1) - x(.) into v(.,4),
10 c put the three bands of q-transp*d into v(.,1-3), and
11 c put the three bands of (d*q)-transp*(d*q) at and above the diagonal
12 c into v(.,5-7) .
13 c here, q is the tridiagonal matrix of order (npoint-2,npoint)
14 c with general row 1/delx(i) , -1/delx(i) - 1/delx(i+1) , 1/delx(i+1)
15 c and d is the diagonal matrix with general row dx(i) .
16 c
17  implicit none
18 
19  integer npoint, i,npm1
20  double precision dx(npoint),qty(npoint),v(npoint,7),
21  & x(npoint),y(npoint),
22  & diff,prev
23  npm1 = npoint - 1
24  v(1,4) = x(2) - x(1)
25  do 11 i=2,npm1
26  v(i,4) = x(i+1) - x(i)
27  v(i,1) = dx(i-1)/v(i-1,4)
28  v(i,2) = - dx(i)/v(i,4) - dx(i)/v(i-1,4)
29  11 v(i,3) = dx(i+1)/v(i,4)
30  v(npoint,1) = 0.0d+00
31  do 12 i=2,npm1
32  12 v(i,5) = v(i,1)**2 + v(i,2)**2 + v(i,3)**2
33  if (npm1 .lt. 3) go to 14
34  do 13 i=3,npm1
35  13 v(i-1,6) = v(i-1,2)*v(i,1) + v(i-1,3)*v(i,2)
36  14 v(npm1,6) = 0.0d+00
37  if (npm1 .lt. 4) go to 16
38  do 15 i=4,npm1
39  15 v(i-2,7) = v(i-2,3)*v(i,1)
40  16 v(npm1-1,7) = 0.0d+00
41  v(npm1,7) = 0.0d+00
42 construct q-transp. * y in qty.
43  prev = (y(2) - y(1))/v(1,4)
44  do 21 i=2,npm1
45  diff = (y(i+1)-y(i))/v(i,4)
46  qty(i) = diff - prev
47  21 prev = diff
48  return
49  end
float * x
subroutine setupq(x, dx, y, npoint, v, qty)
Definition: setupq.f:2
float * y
gtkIOStream: /tmp/gtkiostream/src/deBoor/setupq.f Source File
GTK+ IOStream  Beta