Skip to content
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

Add optimised SmallestMovedPoint implementation #3721

Merged
merged 1 commit into from
Nov 13, 2019

Conversation

ChrisJefferson
Copy link
Contributor

This just adds a SmallestMovedPoint C implementation, as I had a case where the time taken mattered.

We leave a GAP-level implementation for permutations which aren't PERM2s or PERM4s, as SmallestMovedPoint is used on permutations which aren't internal rep.

Note (if interested) we don't have a GAP-level implementation for LargestMovedPoint, as there isn't a sensible algorithm for arbitrary permutation implementations (as we don't have a "largest candidate" to start from, as we do with internal permutations).

@ChrisJefferson ChrisJefferson added release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes topic: performance bugs or enhancements related to performance (improvements or regressions) labels Oct 30, 2019
@ChrisJefferson ChrisJefferson changed the title Add optimised SmallestMovedPoint Add optimised SmallestMovedPoint implementation Oct 30, 2019
@coveralls
Copy link

coveralls commented Oct 30, 2019

Coverage Status

Coverage increased (+0.0004%) to 84.507% when pulling ed2cbe1 on ChrisJefferson:smallest-moved-point into 71194d3 on gap-system:master.

src/permutat.cc Outdated Show resolved Hide resolved
src/permutat.cc Outdated Show resolved Hide resolved
tst/testinstall/perm.tst Show resolved Hide resolved
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is of course overall quite sensible, but I do have some nitpicks ;-)

src/permutat.cc Outdated Show resolved Hide resolved
src/permutat.cc Outdated Show resolved Hide resolved
src/permutat.cc Outdated Show resolved Hide resolved
src/permutat.cc Outdated Show resolved Hide resolved
src/permutat.cc Outdated Show resolved Hide resolved
*F FuncSMALLEST_MOVED_POINT_PERM( <self>, <perm> )
*F Smallest point moved by perm
**
** GAP-level wrapper for 'SmallestMovedPointPerm'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this adds any useful information, as the 2 line implementation makes this info clear anyway. So I'd just remove it.

Suggested change
** GAP-level wrapper for 'SmallestMovedPointPerm'.

gap> LARGEST_MOVED_POINT_PERM((2,3));
3
gap> LARGEST_MOVED_POINT_PERM((2,70000));
70000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for these tests was to make 100% sure we test those kernel function, and not some other installed methods.

I guess these days, I'd move those tests to tst/testinstall/kernel/permutat.tst

tst/testinstall/perm.tst Show resolved Hide resolved
@ChrisJefferson
Copy link
Contributor Author

Thank you both for your comments.they mostly look accurate but I may not be able to address them until Sunday.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Request changes" to mark this issue as not approved, to make sure it doesn't get merged by accident while still waiting for changes by @ChrisJefferson (Chris, this is not meant to bother you into acting, I simply don't want to keep looking at this PR every couple of days, wondering "gee, why is this approved PR not yet merge?", due to my bad memory ;-)

@ChrisJefferson
Copy link
Contributor Author

Yes, sorry, I'm trying to do no non-required programming until a paper gets finished :)

Copy link
Member

@wilfwilson wilfwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a minor question, I'll be happy to approve once you answer it one way or another 🙂

src/permutat.cc Show resolved Hide resolved
@ChrisJefferson
Copy link
Contributor Author

I'll add a test like #3738 which tests SMALLEST_MOVED_POINT_PERM once that PR is merged (I want that one to PR to be merged in first, so it cleanly merges back to 4.11).

@fingolfin fingolfin merged commit 3cca408 into gap-system:master Nov 13, 2019
@ChrisJefferson ChrisJefferson deleted the smallest-moved-point branch December 2, 2019 14:30
@PaulaHaehndel PaulaHaehndel self-assigned this Feb 17, 2021
@PaulaHaehndel PaulaHaehndel added release notes: added PRs introducing changes that have since been mentioned in the release notes and removed release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes labels Feb 17, 2021
@PaulaHaehndel PaulaHaehndel removed their assignment Feb 17, 2021
@fingolfin fingolfin changed the title Add optimised SmallestMovedPoint implementation Add optimised SmallestMovedPoint implementation Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: added PRs introducing changes that have since been mentioned in the release notes topic: performance bugs or enhancements related to performance (improvements or regressions)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants