#4973: [with patch, needs review] rewrite the function __getitem__ in 
matrix0.pyx
to not explicitly use the python/C api
----------------------+-----------------------------------------------------
 Reporter:  mabshoff  |        Owner:  jason   
     Type:  defect    |       Status:  assigned
 Priority:  major     |    Milestone:  sage-3.3
Component:  misc      |   Resolution:          
 Keywords:            |  
----------------------+-----------------------------------------------------
Comment (by jason):

 Doctests pass. I've tried lots of the doc examples and they are faster or
 the same as the old code, except for the following case.  These commands
 are each executed in a fresh Sage session.

 {{{

 AFTER PATCH:

 sage: m=[(1, -2, -1, -1,9), (1, 8, 6, 2,2), (1, 1, -1, 1,4), (-1, 2, -2,
 -1,4)];M= matrix(m)
 sage: timeit('M[[1,2],[0,1,2]]')
 625 loops, best of 3: 167 µs per loop
 sage: timeit('M[[1,2],[0,1,2]]')
 625 loops, best of 3: 168 µs per loop
 sage: timeit('M[[1,2],[0,1,2]]')
 625 loops, best of 3: 166 µs per loop


 BEFORE PATCH:

 sage: m=[(1, -2, -1, -1,9), (1, 8, 6, 2,2), (1, 1, -1, 1,4), (-1, 2, -2,
 -1,4)];M= matrix(m)
 sage: timeit('M[[1,2],[0,1,2]]')
 625 loops, best of 3: 134 µs per loop
 sage: timeit('M[[1,2],[0,1,2]]')
 625 loops, best of 3: 138 µs per loop
 sage: timeit('M[[1,2],[0,1,2]]')
 625 loops, best of 3: 143 µs per loop
 }}}

 So, positive review if this regression is fixed.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4973#comment:11>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to