Skip to content

Commit

Permalink
Replace instances of Size(g)=1 by IsTrivial(g)
Browse files Browse the repository at this point in the history
Note that there are immediate methods which set IsTrivial suitably as
soon as the Size is known, hence these changes do not break any existing
use case. However, there are examples where computing Size is
infeasible, but computing IsTrivial is possible, sometimes even trivial.
  • Loading branch information
fingolfin committed Sep 28, 2016
1 parent d813764 commit 133da29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/grp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ InstallMethod( MinimalGeneratingSet,"cyclic groups",true,
RankFilter(IsFinite and IsPcGroup),
function ( G )
local g;
if Size(G)=1 then return [];fi;
if IsTrivial(G) then return []; fi;
g:=Product(IndependentGeneratorsOfAbelianGroup(G),One(G));
Assert( 1, Index(G,Subgroup(G,[g])) = 1 );
return [g];
Expand Down Expand Up @@ -411,9 +411,9 @@ InstallMethod( IsNilpotentGroup,
#M IsPerfectGroup( <G> ) . . . . . . . . . . . . test if a group is perfect
##
InstallImmediateMethod( IsPerfectGroup,
IsGroup and IsSolvableGroup and HasSize,
IsSolvableGroup and HasIsTrivial,
0,
grp -> Size( grp ) = 1 );
IsTrivial );

InstallMethod( IsPerfectGroup,
"method for finite groups",
Expand Down

0 comments on commit 133da29

Please sign in to comment.