~ubuntu-branches/ubuntu/saucy/python-scipy/saucy

« back to all changes in this revision

Viewing changes to scipy/interpolate/fitpack/surev.f

  • Committer: Bazaar Package Importer
  • Author(s): Ondrej Certik
  • Date: 2008-06-16 22:58:01 UTC
  • mfrom: (2.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080616225801-irdhrpcwiocfbcmt
Tags: 0.6.0-12
* The description updated to match the current SciPy (Closes: #489149).
* Standards-Version bumped to 3.8.0 (no action needed)
* Build-Depends: netcdf-dev changed to libnetcdf-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine surev(idim,tu,nu,tv,nv,c,u,mu,v,mv,f,mf,wrk,lwrk,
 
2
     * iwrk,kwrk,ier)
 
3
c  subroutine surev evaluates on a grid (u(i),v(j)),i=1,...,mu; j=1,...
 
4
c  ,mv a bicubic spline surface of dimension idim, given in the
 
5
c  b-spline representation.
 
6
c
 
7
c  calling sequence:
 
8
c     call surev(idim,tu,nu,tv,nv,c,u,mu,v,mv,f,mf,wrk,lwrk,
 
9
c    * iwrk,kwrk,ier)
 
10
c
 
11
c  input parameters:
 
12
c   idim  : integer, specifying the dimension of the spline surface.
 
13
c   tu    : real array, length nu, which contains the position of the
 
14
c           knots in the u-direction.
 
15
c   nu    : integer, giving the total number of knots in the u-direction
 
16
c   tv    : real array, length nv, which contains the position of the
 
17
c           knots in the v-direction.
 
18
c   nv    : integer, giving the total number of knots in the v-direction
 
19
c   c     : real array, length (nu-4)*(nv-4)*idim, which contains the
 
20
c           b-spline coefficients.
 
21
c   u     : real array of dimension (mu).
 
22
c           before entry u(i) must be set to the u co-ordinate of the
 
23
c           i-th grid point along the u-axis.
 
24
c           tu(4)<=u(i-1)<=u(i)<=tu(nu-3), i=2,...,mu.
 
25
c   mu    : on entry mu must specify the number of grid points along
 
26
c           the u-axis. mu >=1.
 
27
c   v     : real array of dimension (mv).
 
28
c           before entry v(j) must be set to the v co-ordinate of the
 
29
c           j-th grid point along the v-axis.
 
30
c           tv(4)<=v(j-1)<=v(j)<=tv(nv-3), j=2,...,mv.
 
31
c   mv    : on entry mv must specify the number of grid points along
 
32
c           the v-axis. mv >=1.
 
33
c   mf    : on entry, mf must specify the dimension of the array f.
 
34
c           mf >= mu*mv*idim
 
35
c   wrk   : real array of dimension lwrk. used as workspace.
 
36
c   lwrk  : integer, specifying the dimension of wrk.
 
37
c           lwrk >= 4*(mu+mv)
 
38
c   iwrk  : integer array of dimension kwrk. used as workspace.
 
39
c   kwrk  : integer, specifying the dimension of iwrk. kwrk >= mu+mv.
 
40
c
 
41
c  output parameters:
 
42
c   f     : real array of dimension (mf).
 
43
c           on succesful exit f(mu*mv*(l-1)+mv*(i-1)+j) contains the
 
44
c           l-th co-ordinate of the bicubic spline surface at the
 
45
c           point (u(i),v(j)),l=1,...,idim,i=1,...,mu;j=1,...,mv.
 
46
c   ier   : integer error flag
 
47
c    ier=0 : normal return
 
48
c    ier=10: invalid input data (see restrictions)
 
49
c
 
50
c  restrictions:
 
51
c   mu >=1, mv >=1, lwrk>=4*(mu+mv), kwrk>=mu+mv , mf>=mu*mv*idim
 
52
c   tu(4) <= u(i-1) <= u(i) <= tu(nu-3), i=2,...,mu
 
53
c   tv(4) <= v(j-1) <= v(j) <= tv(nv-3), j=2,...,mv
 
54
c
 
55
c  other subroutines required:
 
56
c    fpsuev,fpbspl
 
57
c
 
58
c  references :
 
59
c    de boor c : on calculating with b-splines, j. approximation theory
 
60
c                6 (1972) 50-62.
 
61
c    cox m.g.  : the numerical evaluation of b-splines, j. inst. maths
 
62
c                applics 10 (1972) 134-149.
 
63
c    dierckx p. : curve and surface fitting with splines, monographs on
 
64
c                 numerical analysis, oxford university press, 1993.
 
65
c
 
66
c  author :
 
67
c    p.dierckx
 
68
c    dept. computer science, k.u.leuven
 
69
c    celestijnenlaan 200a, b-3001 heverlee, belgium.
 
70
c    e-mail : Paul.Dierckx@cs.kuleuven.ac.be
 
71
c
 
72
c  latest update : march 1987
 
73
c
 
74
c  ..scalar arguments..
 
75
      integer idim,nu,nv,mu,mv,mf,lwrk,kwrk,ier
 
76
c  ..array arguments..
 
77
      integer iwrk(kwrk)
 
78
      real*8 tu(nu),tv(nv),c((nu-4)*(nv-4)*idim),u(mu),v(mv),f(mf),
 
79
     * wrk(lwrk)
 
80
c  ..local scalars..
 
81
      integer i,muv
 
82
c  ..
 
83
c  before starting computations a data check is made. if the input data
 
84
c  are invalid control is immediately repassed to the calling program.
 
85
      ier = 10
 
86
      if(mf.lt.mu*mv*idim) go to 100
 
87
      muv = mu+mv
 
88
      if(lwrk.lt.4*muv) go to 100
 
89
      if(kwrk.lt.muv) go to 100
 
90
      if (mu.lt.1) go to 100
 
91
      if (mu.eq.1) go to 30
 
92
      go to 10
 
93
  10  do 20 i=2,mu
 
94
        if(u(i).lt.u(i-1)) go to 100
 
95
  20  continue
 
96
  30  if (mv.lt.1) go to 100
 
97
      if (mv.eq.1) go to 60
 
98
      go to 40
 
99
  40  do 50 i=2,mv
 
100
        if(v(i).lt.v(i-1)) go to 100
 
101
  50  continue
 
102
  60  ier = 0
 
103
      call fpsuev(idim,tu,nu,tv,nv,c,u,mu,v,mv,f,wrk(1),wrk(4*mu+1),
 
104
     * iwrk(1),iwrk(mu+1))
 
105
 100  return
 
106
      end