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

Make permutations remember their inverses (cleanup of #1772) #1831

Merged
merged 5 commits into from
Oct 31, 2017

Conversation

fingolfin
Copy link
Member

This PR is a cleaned up version of PR #1772: I run clang-format on the changes, and split them cleanly into self-contained commits. Otherwise, it should be identical to that PR.

For permutations whose degree is less than PERM_INVERSE_THRESHOLD,
QuoIntPerm2/4 compute and store the inverse
Taking the quotient of permutations x/y involves computing y^-1, which was
previously stored in a temporary buffer and then discarded. Since we now
remember inverses, just compute x*y^-1 which does essentially the same thing
AND stores the inverse. It's also much shorter code.
@fingolfin fingolfin added kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements topic: performance bugs or enhancements related to performance (improvements or regressions) labels Oct 31, 2017
@fingolfin fingolfin added this to the GAP 4.9.0 milestone Oct 31, 2017
@codecov
Copy link

codecov bot commented Oct 31, 2017

Codecov Report

Merging #1831 into master will increase coverage by 12.6%.
The diff coverage is 88.52%.

@@            Coverage Diff             @@
##           master    #1831      +/-   ##
==========================================
+ Coverage   50.44%   63.05%   +12.6%     
==========================================
  Files         448      969     +521     
  Lines      234445   292732   +58287     
  Branches    10446    12912    +2466     
==========================================
+ Hits       118268   184569   +66301     
+ Misses     113385   105355    -8030     
- Partials     2792     2808      +16
Impacted Files Coverage Δ
lib/permutat.g 77.19% <ø> (+14.91%) ⬆️
lib/dicthf.gi 66.01% <0%> (+21.35%) ⬆️
src/intrprtr.c 71.28% <100%> (+12.37%) ⬆️
src/exprs.c 79.69% <83.33%> (+3.69%) ⬆️
src/permutat.c 76.38% <87.5%> (+10.69%) ⬆️
src/permutat.h 96.55% <96.55%> (ø)
src/funcs.c 72.48% <0%> (-15.1%) ⬇️
src/intobj.h 81.48% <0%> (-7.71%) ⬇️
src/dteval.c 2.79% <0%> (-0.29%) ⬇️
src/dt.c 1.61% <0%> (-0.26%) ⬇️
... and 844 more

@markuspf markuspf merged commit bf0df04 into gap-system:master Oct 31, 2017
@fingolfin fingolfin deleted the mh/perm-inverses branch October 31, 2017 13:08
@olexandr-konovalov olexandr-konovalov added the release notes: added PRs introducing changes that have since been mentioned in the release notes label Jan 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements 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.

4 participants