Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
restriction from every `Size` and `Order` argument
- Fix `AllPrimitiveGroups` and friends to honour every `NrMovedPoints`
argument, not just the first one
- Fix `ShallowCopy` and `List` for `PrimitiveGroupsIterator`
- Fix the dimension in the names of PrimitiveGroup(1057,1) and (1057,2)
- Fix 29 socle types recorded with a rank one too high
- Fix the corrupted name of PrimitiveGroup(625,657)
Expand Down
17 changes: 17 additions & 0 deletions lib/primitiv.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,23 @@ local g;
return g;
end);

# needed by List, which iterates over a copy; the components are either
# immutable or replaced, never changed in place, so copying them suffices
InstallMethod(ShallowCopy,"primitive groups iterator",true,
[IsPrimGrpIterRep and IsIterator],0,
function(it)
local new;
new:=Objectify(NewType(IteratorsFamily,
IsIterator and IsPrimGrpIterRep and IsMutable),rec());
new!.deg:=it!.deg;
new!.degi:=it!.degi;
new!.nr:=it!.nr;
new!.prop:=it!.prop;
new!.gut:=it!.gut;
new!.next:=it!.next;
return new;
end);

#############################################################################
##
#F AllPrimitiveGroups( <fun>, <res>, ... ) . . . . . . . selection function
Expand Down
16 changes: 16 additions & 0 deletions tst/testinstall/bugfix.tst
Original file line number Diff line number Diff line change
Expand Up @@ -250,5 +250,21 @@ true
gap> PRIMGRP_EntryFromDescription(["NoSuchThing"], 6, 1);
Error, unknown construction "NoSuchThing" for entry 1 of degree 6

# List on an iterator works on a ShallowCopy of it, which must advance
# independently of the original.
# See <https://github.com/gap-packages/primgrp/issues/102>
gap> it := PrimitiveGroupsIterator(NrMovedPoints, 5);;
gap> NextIterator(it);
C(5)
gap> List(it);
[ D(2*5), AGL(1, 5), A(5), S(5) ]
gap> copy := ShallowCopy(it);;
gap> [ NextIterator(copy), NextIterator(copy) ];
[ D(2*5), AGL(1, 5) ]
gap> NextIterator(it);
D(2*5)
gap> List(PrimitiveGroupsIterator(NrMovedPoints, 5, IsSolvable, false));
[ A(5), S(5) ]

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