#5537: [with patch, mostly positive review] bug in __cmp__ in
permgroup_element.pyx
--------------------------+-------------------------------------------------
Reporter: jhpalmieri | Owner: robertwb
Type: defect | Status: new
Priority: major | Milestone: sage-3.4.2
Component: group_theory | Keywords:
--------------------------+-------------------------------------------------
Comment(by rbeezer):
Replying to [comment:5 robertwb]:
Hi Robert,
Much improved. Correct and faster. Passed all tests in
sage/groups/perm_gps.
Do you think the code for the second loop checking the fixed elements of
the longer permutation would be more readable if it mimicked the first
loop? In other words, view the plain i's in the comparison as
self.perm[i] and then have everything else match up exactly with the first
loop:
{{{
for i from self.n <= i < right.n:
if i < right.perm[i]:
return -swap
elif i > right.perm[i]:
return swap
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5537#comment:7>
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
-~----------~----~----~----~------~----~------~--~---