~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to routines/metanet/pcchna.f

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine pcchna(i0,lp,ls,m,n,pan,pani,pile)
 
2
      implicit integer (a-z)
 
3
      dimension lp(*),ls(m),pani(n),pan(n),pile(n)
 
4
      infe=32700
 
5
      if (i0 .lt. 0 .or. i0 .gt. n) then
 
6
         call erro('bad internal node number')
 
7
         return
 
8
      endif
 
9
      do 10 i=1,n
 
10
         pani(i)=infe
 
11
         pan(i)=-infe
 
12
         pile(i)=0
 
13
 10   continue
 
14
      top=0
 
15
      bottom=0
 
16
      pani(i0)=0
 
17
      pan(i0)=0
 
18
      j=i0
 
19
 100  continue
 
20
      if(lp(j).eq.lp(j+1))goto 120
 
21
      do 110 ll=lp(j),lp(j+1)-1
 
22
         i=ls(ll)
 
23
         if(pan(i).ge.0)goto 110
 
24
         pani(i)=pani(j)+1
 
25
         pan(i)=j
 
26
         top=top+1
 
27
         pile(top)=i
 
28
 110  continue
 
29
 120  continue
 
30
      bottom=bottom + 1
 
31
      if(bottom.gt.top) go to 999
 
32
      j=pile(bottom)
 
33
      goto 100
 
34
 999  continue
 
35
      do 20,i=1,n
 
36
         if (pani(i) .eq. infe) then
 
37
            pani(i)=-1
 
38
         endif
 
39
 20   continue
 
40
      end
 
41
 
 
42