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

« back to all changes in this revision

Viewing changes to Lib/interpolate/fitpack/fpcyt2.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 fpcyt2(a,n,b,c,nn)
 
2
c subroutine fpcyt2 solves a linear n x n system
 
3
c         a * c = b
 
4
c where matrix a is a cyclic tridiagonal matrix, decomposed
 
5
c using subroutine fpsyt1.
 
6
c  ..
 
7
c  ..scalar arguments..
 
8
      integer n,nn
 
9
c  ..array arguments..
 
10
      real*8 a(nn,6),b(n),c(n)
 
11
c  ..local scalars..
 
12
      real*8 cc,sum
 
13
      integer i,j,j1,n1
 
14
c  ..
 
15
      c(1) = b(1)*a(1,4)
 
16
      sum = c(1)*a(1,5)
 
17
      n1 = n-1
 
18
      do 10 i=2,n1
 
19
         c(i) = (b(i)-a(i,1)*c(i-1))*a(i,4)
 
20
         sum = sum+c(i)*a(i,5)
 
21
  10  continue
 
22
      cc = (b(n)-sum)*a(n,4)
 
23
      c(n) = cc
 
24
      c(n1) = c(n1)-cc*a(n1,6)
 
25
      j = n1
 
26
      do 20 i=3,n
 
27
         j1 = j-1
 
28
         c(j1) = c(j1)-c(j)*a(j1,3)*a(j1,4)-cc*a(j1,6)
 
29
         j = j1
 
30
  20  continue
 
31
      return
 
32
      end