-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear stored inverse when calling TrimPerm
This is required if TrimPerm changes the TNUM of the permutation, as a permutation and its stored inverse must have the same TNUM. This is also required if TrimPerm changes the permutation (although this would break many other things if anyone did it)
- Loading branch information
1 parent
ac5c014
commit f174bdc
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# When TRIM_PERM causes a permutation 'p' to change TNAM, the stored inverse | ||
# must be cleared, as the stored inverse of 'p' must have the | ||
# same TNAM as 'p' | ||
|
||
# Make p a Perm4 | ||
gap> p := (1,2,3,4)*(2^16,2^16+1)*(2^16,2^16+1); | ||
(1,2,3,4) | ||
gap> IsPerm4Rep(p); | ||
true | ||
|
||
# Force inverse calculation | ||
gap> p^-1; | ||
(1,4,3,2) | ||
gap> IsPerm4Rep(p^-1); | ||
true | ||
|
||
# Now trim | ||
gap> TRIM_PERM(p, 4); | ||
gap> IsPerm2Rep(p); | ||
true | ||
|
||
# Check inverse is also a perm2 | ||
gap> IsPerm2Rep(p^-1); | ||
true | ||
|
||
# Check some calculations that use the inverse | ||
gap> List([1..5], x -> x/p); | ||
[ 4, 1, 2, 3, 5 ] |