2
* (n, r,c,ic, ia,ja,a, z, b,
3
* lmax,il,jl,ijl,l, d, umax,iu,ju,iju,u,
4
* row, tmp, irl,jrl, flag)
7
c*** numerical ldu-factorization of sparse nonsymmetric matrix and
8
c solution of system of linear equations (compressed pointer
12
c input variables.. n, r, c, ic, ia, ja, a, b,
13
c il, jl, ijl, lmax, iu, ju, iju, umax
14
c output variables.. z, l, d, u, flag
16
c parameters used internally..
17
c nia - irl, - vectors used to find the rows of l. at the kth step
18
c nia - jrl of the factorization, jrl(k) points to the head
19
c - of a linked list in jrl of column indices j
20
c - such j .lt. k and l(k,j) is nonzero. zero
21
c - indicates the end of the list. irl(j) (j.lt.k)
22
c - points to the smallest i such that i .ge. k and
23
c - l(i,j) is nonzero.
25
c fia - row - holds intermediate values in calculation of u and l.
27
c fia - tmp - holds new right-hand side b* for solution of the
31
c internal variables..
32
c jmin, jmax - indices of the first and last positions in a row to
34
c sum - used in calculating tmp.
37
integer r(1), c(1), ic(1), ia(1), ja(1), il(1), jl(1), ijl(1)
38
integer iu(1), ju(1), iju(1), irl(1), jrl(1), flag
39
double precision a(1), l(1), d(1), u(1), z(1), b(1), row(1)
40
double precision tmp(1), lki, sum, dk
42
c ****** initialize pointers and test storage ***********************
43
if(il(n+1)-1 .gt. lmax) go to 104
44
if(iu(n+1)-1 .gt. umax) go to 107
50
c ****** for each row ***********************************************
52
c ****** reverse jrl and zero row where kth row of l will fill in ***
55
if (jrl(k) .eq. 0) go to 3
63
c ****** set row to zero where u will fill in ***********************
65
jmax = jmin + iu(k+1) - iu(k) - 1
66
if (jmin .gt. jmax) go to 5
69
c ****** place kth row of a in row **********************************
76
c ****** initialize sum, and link through jrl ***********************
79
if (i .eq. 0) go to 10
80
c ****** assign the kth row of l and adjust row, sum ****************
82
c ****** if l is not required, then comment out the following line **
84
sum = sum + lki * tmp(i)
87
if (jmin .gt. jmax) go to 9
90
8 row(ju(mu+j)) = row(ju(mu+j)) + lki * u(j)
94
c ****** assign kth row of u and diagonal d, set tmp(k) *************
95
10 if (row(k) .eq. 0.0d0) go to 108
99
if (k .eq. n) go to 19
102
if (jmin .gt. jmax) go to 12
105
11 u(j) = row(ju(mu+j)) * dk
108
c ****** update irl and jrl, keeping jrl in decreasing order ********
110
if (i .eq. 0) go to 18
111
14 irl(i) = irl(i) + 1
113
if (irl(i) .ge. il(i+1)) go to 17
114
ijlb = irl(i) - il(i) + ijl(i)
116
15 if (i .gt. jrl(j)) go to 16
122
if (i .ne. 0) go to 14
123
18 if (irl(k) .ge. il(k+1)) go to 19
129
c ****** solve ux = tmp by back substitution **********************
135
if (jmin .gt. jmax) go to 21
138
20 sum = sum - u(j) * tmp(ju(mu+j))
145
c ** error.. insufficient storage for l
148
c ** error.. insufficient storage for u
151
c ** error.. zero pivot