Optimize taking powers of objects with memory#5968
Merged
ThomasBreuer merged 1 commit intogap-system:masterfrom Apr 16, 2025
Merged
Optimize taking powers of objects with memory#5968ThomasBreuer merged 1 commit intogap-system:masterfrom
ThomasBreuer merged 1 commit intogap-system:masterfrom
Conversation
ThomasBreuer
requested changes
Apr 4, 2025
Contributor
ThomasBreuer
left a comment
There was a problem hiding this comment.
I am not really sure about the meaning of the record components in an IsObjWithMemory object.
Perhaps we have to document their meaning first.
lib/memory.gi
Outdated
| slp := a!.slp; | ||
| if a!.n = 0 then | ||
| if a!.n = 0 or b = 0 then | ||
| return ObjWithMemory( slp, 0, a!.el ); |
Contributor
There was a problem hiding this comment.
My understanding of a!.el is that it is the group element in question. If b = 0 but a!.n <> 0 then a!.el can be something different from the identity.
lib/memory.gi
Outdated
| if a!.n = 0 or b = 0 then | ||
| return ObjWithMemory( slp, 0, a!.el ); | ||
| elif b = 1 then | ||
| return ObjWithMemory( slp, a!.n, a!.el ); |
Contributor
There was a problem hiding this comment.
Can't we simply return a?
The entries in the result of GeneratorsWithMemory are immutable. Do we have situations where objects in IsObjWithMemory are mutable?
(As far as I see, all this is not really documented.)
Avoid enlarging their SLPs when there is no need for it.
2076f17 to
29f88a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid enlarging their SLPs when there is no need for it.