Skip to content

Commit

Permalink
Don't use fast method for composing with identity mapping if source &…
Browse files Browse the repository at this point in the history
… range don't match
  • Loading branch information
stevelinton committed Jun 11, 2018
1 parent 30d4edc commit 470a3ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lib/mapprep.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1387,9 +1387,7 @@ InstallMethod( CompositionMapping2,
[ IsGeneralMapping and IsOne, IsGeneralMapping ],
SUM_FLAGS + 1, # should be higher than the rank for a zero mapping
function( id, map )
if not IsSubset(Source(id),Range(map))
and not IsSubset(Source(id),ImagesSource(map))
then
if not IsSubset(Source(id),Range(map)) then
# if the identity is defined on something smaller, we need to take a
# true `CompositionMapping'.
TryNextMethod();
Expand Down
13 changes: 13 additions & 0 deletions tst/testbugfix/2018-06-11-mapping.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# There was a bug where composition of an identity mapping and another
# mapping x where the Source of the identity mapping contained the
# ImagesSource of x, but not its whole range, simply returned x,
# resulting in a composition whose Range was strictly bigger than that
# of its first argument, and causing problems in IsomorphismPermGroup
#
gap> g := SymmetricGroup(7);;
gap> phi := GroupGeneralMappingByImages(g,g,[(1,2,3,4,5),(1,2)],[(1,2,3,4,6),(1,2)]);
[ (1,2,3,4,5), (1,2) ] -> [ (1,2,3,4,6), (1,2) ]
gap> psi := IdentityMapping(SymmetricGroup(6));
IdentityMapping( Sym( [ 1 .. 6 ] ) )
gap> Range(CompositionMapping(psi,phi));
Sym( [ 1 .. 6 ] )

0 comments on commit 470a3ee

Please sign in to comment.