#6621: [with patch, positive review] Permutation.inverse too slow
---------------------------+------------------------------------------------
 Reporter:  aclaesson      |       Owner:  mhansen        
     Type:  enhancement    |      Status:  new            
 Priority:  major          |   Milestone:  sage-4.1.1     
Component:  combinatorics  |    Keywords:                 
 Reviewer:  Dan Drake      |      Author:  Anders Claesson
   Merged:                 |  
---------------------------+------------------------------------------------
Changes (by ddrake):

  * reviewer:  => Dan Drake


Comment:

 Positive review! Here are some timings:

 For the permutation [6,7,8,9,4,2,3,1,5], on my machine, the timing went
 from 70.9 µs per loop to 24.7 µs per loop. (This is all "%timeit
 p.inverse()".

 For [19, 5, 13, 8, 7, 15, 9, 10, 16, 3, 12, 6, 2, 20, 18, 11, 14, 4, 17,
 1], it went from
 263 µs per loop to 40 µs per loop.

 For [14, 17, 1, 24, 16, 34, 19, 9, 20, 18, 36, 5, 22, 2, 27, 40, 37, 15,
 3, 35, 10, 25, 21, 8, 13, 26, 12, 32, 23, 38, 11, 4, 6, 39, 31, 28, 29, 7,
 30, 33], it went from 923 to 64.8. So it does look like this patch turns
 quadratic behavior into linear behavior.

 This is Anders' first contribution to Sage, by the way.

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