1
subroutine parder(tx,nx,ty,ny,c,kx,ky,nux,nuy,x,mx,y,my,z,
2
* wrk,lwrk,iwrk,kwrk,ier)
3
c subroutine parder evaluates on a grid (x(i),y(j)),i=1,...,mx; j=1,...
4
c ,my the partial derivative ( order nux,nuy) of a bivariate spline
5
c s(x,y) of degrees kx and ky, given in the b-spline representation.
8
c call parder(tx,nx,ty,ny,c,kx,ky,nux,nuy,x,mx,y,my,z,wrk,lwrk,
12
c tx : real array, length nx, which contains the position of the
13
c knots in the x-direction.
14
c nx : integer, giving the total number of knots in the x-direction
15
c ty : real array, length ny, which contains the position of the
16
c knots in the y-direction.
17
c ny : integer, giving the total number of knots in the y-direction
18
c c : real array, length (nx-kx-1)*(ny-ky-1), which contains the
19
c b-spline coefficients.
20
c kx,ky : integer values, giving the degrees of the spline.
21
c nux : integer values, specifying the order of the partial
22
c nuy derivative. 0<=nux<kx, 0<=nuy<ky.
23
c x : real array of dimension (mx).
24
c before entry x(i) must be set to the x co-ordinate of the
25
c i-th grid point along the x-axis.
26
c tx(kx+1)<=x(i-1)<=x(i)<=tx(nx-kx), i=2,...,mx.
27
c mx : on entry mx must specify the number of grid points along
29
c y : real array of dimension (my).
30
c before entry y(j) must be set to the y co-ordinate of the
31
c j-th grid point along the y-axis.
32
c ty(ky+1)<=y(j-1)<=y(j)<=ty(ny-ky), j=2,...,my.
33
c my : on entry my must specify the number of grid points along
35
c wrk : real array of dimension lwrk. used as workspace.
36
c lwrk : integer, specifying the dimension of wrk.
37
c lwrk >= mx*(kx+1-nux)+my*(ky+1-nuy)+(nx-kx-1)*(ny-ky-1)
38
c iwrk : integer array of dimension kwrk. used as workspace.
39
c kwrk : integer, specifying the dimension of iwrk. kwrk >= mx+my.
42
c z : real array of dimension (mx*my).
43
c on succesful exit z(my*(i-1)+j) contains the value of the
44
c specified partial derivative of s(x,y) at the point
45
c (x(i),y(j)),i=1,...,mx;j=1,...,my.
46
c ier : integer error flag
47
c ier=0 : normal return
48
c ier=10: invalid input data (see restrictions)
51
c mx >=1, my >=1, 0 <= nux < kx, 0 <= nuy < ky, kwrk>=mx+my
52
c lwrk>=mx*(kx+1-nux)+my*(ky+1-nuy)+(nx-kx-1)*(ny-ky-1),
53
c tx(kx+1) <= x(i-1) <= x(i) <= tx(nx-kx), i=2,...,mx
54
c ty(ky+1) <= y(j-1) <= y(j) <= ty(ny-ky), j=2,...,my
56
c other subroutines required:
60
c de boor c : on calculating with b-splines, j. approximation theory
62
c dierckx p. : curve and surface fitting with splines, monographs on
63
c numerical analysis, oxford university press, 1993.
67
c dept. computer science, k.u.leuven
68
c celestijnenlaan 200a, b-3001 heverlee, belgium.
69
c e-mail : Paul.Dierckx@cs.kuleuven.ac.be
71
c latest update : march 1989
73
c ..scalar arguments..
74
integer nx,ny,kx,ky,nux,nuy,mx,my,lwrk,kwrk,ier
77
real*8 tx(nx),ty(ny),c((nx-kx-1)*(ny-ky-1)),x(mx),y(my),z(mx*my),
80
integer i,iwx,iwy,j,kkx,kky,kx1,ky1,lx,ly,lwest,l1,l2,m,m0,m1,
81
* nc,nkx1,nky1,nxx,nyy
84
c before starting computations a data check is made. if the input data
85
c are invalid control is immediately repassed to the calling program.
92
if(nux.lt.0 .or. nux.ge.kx) go to 400
93
if(nuy.lt.0 .or. nuy.ge.ky) go to 400
94
lwest = nc +(kx1-nux)*mx+(ky1-nuy)*my
95
if(lwrk.lt.lwest) go to 400
96
if(kwrk.lt.(mx+my)) go to 400
97
if (mx.lt.1) go to 400
101
if(x(i).lt.x(i-1)) go to 400
103
30 if (my.lt.1) go to 400
104
if (my.eq.1) go to 60
107
if(y(i).lt.y(i-1)) go to 400
114
c the partial derivative of order (nux,nuy) of a bivariate spline of
115
c degrees kx,ky is a bivariate spline of degrees kx-nux,ky-nuy.
116
c we calculate the b-spline coefficients of this spline
120
if(nux.eq.0) go to 200
131
if(fac.le.0.) go to 90
134
wrk(m0) = (wrk(m1)-wrk(m0))*ak/fac
141
200 if(nuy.eq.0) go to 300
151
if(fac.le.0.) go to 220
155
wrk(m0) = (wrk(m1)-wrk(m0))*ak/fac
172
c we partition the working space and evaluate the partial derivative
174
iwy = iwx+mx*(kx1-nux)
175
call fpbisp(tx(nux+1),nx-2*nux,ty(nuy+1),ny-2*nuy,wrk,kkx,kky,
176
* x,mx,y,my,z,wrk(iwx),wrk(iwy),iwrk(1),iwrk(mx+1))