The matrix is over RR (MPFR software floats). M.change_ring(RDF).det() 
gives the right answer.

There is no special det() implementation for RR, we compute the Hessenberg 
form and from that characteristic polynomial. Sage uses Gaussian 
elimination to compute the Hessenberg form, and this is known to be 
numerically unstable in unfavorable cases 
(http://www.jstor.org/stable/2004967). I guess your matrix is one of these 
cases; there is no overflow, its  a numerical instability.




On Friday, October 26, 2012 11:35:28 AM UTC+1, LBerlioz wrote:
>
> det FUNCTION IS HAVING A VERY ANNOYING BEHAVIOR,GIVEN THE ATTACHED MATRIX FOR 
> EXAMPLE
> IF I TRY TO GET THE DETERMINANTS WITH TWO DIFFERENT METHODS:
>
> sage: M=load(PATHTOFILE + '/M.sobj')
> sage: M.det()
> 6.49037107316853e32
> sage: from numpy import linalg
> sage: linalg.det(M)
> -1.5055380070396349e-05
>
> THE SECOND RESULT IS CORRECT (THE MATRIX IS SINGULAR).
> THE DEFAULT det FUNCTION SEEMS TO OVERFLOW WITh A MATRIX OF JUST 20 ROWS? IS 
> THIS A BUG?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to