#4973: [with patch, positive review] rewrite the function __getitem__ in
matrix0.pyx to support slices better, negative indices, and be faster
----------------------+-----------------------------------------------------
 Reporter:  mabshoff  |        Owner:  jason   
     Type:  defect    |       Status:  assigned
 Priority:  major     |    Milestone:  sage-3.3
Component:  misc      |   Resolution:          
 Keywords:            |  
----------------------+-----------------------------------------------------
Comment (by jason):

 I mean, *here* are my new timings after the regression fix in pt3.patch:

 {{{
 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
 }}}

 I copied the wrong thing before.

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