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

« back to all changes in this revision

Viewing changes to scipy/interpolate/fitpack/fpbspl.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 fpbspl(t,n,k,x,l,h)
 
2
c  subroutine fpbspl evaluates the (k+1) non-zero b-splines of
 
3
c  degree k at t(l) <= x < t(l+1) using the stable recurrence
 
4
c  relation of de boor and cox.
 
5
c  Travis Oliphant  2007
 
6
c    changed so that weighting of 0 is used when knots with
 
7
c      multiplicity are present.
 
8
c    Also, notice that l+k <= n and 1 <= l+1-k
 
9
c      or else the routine will be accessing memory outside t
 
10
c      Thus it is imperative that that k <= l <= n-k but this
 
11
c      is not checked.
 
12
c  ..
 
13
c  ..scalar arguments..
 
14
      real*8 x
 
15
      integer n,k,l
 
16
c  ..array arguments..
 
17
      real*8 t(n),h(20)
 
18
c  ..local scalars..
 
19
      real*8 f,one
 
20
      integer i,j,li,lj
 
21
c  ..local arrays..
 
22
      real*8 hh(19)
 
23
c  ..
 
24
      one = 0.1d+01
 
25
      h(1) = one
 
26
      do 20 j=1,k
 
27
        do 10 i=1,j
 
28
          hh(i) = h(i)
 
29
  10    continue
 
30
        h(1) = 0.0d0
 
31
        do 20 i=1,j
 
32
          li = l+i
 
33
          lj = li-j
 
34
          if (t(li).ne.t(lj)) goto 15
 
35
          h(i+1) = 0.0d0 
 
36
          goto 20
 
37
  15      f = hh(i)/(t(li)-t(lj)) 
 
38
          h(i) = h(i)+f*(t(li)-x)
 
39
          h(i+1) = f*(x-t(lj))
 
40
  20  continue
 
41
      return
 
42
      end