diff --git a/lib/gprdperm.gi b/lib/gprdperm.gi index 81592d6066..1d0de379a5 100644 --- a/lib/gprdperm.gi +++ b/lib/gprdperm.gi @@ -12,21 +12,13 @@ ############################################################################# ## -#M DirectProductOp( , ) . . . . . . direct product of perm groups +#F DirectProductOfPermGroupsWithMovedPoints( , ) ## -InstallMethod( DirectProductOp, - "for a list of permutation groups, and a permutation group", - IsCollsElms, - [ IsList and IsPermCollColl, IsPermGroup ], 0, - function( grps, G ) - local oldgrps, olds, news, perms, gens, +BindGlobal("DirectProductOfPermGroupsWithMovedPoints", + function( grps, pnts ) + local i, oldgrps, olds, news, perms, gens, deg, grp, old, new, perm, gen, D, info; - # Check the arguments. - if not ForAll( grps, IsGroup ) then - TryNextMethod(); - fi; - oldgrps := [ ]; olds := [ ]; news := [ ]; @@ -35,11 +27,12 @@ InstallMethod( DirectProductOp, deg := 0; # loop over the groups - for grp in grps do + for i in [1..Length(grps)] do # find old domain, new domain, and conjugating permutation - old := MovedPoints( grp ); - new := [deg+1..deg+Length(old)]; + grp := grps[i]; + old := Immutable(pnts[i]); + new := MakeImmutable([deg+1..deg+Length(old)]); perm := MappingPermListList( old, new ); deg := deg + Length(old); Add( oldgrps, grp ); @@ -66,6 +59,25 @@ InstallMethod( DirectProductOp, end ); +############################################################################# +## +#M DirectProductOp( , ) . . . . . . direct product of perm groups +## +InstallMethod( DirectProductOp, + "for a list of permutation groups, and a permutation group", + IsCollsElms, + [ IsList and IsPermCollColl, IsPermGroup ], 0, + function( grps, G ) + + # Check the arguments. + if not ForAll( grps, IsGroup ) then + TryNextMethod(); + fi; + + return DirectProductOfPermGroupsWithMovedPoints(grps, List(grps, MovedPoints)); + end ); + + ############################################################################# ## #M Size( ) . . . . . . . . . . . . . . . . . . . . . . of direct product diff --git a/tst/testinstall/gprd.tst b/tst/testinstall/gprd.tst index 36fedb62eb..85184c99e4 100644 --- a/tst/testinstall/gprd.tst +++ b/tst/testinstall/gprd.tst @@ -45,5 +45,12 @@ gap> d4 := DirectProduct(g1, g2, g3);; gap> HasIsFinite(d4) and not IsFinite(d4); true +# +gap> d1 := DirectProductOfPermGroupsWithMovedPoints([g1, g1, g1], [[1..4], [1..4], [1..4]]);; +gap> MovedPoints(d1); +[ 1, 2, 3, 5, 6, 7, 9, 10, 11 ] +gap> HasIsFinite(d1) and IsFinite(d1); +true + # gap> STOP_TEST("gprd.tst");