-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Special case identity permutations and improve printing of permutations #3566
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3566 +/- ##
==========================================
- Coverage 84.53% 75.64% -8.9%
==========================================
Files 696 644 -52
Lines 345073 296213 -48860
==========================================
- Hits 291716 224067 -67649
- Misses 53357 72146 +18789
|
842d9ad
to
261d3ab
Compare
Is there a strong reason to combine a potentially breaking change with an enhancement in one PR? I think we might want to merge one immediately, but for the other take some more time to first let Alex run all package tests and determine if we break some packages, and then give the package authors a chance to adapt (or even help them fix their packages)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The enhancement seems obvious enough (how useful it is in practice is another question, but I'd expect little harm). I am reluctant about merging it mixed in with a potentially breaking change to printing, though (even though the "break" should "only" affect package tests).
I'll have a rearrange. The two issues ended up merged because I only discovered the problem with printing when testing this. |
So, I looked at separating this, but I think it might be best to test them together, as they can both produce visible differences in tests, so if we separate we just have to make two passes over the packages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly tests seem to be failing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I have one tiny further optimization suggestion, but it's also OK to merge this directly, you are probably fed enough by my niggling :-). Thank you for making this perfect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still great. And as to potentially breaking package tests, I guess we can argue that they were not very robust to start with ;-). After merging this, let's try to watch the Travis package tests at https://travis-ci.org/gap-infra/gap-docker-pkg-tests-master in the coming days for new failures
Resolves #3547
This adds special cases for identity permutations in various methods. These do get called fairly often, and are very cheap.
EDIT: This now fixes another problem found along the way. GAP has the internal concept of the 'degree' of a permutation, which can be larger than the LargestMovedPoint. For example,
p=(1,2)
has DEG_PERM=2, butq=(2^19,2^20)*(1,2)*(2^19,2^20)
has DEG_PERM=2^20, as GAP doesn't try hard to reduce this value, but just uses a weak guess.This value is used in printing to decide how many digits we need when printing, so the permutations
p
andq
print differently, even though from the GAP language there is no way to tell them apart. This could break tests in some packages, who have made permutations with a large DEG_PERMText for release notes