From bug-octave-request at bevo dot che dot wisc dot edu Thu Jun 7 13:58:39 2001 Subject: Re: det() hangs on large matrix From: "John W. Eaton" To: Christoph Spiel Cc: bug-octave at bevo dot che dot wisc dot edu Date: Thu, 7 Jun 2001 13:57:54 -0500 On 7-Jun-2001, Christoph Spiel wrote: | On Tue, Jun 05, 2001 at 11:33:52AM -0500, John W. Eaton wrote: | > Octave uses DGEDI from Linpack to compute the determinant. The | > problem is that in this loop in DGEDI, | > | > 30 IF (DABS(DET(1)) .LT. TEN) GO TO 40 | > DET(1) = DET(1)/TEN | > DET(2) = DET(2) + 1.0D0 | > GO TO 30 | > 40 CONTINUE | > | > your matrix results in DET(1) == Inf. So dividing it by TEN does not | > reduce its value and its absolute value never becomes less than 10, | > and the loop repeats indefinitely. | | What about using [D|Z]GETRF instead of DGEDI? [D|Z]GETRF only does an | LU-factorization, but as det(A) = det(L U) = det(U) = u_1 * ... * u_n, | we could get a determinant. I don't think this will solve the problem. For the particular case given in the original bug report, Octave's lu function (which is based on dgetrf) will return a matrix with NaNs for U. jwe ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------