2 * (n
, r
, ic
, ia
,ja
, jlmax
,il
,jl
,ijl
, jumax
,iu
,ju
,iju
,
3 * q
, ira
,jra
, irac
, irl
,jrl
, iru
,jru
, flag
)
5 c*** symbolic ldu-factorization of nonsymmetric sparse matrix
6 c (compressed pointer storage)
9 c input variables.. n, r, ic, ia, ja, jlmax, jumax.
10 c output variables.. il, jl, ijl, iu, ju, iju, flag.
12 c parameters used internally..
13 c nia - q - suppose m* is the result of reordering m. if
14 c - processing of the ith row of m* (hence the ith
15 c - row of u) is being done, q(j) is initially
16 c - nonzero if m*(i,j) is nonzero (j.ge.i). since
17 c - values need not be stored, each entry points to the
18 c - next nonzero and q(n+1) points to the first. n+1
19 c - indicates the end of the list. for example, if n=9
20 c - and the 5th row of m* is
22 c - then q will initially be
23 c - a a a a 8 a a 10 5 (a - arbitrary).
24 c - as the algorithm proceeds, other elements of q
25 c - are inserted in the list because of fillin.
26 c - q is used in an analogous manner to compute the
29 c nia - ira, - vectors used to find the columns of m. at the kth
30 c nia - jra, step of the factorization, irac(k) points to the
31 c nia - irac head of a linked list in jra of row indices i
32 c - such that i .ge. k and m(i,k) is nonzero. zero
33 c - indicates the end of the list. ira(i) (i.ge.k)
34 c - points to the smallest j such that j .ge. k and
35 c - m(i,j) is nonzero.
37 c nia - irl, - vectors used to find the rows of l. at the kth step
38 c nia - jrl of the factorization, jrl(k) points to the head
39 c - of a linked list in jrl of column indices j
40 c - such j .lt. k and l(k,j) is nonzero. zero
41 c - indicates the end of the list. irl(j) (j.lt.k)
42 c - points to the smallest i such that i .ge. k and
43 c - l(i,j) is nonzero.
45 c nia - iru, - vectors used in a manner analogous to irl and jrl
46 c nia - jru to find the columns of u.
49 c internal variables..
50 c jlptr - points to the last position used in jl.
51 c juptr - points to the last position used in ju.
52 c jmin,jmax - are the indices in a or u of the first and last
53 c elements to be examined in a given row.
54 c for example, jmin=ia(k), jmax=ia(k+1)-1.
56 integer cend
, qm
, rend
, rk
, vj
57 integer ia
(*), ja
(*), ira
(*), jra
(*), il
(*), jl
(*), ijl
(*)
58 integer iu
(*), ju
(*), iju
(*), irl
(*), jrl
(*), iru
(*), jru
(*)
59 integer r
(*), ic
(*), q
(*), irac
(*), flag
61 c ****** initialize pointers ****************************************
74 c ****** initialize column pointers for a ***************************
78 if (iak
.ge
. ia
(rk
+1)) go to 101
80 if (jaiak
.gt
. k
) go to 105
85 c ****** for each column of l and row of u **************************
88 c ****** initialize q for computing kth column of l *****************
91 c ****** by filling in kth column of a ******************************
93 if (vj
.eq
. 0) go to 5
97 if (qm
.lt
. vj
) go to 4
98 if (qm
.eq
. vj
) go to 102
103 if (vj
.ne
. 0) go to 3
104 c ****** link through jru *******************************************
110 if (i
.eq
. 0) go to 10
113 jmax
= ijl
(i
) + il
(i
+1) - il
(i
) - 1
115 if (long
.lt
. 0) go to 6
117 if (jtmp
.ne
. k
) long
= long
+ 1
118 if (jtmp
.eq
. k
) r
(i
) = -r
(i
)
119 if (lastid
.ge
. long
) go to 7
122 c ****** and merge the corresponding columns into the kth column ****
127 if (qm
.lt
. vj
) go to 8
128 if (qm
.eq
. vj
) go to 9
135 c ****** lasti is the longest column merged into the kth ************
136 c ****** see if it equals the entire kth column *********************
138 if (qm
.ne
. k
) go to 105
139 if (luk
.eq
. 0) go to 17
140 if (lastid
.ne
. luk
) go to 11
141 c ****** if so, jl can be compressed ********************************
144 if (jl
(irll
) .ne
. k
) ijl
(k
) = ijl
(k
) - 1
146 c ****** if not, see if kth column can overlap the previous one *****
147 11 if (jlmin
.gt
. jlptr
) go to 15
150 if (jl
(j
) - qm
) 12, 13, 15
155 if (jl
(i
) .ne
. qm
) go to 15
157 if (qm
.gt
. n
) go to 17
160 c ****** move column indices from q to jl, update vectors ***********
163 if (luk
.eq
. 0) go to 17
165 if (jlptr
.gt
. jlmax
) go to 103
171 il
(k
+1) = il
(k
) + luk
173 c ****** initialize q for computing kth row of u ********************
176 c ****** by filling in kth row of reordered a ***********************
180 if (jmin
.gt
. jmax
) go to 20
186 if (qm
.lt
. vj
) go to 18
187 if (qm
.eq
. vj
) go to 102
192 c ****** link through jrl, ******************************************
199 if (i
.eq
. 0) go to 26
203 jmax
= iju
(i
) + iu
(i
+1) - iu
(i
) - 1
205 if (long
.lt
. 0) go to 21
207 if (jtmp
.eq
. k
) go to 22
208 c ****** update irl and jrl, *****************************************
210 cend
= ijl
(i
) + il
(i
+1) - il
(i
)
212 if (irl
(i
) .ge
. cend
) go to 22
216 22 if (lastid
.ge
. long
) go to 23
219 c ****** and merge the corresponding rows into the kth row **********
224 if (qm
.lt
. vj
) go to 24
225 if (qm
.eq
. vj
) go to 25
232 c ****** update jrl(k) and irl(k) ***********************************
233 26 if (il
(k
+1) .le
. il
(k
)) go to 27
237 c ****** lasti is the longest row merged into the kth ***************
238 c ****** see if it equals the entire kth row ************************
240 if (qm
.ne
. k
) go to 105
241 if (luk
.eq
. 0) go to 34
242 if (lastid
.ne
. luk
) go to 28
243 c ****** if so, ju can be compressed ********************************
246 if (ju
(irul
) .ne
. k
) iju
(k
) = iju
(k
) - 1
248 c ****** if not, see if kth row can overlap the previous one ********
249 28 if (jumin
.gt
. juptr
) go to 32
252 if (ju
(j
) - qm
) 29, 30, 32
257 if (ju
(i
) .ne
. qm
) go to 32
259 if (qm
.gt
. n
) go to 34
262 c ****** move row indices from q to ju, update vectors **************
265 if (luk
.eq
. 0) go to 34
267 if (juptr
.gt
. jumax
) go to 106
273 iu
(k
+1) = iu
(k
) + luk
275 c ****** update iru, jru ********************************************
278 if (r
(i
) .lt
. 0) go to 36
279 rend
= iju
(i
) + iu
(i
+1) - iu
(i
)
280 if (iru
(i
) .ge
. rend
) go to 37
287 if (i
.eq
. 0) go to 38
291 c ****** update ira, jra, irac **************************************
293 if (i
.eq
. 0) go to 41
296 if (ira
(i
) .ge
. ia
(r
(i
)+1)) go to 40
298 jairai
= ic
(ja
(irai
))
299 if (jairai
.gt
. i
) go to 40
300 jra
(i
) = irac
(jairai
)
303 if (i
.ne
. 0) go to 39
311 c ** error.. null row in a
314 c ** error.. duplicate entry in a
317 c ** error.. insufficient storage for jl
320 c ** error.. null pivot
323 c ** error.. insufficient storage for ju