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

« back to all changes in this revision

Viewing changes to Lib/integrate/odepack/mdu.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 mdu
 
2
     *     (ek,dmin, v,l, head,last,next, mark)
 
3
clll. optimize
 
4
c***********************************************************************
 
5
c  mdu -- update degrees of uneliminated vertices in ek
 
6
c***********************************************************************
 
7
      integer  ek, dmin,  v(1), l(1),  head(1), last(1), next(1),
 
8
     *   mark(1),  tag, vi,evi,dvi, s,vs,es, b,vb, ilp,ilpmax,
 
9
     *   blp,blpmax
 
10
      equivalence  (vs, es)
 
11
c
 
12
c----initialize tag
 
13
      tag = mark(ek) - last(ek)
 
14
c
 
15
c----for each vertex vi in ek
 
16
      i = ek
 
17
      ilpmax = last(ek)
 
18
      if (ilpmax.le.0)  go to 11
 
19
      do 10 ilp=1,ilpmax
 
20
        i = l(i)
 
21
        vi = v(i)
 
22
        if (last(vi))  1, 10, 8
 
23
c
 
24
c------if vi neither prototype nor duplicate vertex, then merge elements
 
25
c------to compute degree
 
26
   1      tag = tag + 1
 
27
          dvi = last(ek)
 
28
c
 
29
c--------for each vertex/element vs/es in element list of vi
 
30
          s = l(vi)
 
31
   2      s = l(s)
 
32
          if (s.eq.0)  go to 9
 
33
            vs = v(s)
 
34
            if (next(vs).lt.0)  go to 3
 
35
c
 
36
c----------if vs is uneliminated vertex, then tag and adjust degree
 
37
              mark(vs) = tag
 
38
              dvi = dvi + 1
 
39
              go to 5
 
40
c
 
41
c----------if es is active element, then expand
 
42
c------------check for outmatched vertex
 
43
   3          if (mark(es).lt.0)  go to 6
 
44
c
 
45
c------------for each vertex vb in es
 
46
              b = es
 
47
              blpmax = last(es)
 
48
              do 4 blp=1,blpmax
 
49
                b = l(b)
 
50
                vb = v(b)
 
51
c
 
52
c--------------if vb is untagged, then tag and adjust degree
 
53
                if (mark(vb).ge.tag)  go to 4
 
54
                  mark(vb) = tag
 
55
                  dvi = dvi + 1
 
56
   4            continue
 
57
c
 
58
   5        go to 2
 
59
c
 
60
c------else if vi is outmatched vertex, then adjust overlaps but do not
 
61
c------compute degree
 
62
   6      last(vi) = 0
 
63
          mark(es) = mark(es) - 1
 
64
   7      s = l(s)
 
65
          if (s.eq.0)  go to 10
 
66
            es = v(s)
 
67
            if (mark(es).lt.0)  mark(es) = mark(es) - 1
 
68
            go to 7
 
69
c
 
70
c------else if vi is prototype vertex, then calculate degree by
 
71
c------inclusion/exclusion and reset overlap count
 
72
   8      evi = last(vi)
 
73
          dvi = last(ek) + last(evi) + mark(evi)
 
74
          mark(evi) = 0
 
75
c
 
76
c------insert vi in appropriate degree list
 
77
   9    next(vi) = head(dvi)
 
78
        head(dvi) = vi
 
79
        last(vi) = -dvi
 
80
        if (next(vi).gt.0)  last(next(vi)) = vi
 
81
        if (dvi.lt.dmin)  dmin = dvi
 
82
c
 
83
  10    continue
 
84
c
 
85
  11  return
 
86
      end