Forgot to load lapack in a few examples
[maxima.git] / share / odepack / fortran / mdp.f
blobd9367f9c957152781802ee3462e222025cb5de2e
1 subroutine mdp
2 * (k,ek,tail, v,l, head,last,next, mark)
3 c***********************************************************************
4 c mdp -- purge inactive elements and do mass elimination
5 c***********************************************************************
6 integer ek, tail, v(*), l(*), head(*), last(*), next(*),
7 * mark(*), tag, free, li,vi,lvi,evi, s,ls,es, ilp,ilpmax
9 c----initialize tag
10 tag = mark(ek)
12 c----for each vertex vi in ek
13 li = ek
14 ilpmax = last(ek)
15 if (ilpmax.le.0) go to 12
16 do 11 ilp=1,ilpmax
17 i = li
18 li = l(i)
19 vi = v(li)
21 c------remove vi from degree list
22 if (last(vi).eq.0) go to 3
23 if (last(vi).gt.0) go to 1
24 head(-last(vi)) = next(vi)
25 go to 2
26 1 next(last(vi)) = next(vi)
27 2 if (next(vi).gt.0) last(next(vi)) = last(vi)
29 c------remove inactive items from element list of vi
30 3 ls = vi
31 4 s = ls
32 ls = l(s)
33 if (ls.eq.0) go to 6
34 es = v(ls)
35 if (mark(es).lt.tag) go to 5
36 free = ls
37 l(s) = l(ls)
38 ls = s
39 5 go to 4
41 c------if vi is interior vertex, then remove from list and eliminate
42 6 lvi = l(vi)
43 if (lvi.ne.0) go to 7
44 l(i) = l(li)
45 li = i
47 k = k+1
48 next(vi) = -k
49 last(ek) = last(ek) - 1
50 go to 11
52 c------else ...
53 c--------classify vertex vi
54 7 if (l(lvi).ne.0) go to 9
55 evi = v(lvi)
56 if (next(evi).ge.0) go to 9
57 if (mark(evi).lt.0) go to 8
59 c----------if vi is prototype vertex, then mark as such, initialize
60 c----------overlap count for corresponding element, and move vi to end
61 c----------of boundary list
62 last(vi) = evi
63 mark(evi) = -1
64 l(tail) = li
65 tail = li
66 l(i) = l(li)
67 li = i
68 go to 10
70 c----------else if vi is duplicate vertex, then mark as such and adjust
71 c----------overlap count for corresponding element
72 8 last(vi) = 0
73 mark(evi) = mark(evi) - 1
74 go to 10
76 c----------else mark vi to compute degree
77 9 last(vi) = -ek
79 c--------insert ek in element list of vi
80 10 v(free) = ek
81 l(free) = l(vi)
82 l(vi) = free
83 11 continue
85 c----terminate boundary list
86 12 l(tail) = 0
88 return
89 end