48 subroutine ilut(n, a, ja, ia, lfil, droptol, &
49 alu, jlu, ju, iwk, w, jw, ierr, &
54 real(kind=8) :: a(*),alu(*),w(n+1),droptol
55 integer(kind=4) :: ja(*),ia(n+1),jlu(*),ju(n),jw(2*n),lfil,iwk,ierr
57 integer(kind=4) :: izero
165 integer(kind=4) :: ju0,k,j1,j2,j,ii,i,lenl,lenu,jj,jrow,jpos,ilen
166 real(kind=8) :: tnorm, t, abs, s, fact
167 real(kind=8) :: dropsum, diag, sign_check, diag_working
169 character(len=*),
parameter :: fmterr =
"(//,1x,a)"
171 if (lfil .lt. 0)
goto 998
193 tnorm = tnorm+abs(a(k))
195 if (tnorm .eq. 0.0d0)
goto 999
196 tnorm = tnorm/real(j2-j1+1)
214 else if (k .eq. ii)
then
230 if (jj .gt. lenl)
goto 160
241 if (jw(j) .lt. jrow)
then
267 fact = w(jj)*alu(jrow)
268 if (abs(fact) .le. droptol)
then
269 dropsum = dropsum + w(jj)
275 do k = ju(jrow), jlu(jrow+1)-1
283 if (jpos .eq. 0)
then
288 if (lenu .gt. n)
goto 995
297 w(jpos) = w(jpos) - s
304 if (jpos .eq. 0)
then
309 if (lenl .gt. n)
goto 995
317 w(jpos) = w(jpos) - s
340 ilen = min0(lenl,lfil)
344 call qsplit(lenl, w, jw, ilen)
349 if (ju0 .gt. iwk)
goto 996
363 if (abs(w(ii+k)) .gt. droptol*tnorm)
then
366 jw(ii+ilen) = jw(ii+k)
368 dropsum = dropsum + w(ii+k)
372 ilen = min0(lenu,lfil)
374 call qsplit(lenu-1, w(ii+1), jw(ii+1), ilen)
379 if (ilen + ju0 .gt. iwk)
goto 997
380 do k = ii+1, ii+ilen-1
390 diag_working = ( 1.0d0 + delta ) * diag + ( relax * dropsum )
394 sign_check = sign(diag, diag_working)
395 if (sign_check .ne. diag)
then
399 diag_working = sign(1.0d0, diag) * (1.0d-4 + droptol) * tnorm
409 IF (abs(diag_working) == 0.0d0)
THEN
413 diag_working = sign(1.0d0, diag) * (1.0d-4 + droptol) * tnorm
424 alu(ii) = 1.0d0 / w(ii)
465 subroutine lusol(n, y, x, alu, jlu, ju)
468 real(kind=8) :: x(n), y(n), alu(*)
469 integer(kind=4) :: jlu(*), ju(*)
493 integer(kind=4) :: i, k
499 do k = jlu(i), ju(i)-1
500 x(i) = x(i) - alu(k)* x(jlu(k))
507 do k = ju(i), jlu(i+1)-1
508 x(i) = x(i) - alu(k)*x(jlu(k))
523 integer(kind=4) :: ind(n), ncut
534 real(kind=8) :: tmp, abskey
535 integer(kind=4) :: itmp, first, last
536 integer(kind=4) :: mid
541 if (ncut .lt. first .or. ncut .gt. last)
return
548 if (abs(a(j)) .gt. abskey)
then
567 ind(mid) = ind(first)
572 if (mid .eq. ncut)
return
573 if (mid .gt. ncut)
then
subroutine ilut(n, a, ja, ia, lfil, droptol, alu, jlu, ju, iwk, w, jw, ierr, relax, izero, delta)
subroutine qsplit(n, a, ind, ncut)
subroutine lusol(n, y, x, alu, jlu, ju)