Skip to content

Commit

Permalink
grp: fix regressions with matrix group constructors
Browse files Browse the repository at this point in the history
This partially reverts commit 38c80a9.
Also add some comments and tests.
  • Loading branch information
fingolfin committed Jan 20, 2017
1 parent 53e55ac commit cee8c18
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
14 changes: 6 additions & 8 deletions grp/basic.gd
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ BindGlobal( "AbelianGroup", function ( arg )
fi;
return AbelianGroupCons( IsPcGroup, arg[1] );
elif IsOperation(arg[1]) then

if Length(arg) = 2 then
return AbelianGroupCons( arg[1], arg[2] );
fi;
Expand Down Expand Up @@ -257,9 +256,11 @@ BindGlobal( "CyclicGroup", function ( arg )
fi;
return CyclicGroupCons( IsPcGroup, arg[1] );
elif IsOperation(arg[1]) then

if Length(arg) = 2 then
return CyclicGroupCons( arg[1], arg[2] );
elif Length(arg) = 3 then
# some filters require extra arguments, e.g. IsMatrixGroup + field
return CyclicGroupCons( arg[1], arg[2], arg[3] );
fi;
fi;
Error( "usage: CyclicGroup( [<filter>, ]<size> )" );
Expand Down Expand Up @@ -311,7 +312,6 @@ BindGlobal( "DihedralGroup", function ( arg )
if Length(arg) = 1 then
return DihedralGroupCons( IsPcGroup, arg[1] );
elif IsOperation(arg[1]) then

if Length(arg) = 2 then
return DihedralGroupCons( arg[1], arg[2] );
fi;
Expand Down Expand Up @@ -368,9 +368,11 @@ BindGlobal( "QuaternionGroup", function ( arg )
if Length(arg) = 1 then
return QuaternionGroupCons( IsPcGroup, arg[1] );
elif IsOperation(arg[1]) then

if Length(arg) = 2 then
return QuaternionGroupCons( arg[1], arg[2] );
elif Length(arg) = 3 then
# some filters require extra arguments, e.g. IsMatrixGroup + field
return QuaternionGroupCons( arg[1], arg[2], arg[3] );
fi;
fi;
Error( "usage: QuaternionGroup( [<filter>, ]<size> )" );
Expand Down Expand Up @@ -422,7 +424,6 @@ BindGlobal( "ElementaryAbelianGroup", function ( arg )
if Length(arg) = 1 then
return ElementaryAbelianGroupCons( IsPcGroup, arg[1] );
elif IsOperation(arg[1]) then

if Length(arg) = 2 then
return ElementaryAbelianGroupCons( arg[1], arg[2] );
fi;
Expand Down Expand Up @@ -474,7 +475,6 @@ BindGlobal( "FreeAbelianGroup", function ( arg )
if Length(arg) = 1 then
return FreeAbelianGroupCons( IsFpGroup, arg[1] );
elif IsOperation(arg[1]) then

if Length(arg) = 2 then
return FreeAbelianGroupCons( arg[1], arg[2] );
fi;
Expand Down Expand Up @@ -539,7 +539,6 @@ BindGlobal( "ExtraspecialGroup", function ( arg )
if Length(arg) = 2 then
return ExtraspecialGroupCons( IsPcGroup, arg[1], arg[2] );
elif IsOperation(arg[1]) then

if Length(arg) = 3 then
return ExtraspecialGroupCons( arg[1], arg[2], arg[3] );
fi;
Expand Down Expand Up @@ -592,7 +591,6 @@ BindGlobal( "MathieuGroup", function( arg )
if Length( arg ) = 1 then
return MathieuGroupCons( IsPermGroup, arg[1] );
elif IsOperation( arg[1] ) then

if Length( arg ) = 2 then
return MathieuGroupCons( arg[1], arg[2] );
fi;
Expand Down
10 changes: 10 additions & 0 deletions tst/testinstall/grp/basic.tst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ gap> CyclicGroup(IsPermGroup,4);
Group([ (1,2,3,4) ])
gap> CyclicGroup(IsFpGroup,4);
<fp group of size 4 on the generators [ a ]>
gap> G:=CyclicGroup(IsMatrixGroup, GF(2), 12);
<matrix group of size 12 with 1 generators>
gap> FieldOfMatrixGroup(G); DimensionOfMatrixGroup(G);
GF(2)
12

#
gap> CyclicGroup(2,3);
Expand Down Expand Up @@ -112,6 +117,11 @@ gap> QuaternionGroup(IsPermGroup,8);
Group([ (1,5,3,7)(2,8,4,6), (1,2,3,4)(5,6,7,8) ])
gap> QuaternionGroup(IsFpGroup,8);
<fp group of size 8 on the generators [ r, s ]>
gap> G:=QuaternionGroup(IsMatrixGroup, GF(3), 8);
<matrix group of size 8 with 2 generators>
gap> FieldOfMatrixGroup(G); DimensionOfMatrixGroup(G);
GF(3)
4

#
gap> QuaternionGroup(2,3);
Expand Down

0 comments on commit cee8c18

Please sign in to comment.