#16617: simple echelon matrix iterator
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  enhancement        |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-6.3
      Component:  linear algebra     |   Resolution:
       Keywords:  matrix             |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/16617                 |  f3cc9b7a9979e164565df53fa11dd6f8647a6ee9
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by ncohen):

 Yo !

 > The main speed up is to get rid of VectorSpaces. I do not want to use
 them, so I need a `echelon_matrix_iterator`. Whether it is cython or not
 is a matter of micro seconds, so I do not care that much (except that
 using cython allows to set the cache of matrices with the pivot that can
 be used later).

 I wondered if it was worth creating a file or if it was better to just
 change the code right where it was.

 > This is a crazy thing in the implementation of itertools. If the only
 reference to the tuple is owned by the iterator then it is reused.
 Otherwise you create a fresh one. What you gain is creation time of a
 tuple...
 > {{{
 > sage: from itertools import product
 > sage: timeit("for p in product([0,1,2,3],[3,4,5,6],[1,2,3,4],[1,2,3,4]):
 pass")
 > 625 loops, best of 3: 21.9 µs per loop
 > sage: timeit("for p in product([0,1,2,3],[3,4,5,6],[1,2,3,4],[1,2,3,4]):
 del p")
 > 625 loops, best of 3: 7.81 µs per loop
 > }}}

 What the hell is that ? `O_o`

 Nathann

--
Ticket URL: <http://trac.sagemath.org/ticket/16617#comment:6>
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