Skip to content

Commit

Permalink
Fix WreathProductElementList to not modify its list argument (#5801)
Browse files Browse the repository at this point in the history
Otherwise the list representation from the input gets replaced with the wreath product element outside of the scope.
  • Loading branch information
FriedrichRober authored Sep 23, 2024
1 parent 5c79e69 commit 2a7cf16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/gprd.gi
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ end);
InstallMethod( WreathProductElementListNC, "generic wreath product", true,
[ HasWreathProductInfo, IsList ], 0,
function(G, list)
return Objectify(FamilyObj(One(G))!.defaultType, StructuralCopy(list));
return Objectify(FamilyObj(One(G))!.defaultType, ShallowCopy(list));
end);

#############################################################################
Expand Down
16 changes: 16 additions & 0 deletions tst/testinstall/opers/ListWreathProductElement.tst
Original file line number Diff line number Diff line change
Expand Up @@ -241,5 +241,21 @@ gap> list := ListWreathProductElement(G, x);;
gap> x = WreathProductElementList(G, list);
true

#
# Generic Wreath Product : Bugfix for immutable lists
#

#
gap> K := FreeGroup("x", "y");;
gap> x := K.1;;
gap> y := K.2;;
gap> H := SymmetricGroup(3);;
gap> W := WreathProduct(K, H);;
gap> l := [x*y, x, y, (1,2,3)];;
gap> MakeImmutable(l);;
gap> w := WreathProductElementList(W, l);;
gap> l = [x*y, x, y, (1,2,3)];
true

#
gap> STOP_TEST("ListWreathProductElement.tst", 1);

0 comments on commit 2a7cf16

Please sign in to comment.