#16306: Replace =0 by is_zero() in test for matrix being alternating
-------------------------------------+-------------------------------------
       Reporter:  darij              |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  trivial            |    Milestone:  sage-6.3
      Component:  linear algebra     |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Darij Grinberg     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  public/combinat/matrix0-fix        |  46f627eb1d6387b28732d73bf3a7e9994b1db96f
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:7 darij]:
 > Actually, checking equality with parent.zero() is even faster than
 checking is_zero(). I'll push this once I am back home.

 This is not true for integers
 {{{
 sage: n=12
 sage: %timeit n.is_zero()
 1000000 loops, best of 3: 204 ns per loop
 sage: %timeit n == n.parent().zero()
 1000000 loops, best of 3: 463 ns per loop
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/16306#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to