Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and simplify method reordering for constructors
For some reason, the method reordering code went through methods for constructors in reverse order compared to those for any other kind of operation. There doesn't seem to be a reason for that, and by getting rid of it, we remove a lot of code duplication and simplify the code overall. As a side effect, this fixes a regression, where reordering of constructors broke their relative order, because the alternate code for reordering constructors contained a bug in the code shifting the methods around. The result of that was the following: Without packages, we got this: gap> Perform(MethodsOperation(SymmetricGroupCons,2), function(r) Print(r.rank, ": ", r.info, "\n"); end); -59: SymmetricGroupCons: perm group with domain -59: SymmetricGroupCons: perm group with degree -64: SymmetricGroupCons: pc group with degree -66: SymmetricGroupCons: regular perm group with domain -66: SymmetricGroupCons: regular perm group with degree But after calling `LoadAllPackages()`, we got this; note how the methods are *not* ordered by descending rank anymore: gap> Perform(MethodsOperation(SymmetricGroupCons,2), function(r) Print(r.rank, ": ", r.info, "\n"); end); 9853: SymmetricGroupCons: for a partition of a ring into residue classes (RCWA) -111: SymmetricGroupCons: for an LpGroup and a positive integer -117: SymmetricGroupCons: for a partition of a ring into residue classes (RCWA) -154: SymmetricGroupCons: regular perm group with domain -154: SymmetricGroupCons: regular perm group with degree -152: SymmetricGroupCons: pc group with degree -150: SymmetricGroupCons: pcp group with degree -147: SymmetricGroupCons: perm group with domain -147: SymmetricGroupCons: perm group with degree This resulted in `SymmetricGroup(3)` running into an infinite recursion, and many other similar problems. With this patch applied, we get the expected result: Perform(MethodsOperation(SymmetricGroupCons,2), function(r) Print(r.rank, ": ", r.info, "\n"); end); 9853: SymmetricGroupCons: for a partition of a ring into residue classes (RCWA) -111: SymmetricGroupCons: for an LpGroup and a positive integer -117: SymmetricGroupCons: for a partition of a ring into residue classes (RCWA) -147: SymmetricGroupCons: perm group with domain -147: SymmetricGroupCons: perm group with degree -150: SymmetricGroupCons: pcp group with degree -152: SymmetricGroupCons: pc group with degree -154: SymmetricGroupCons: regular perm group with domain -154: SymmetricGroupCons: regular perm
- Loading branch information