-
Notifications
You must be signed in to change notification settings - Fork 14
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
Update ThrowAwayFixedPoints #191
Update ThrowAwayFixedPoints #191
Conversation
Codecov Report
@@ Coverage Diff @@
## master #191 +/- ##
==========================================
- Coverage 77.76% 77.69% -0.08%
==========================================
Files 37 37
Lines 17497 17342 -155
==========================================
- Hits 13606 13473 -133
+ Misses 3891 3869 -22
|
So, on the upside this fixes #190. On the downside recognition of a large base primitive groups with fixed points takes 20 seconds compared to 2 seconds for an isomorphic group but without fixed points. Here is an example run:
I'm looking into a profile now and it seems like two things make this so slow
|
Hm, apparently the |
gap/perm.gi
Outdated
if 2*n > Maximum(l) or 3*n > LargestMovedPoint(G) then # we do nothing | ||
largest := LargestMovedPoint(G); | ||
if (2*n > Maximum(l) or 3*n > largest) | ||
and not (IsPrimitive(G) and largest > n) |
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.
It's just too expensive to check IsPrimitive
.
Instead we should either...
-
enhance the large base group to also check for fixed points and throw them away (either with its own code or by forcing a
FindHomMethodsPerm.ThrowAwayFixedPoints
step with this limit removed. -
improve the large base group case to not require that
MovedPoints(G) = [1..LargestMovedPoints(G)]
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.
@ssiccha any plans to revisit this?
585d73d
to
5b648ce
Compare
@fingolfin I just pushed a version that I think does the trick. The tests I added take roughly 17 seconds on my machine. Do you think that is too much for the |
Hmm, does this brake something in |
5b648ce
to
27e703b
Compare
The test-suite ran into a failure in So by a big coincidence, when arriving at I have thus changed the test in |
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.
Seems sensible. Left some minor comments
90e7a3f
to
9510bd5
Compare
@fingolfin I have adjusted and integrated your suggestion into the documentation of |
9510bd5
to
4f23e90
Compare
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.
Fine in principle, thank you! I do have some suggestions for the text, though.
#! <K>NeverApplicable</K> if it does not define a homomorphism indicating that it will | ||
#! never succeed. | ||
#! or <M>n</M> is at most half of the number of points on which | ||
#! <A>G</A> is stored internally by &GAP;. |
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.
Perhaps this should be explained a bit more, but then it is a bit technical... Perhaps what I wrote above could be extended... something along these lines:
The reason we do not just always discard fixed points is that it also incurs a cost, so we only try to do it when it seems worthwhile to do so.
To explain what was meant above by the ration of fixed points to moved points, suppose the group G is
not known to be primitive. Then we still apply this method if one of the following two criterion is met:
- the largest moved point of G is three or more times larger than the number n of actually moved points
- there is a generator of G whose internal storage reserves space for a number of moved points which is two or more times larger than n (note that even for a simple transposition (1,2), for technical reasons it can happen that GAP internally stores it with the same size as a permutation moving a million points; this is wasteful, and the second criterion tries to deal with this)
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.
I agree that that's a bit technical. So I'll put it into a source comment but not into the manual.
@@ -526,6 +538,7 @@ FindHomMethodsPerm.LargeBasePrimitive := | |||
fi; | |||
RECOG.SetPseudoRandomStamp(grp,"Jellyfish"); | |||
res := RECOG.AllJellyfish(grp); | |||
RECOG.SetPseudoRandomStamp(grp,"PseudoRandom"); |
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.
Why not this? (Honest question, I don't know)
RECOG.SetPseudoRandomStamp(grp,"PseudoRandom"); | |
RECOG.SetPseudoRandomStamp(grp,"LargeBasePrimitive"); |
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.
LargeBasePrimitive
is more or less a wrapper for AllJellyfish
. After the call to AllJellyfish
the actual computations are done and now we're just managing stuff. Thus here I "reset" the stamp.
Yeah, I really do not like how we handle this whole RandomStamp business currently, see #261 for an idea how to improve this.
Now ThrowAwayFixedPoints also prunes fixed points if the input group knows that it is primitive and has fixed points. If the input group does not know whether it is primitive yet but has fixed points, then ThrowAwayFixedPoints now returns NotEnoughInformation. Adds a comment in LargeBasePrimitive which explains how this fixes gap-packages#190. That is this commit lets recog handle primitive groups which can be recognized by LargeBasePrimitive, except for the fact that they have fixed points. Also changes the tests in PermLargeBasePrimitive.tst to make them run a bit faster. Fixes gap-packages#190. Co-authored-by: Max Horn <[email protected]>
Co-authored-by: Max Horn <[email protected]>
806b9dc
to
bca52ef
Compare
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.
I've added a commit with your suggestions and one with some minor changes by me. I'll squash everything when putting this into master.
@@ -526,6 +538,7 @@ FindHomMethodsPerm.LargeBasePrimitive := | |||
fi; | |||
RECOG.SetPseudoRandomStamp(grp,"Jellyfish"); | |||
res := RECOG.AllJellyfish(grp); | |||
RECOG.SetPseudoRandomStamp(grp,"PseudoRandom"); |
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.
LargeBasePrimitive
is more or less a wrapper for AllJellyfish
. After the call to AllJellyfish
the actual computations are done and now we're just managing stuff. Thus here I "reset" the stamp.
Yeah, I really do not like how we handle this whole RandomStamp business currently, see #261 for an idea how to improve this.
#! <K>NeverApplicable</K> if it does not define a homomorphism indicating that it will | ||
#! never succeed. | ||
#! or <M>n</M> is at most half of the number of points on which | ||
#! <A>G</A> is stored internally by &GAP;. |
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.
I agree that that's a bit technical. So I'll put it into a source comment but not into the manual.
Also lets ThrowAwayFixedPoints create a homomorphism if the input group
is primitive and has fixed points.
Fixes #190.