When the matrix being factored was not full rank, it seemed the updates were not being fully applied.
It looks like the problem comes from the following code in the lu8mod function:
120 if (nrank .lt. m) then
nrank = nrank + 1
jelm = 0
call lu7elm( m, n, jelm, v,
$ lena, luparm, parmlu,
$ lenl, lenu, lrow, nrank,
$ a, indc, indr, ip, iq, lenr, locc, locr,
$ inform, diag )
if (inform .eq. 7) go to 970
if (inform .eq. 0) nrank = nrank - 1
end if
I don't think nrank should be incremented before the call to lu7elm. lu7elm already increments nrank. Incrementing it beforehand causes nrank to be incremented twice which causes lu7elm to miss an element when performing the elimination.
I believe the problem can be fixed by changing the above code to
120 if (nrank .lt. m) then
jelm = 0
call lu7elm( m, n, jelm, v,
$ lena, luparm, parmlu,
$ lenl, lenu, lrow, nrank,
$ a, indc, indr, ip, iq, lenr, locc, locr,
$ inform, diag )
if (inform .eq. 7) go to 970
if (inform .eq. 1) nrank = nrank + 1
end if
So that nrank is updated after the call to lu7elm.
When the matrix being factored was not full rank, it seemed the updates were not being fully applied.
It looks like the problem comes from the following code in the lu8mod function:
I don't think nrank should be incremented before the call to lu7elm. lu7elm already increments nrank. Incrementing it beforehand causes nrank to be incremented twice which causes lu7elm to miss an element when performing the elimination.
I believe the problem can be fixed by changing the above code to
So that nrank is updated after the call to lu7elm.