~ubuntu-branches/ubuntu/karmic/python-scipy/karmic

« back to all changes in this revision

Viewing changes to Lib/interpolate/fitpack/fpadpo.f

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T. Chen (new)
  • Date: 2005-03-16 02:15:29 UTC
  • Revision ID: james.westby@ubuntu.com-20050316021529-xrjlowsejs0cijig
Tags: upstream-0.3.2
ImportĀ upstreamĀ versionĀ 0.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine fpadpo(idim,t,n,c,nc,k,cp,np,cc,t1,t2)
 
2
c  given a idim-dimensional spline curve of degree k, in its b-spline
 
3
c  representation ( knots t(j),j=1,...,n , b-spline coefficients c(j),
 
4
c  j=1,...,nc) and given also a polynomial curve in its b-spline
 
5
c  representation ( coefficients cp(j), j=1,...,np), subroutine fpadpo
 
6
c  calculates the b-spline representation (coefficients c(j),j=1,...,nc)
 
7
c  of the sum of the two curves.
 
8
c
 
9
c  other subroutine required : fpinst
 
10
c
 
11
c  ..
 
12
c  ..scalar arguments..
 
13
      integer idim,k,n,nc,np
 
14
c  ..array arguments..
 
15
      real*8 t(n),c(nc),cp(np),cc(nc),t1(n),t2(n)
 
16
c  ..local scalars..
 
17
      integer i,ii,j,jj,k1,l,l1,n1,n2,nk1,nk2
 
18
c  ..
 
19
      k1 = k+1
 
20
      nk1 = n-k1
 
21
c  initialization
 
22
      j = 1
 
23
      l = 1
 
24
      do 20 jj=1,idim
 
25
        l1 = j
 
26
        do 10 ii=1,k1
 
27
          cc(l1) = cp(l)
 
28
          l1 = l1+1
 
29
          l = l+1
 
30
  10    continue
 
31
        j = j+n
 
32
        l = l+k1
 
33
  20  continue
 
34
      if(nk1.eq.k1) go to 70
 
35
      n1 = k1*2
 
36
      j = n
 
37
      l = n1
 
38
      do 30 i=1,k1
 
39
        t1(i) = t(i)
 
40
        t1(l) = t(j)
 
41
        l = l-1
 
42
        j = j-1
 
43
  30  continue
 
44
c  find the b-spline representation of the given polynomial curve
 
45
c  according to the given set of knots.
 
46
      nk2 = nk1-1
 
47
      do 60 l=k1,nk2
 
48
        l1 = l+1
 
49
        j = 1
 
50
        do 40 i=1,idim
 
51
          call fpinst(0,t1,n1,cc(j),k,t(l1),l,t2,n2,cc(j),n)
 
52
          j = j+n
 
53
  40    continue
 
54
        do 50 i=1,n2
 
55
          t1(i) = t2(i)
 
56
  50    continue
 
57
        n1 = n2
 
58
  60  continue
 
59
c  find the b-spline representation of the resulting curve.
 
60
  70  j = 1
 
61
      do 90 jj=1,idim
 
62
        l = j
 
63
        do 80 i=1,nk1
 
64
          c(l) = cc(l)+c(l)
 
65
          l = l+1
 
66
  80    continue
 
67
        j = j+n
 
68
  90  continue
 
69
      return
 
70
      end