octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39014] Wrong determinant for some (large) mat


From: Clemens Buchacher
Subject: [Octave-bug-tracker] [bug #39014] Wrong determinant for some (large) matrices
Date: Sat, 18 May 2013 11:03:09 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31

Follow-up Comment #2, bug #39014 (project octave):

Err, I veered off course a bit here. But I suspect the original issue is quite
similar:

octave-3.7.3+:52> det(matrix_type(full(diag(ones(1,2000)+1e-10)), "full"))
ans = Inf

In this case, we do not end up with c2=0, but we end up with a very small
mantissa, which due to loss of precision does not grow as quickly as the
exponent. So the final result ends up as retval = c2 * 2^e2 = 2^-1074 *
2^2000, which I suppose gets converted to Inf somewhere (maybe we could do
better there too, and get 2^928, but that would not save our day).

Breakpoint 6, Matrix::determinant (address@hidden, 
    mattype=..., address@hidden: 0, address@hidden: 1, 
    address@hidden) at ../../liboctave/array/dMatrix.cc:1362
1362                          retval *= (ipvt(i) != (i+1)) ? -c : c;
4: c = 1.0000000001
3: i = 1821
2: retval = {c2 = 4.9406564584124654e-324, e2 = 1822}

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39014>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]