Skip to content

Commit

Permalink
Merge pull request #139 from gap-packages/avoid
Browse files Browse the repository at this point in the history
avoid trivial function wrappers
  • Loading branch information
cdwensley authored Jan 6, 2024
2 parents 7658d56 + a8c32bc commit c7de56e
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 43 deletions.
18 changes: 9 additions & 9 deletions lib/apps.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##
#W apps.gi GAP4 package `XMod' Chris Wensley
##
#Y Copyright (C) 2001-2020, Chris Wensley et al,
#Y Copyright (C) 2001-2024, Chris Wensley et al,
#Y School of Computer Science, Bangor University, U.K.

##############################################################################
Expand Down Expand Up @@ -197,7 +197,7 @@ function( X0 )
bdy0 := Boundary( X0 );
Q0 := Image( bdy0 );
if IsAbelian( P0 ) then
return List( RightCosets( P0, Q0 ), c -> Representative(c) );
return List( RightCosets( P0, Q0 ), Representative );
fi;
iterM0 := Iterator( M0 );
## elM0 := Elements( M0 );
Expand Down Expand Up @@ -230,7 +230,7 @@ function( X0 )
fi;
od;
if not IsAbelian( P0 ) then
conj := List( ConjugacyClasses( P0 ), c -> Elements( c ) );
conj := List( ConjugacyClasses( P0 ), Elements );
numj := Length( conj );
pos := ListWithIdenticalEntries( numj, 0 );
for i in [1..numj] do
Expand Down Expand Up @@ -264,7 +264,7 @@ function( X0 )
bdy0 := Boundary( X0 );
Q0 := Image( bdy0 );
if IsAbelian( P0 ) then
return List( RightCosets( P0, Q0 ), c -> Representative(c) );
return List( RightCosets( P0, Q0 ), Representative );
fi;
iterM0 := Iterator( M0 );
## elM0 := Elements( M0 );
Expand Down Expand Up @@ -315,9 +315,9 @@ function( X0, a )
Error( "element a not in the range group P0" );
fi;
Info( InfoXMod, 3, "M0: ", Elements(M0) );
Info( InfoXMod, 3, List( Elements(M0), g -> Order(g) ) );
Info( InfoXMod, 3, List( Elements(M0), Order ) );
Info( InfoXMod, 3, "P0: ", Elements(P0) );
Info( InfoXMod, 3, List( Elements(P0), g -> Order(g) ) );
Info( InfoXMod, 3, List( Elements(P0), Order ) );
bdy0 := Boundary( X0 );
act0 := XModAction( X0 );
aut0 := Range( act0 );
Expand Down Expand Up @@ -422,15 +422,15 @@ function( X0 )
imbdy0 := ImagesSource( bdy0 );
Q0 := P0/imbdy0;
conjP0 := ConjugacyClasses( P0 );
repsP0 := List( conjP0, c -> Representative( c ) );
eltsP0 := List( conjP0, c -> Elements(c) );
repsP0 := List( conjP0, Representative );
eltsP0 := List( conjP0, Elements );
nclP0 := Length( conjP0 );
if ( InfoLevel( InfoXMod ) > 1 ) then
Print( "#I Size(P0) = ", Size(P0), "\n" );
Print( "#I imgenM0 = ", imgenM0, "\n" ); #? this is not used
Print( "#I cokernel of boundary has IdGroup ", IdGroup(Q0), "\n" );
Print( "#I conjugacy class sizes, reps and orders:classes for P :-\n" );
Print( "#I ", List( conjP0, c -> Size(c) ), "\n" );
Print( "#I ", List( conjP0, Size ), "\n" );
Print( "#I repsP0 = ", repsP0, "\n" );
fi;
if ( InfoLevel( InfoXMod ) > 2 ) then
Expand Down
18 changes: 9 additions & 9 deletions lib/gp2ind.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##
#W gp2ind.gi XMOD Package Chris Wensley
##
#Y Copyright (C) 2001-2023, Chris Wensley et al,
#Y Copyright (C) 2001-2024, Chris Wensley et al,
#Y School of Computer Science, Bangor University, U.K.
##
## This file implements functions for induced crossed modules.
Expand Down Expand Up @@ -748,9 +748,9 @@ function( X0, iota, trans )
## (21/01/10, 06/07/10) changed this condition - also changed below
if ( Size( series[1] ) < 2000 ) then
if ( RemInt( Size(series[1]), 128 ) <> 0 ) then
idseries := List( series, g -> StructureDescription( g ) );
idseries := List( series, StructureDescription );
else
idseries := List( series, g -> IdGroup( g ) );
idseries := List( series, IdGroup );
fi;
Info( InfoXMod, 2, "CompositionSeries for induced group:" );
Info( InfoXMod, 2, idseries, "\n" );
Expand Down Expand Up @@ -896,7 +896,7 @@ function( X0, iota )
genQ := GeneratorsOfGroup( Q );
preQ := List( genQ, q -> PreImagesRepresentativeNC( iota, q ) );
rcos := RightCosets( S, H );
reps := List( rcos, r -> Representative( r ) );
reps := List( rcos, Representative );
Info( InfoXMod, 2, "reps = ", reps );
imb := List( genS, r -> ImageElm( iota, ImageElm( bdy, r ) ) );
PI := Action( S, rcos, OnRight );
Expand Down Expand Up @@ -974,8 +974,8 @@ InstallGlobalFunction( AllInducedXMods, function( arg )
L := LatticeSubgroups( Q );
norm := NormalSubgroups( Q );
Info( InfoXMod, 2, "normal subgroups of Q: ", norm );
reps := Reversed( List( ConjugacyClassesSubgroups( L ),
c -> Representative( c ) ) );
reps := Reversed( List( ConjugacyClassesSubgroups( L ),
Representative ) );
nreps := Length( reps );
Info( InfoXMod, 2, "non-trivial reps = ", [2..nreps-1] );
for r in [ 1 .. nreps-1 ] do
Expand All @@ -1000,7 +1000,7 @@ InstallGlobalFunction( AllInducedXMods, function( arg )
Psd := StructureDescription( P );
norm := NormalSubgroups( P );
# find representatives of conjugacy classes in Q
sizes := List( norm, n -> Size( n ) );
sizes := List( norm, Size );
coll := Collected( sizes );
keep := List( norm, n -> true );
k := 1;
Expand Down Expand Up @@ -1411,7 +1411,7 @@ InstallGlobalFunction( AllInducedCat1Groups, function( args )
Q := args[1];
L := LatticeSubgroups( Q );
reps := Reversed( List( ConjugacyClassesSubgroups(L),
c -> Representative( c ) ) );
Representative ) );
nreps := Length( reps );
Print( "non-trivial reps = ", [2..nreps-1], "\n" );
for r in [ 2 .. nreps-1 ] do
Expand All @@ -1432,7 +1432,7 @@ InstallGlobalFunction( AllInducedCat1Groups, function( args )
P := reps[r];
norm := NormalSubgroups( P );
# find representatives of conjugacy classes in Q
sizes := List( norm, n -> Size( n ) );
sizes := List( norm, Size );
coll := Collected( sizes );
keep := List( norm, n -> true );
k := 1;
Expand Down
6 changes: 3 additions & 3 deletions lib/gp2obj.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##
#W gp2obj.gi GAP4 package `XMod' Chris Wensley
#W & Murat Alp
#Y Copyright (C) 2001-2023, Chris Wensley et al,
#Y Copyright (C) 2001-2024, Chris Wensley et al,
#Y School of Computer Science, Bangor University, U.K.
##
## This file contains generic methods for (pre-)crossed modules and
Expand All @@ -17,7 +17,7 @@

CAT1_LIST_MAX_SIZE := 60; ## reduced from 70 (10/06/20)
CAT1_LIST_CLASS_SIZES :=
List( [1..CAT1_LIST_MAX_SIZE], n -> NumberSmallGroups(n) );
List( [1..CAT1_LIST_MAX_SIZE], NumberSmallGroups );
CAT1_LIST_NUMBERS :=
[ [ 1 ], [ 2 ], [ 2 ], [ 2, 4 ], [ 2 ], [ 2, 4 ], [ 2 ], [ 2, 6, 3, 1, 6 ],
[ 2, 4 ], [ 2, 4 ], [ 2 ], [ 2, 4, 2, 4, 8 ], [ 2 ], [ 2, 4 ], [ 4 ],
Expand Down Expand Up @@ -2775,7 +2775,7 @@ function( G )
od;
if not IsBound( CatnGroupNumbers( G ).idem ) then
images := IdempotentEndomorphismsData( G ).images;
lens := List( images, L -> Length( L ) );
lens := List( images, Length );
CatnGroupNumbers( G ).idem := Sum( lens );
fi;
if not IsBound( CatnGroupNumbers( G ).cat1 ) then
Expand Down
4 changes: 2 additions & 2 deletions lib/gp2up.gi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
##
## This file contains implementations of UpMappings, Derivations & Sections
##
#Y Copyright (C) 2001-2023, Chris Wensley et al,
#Y Copyright (C) 2001-2024, Chris Wensley et al,
#Y School of Computer Science, Bangor University, U.K.

##############################################################################
Expand Down Expand Up @@ -1077,7 +1077,7 @@ function( XM )
reg := RegularDerivations( XM );
tab := WhiteheadGroupTable( XM );
im := ImagesList( reg );
gens := List( tab, row -> PermList( row ) );
gens := List( tab, PermList );
grp := Group( gens );
strgens := StrongGeneratorsStabChain( StabChain( grp ) );
pos := List( strgens, g -> Position( gens, g ) );
Expand Down
6 changes: 3 additions & 3 deletions lib/gpgpd.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##
#W gpgpd.gi GAP4 package `XMod' Chris Wensley
##
#Y Copyright (C) 2001-2020, Chris Wensley et al,
#Y Copyright (C) 2001-2024, Chris Wensley et al,
#Y School of Computer Science, Bangor University, U.K.

#############################################################################
Expand Down Expand Up @@ -129,7 +129,7 @@ function( C )
bdy := RestrictedMapping( h, kert );
imbdy := Image( bdy );
cosbdy := RightCosets( R, imbdy );
repbdy := List( cosbdy, c -> Representative(c) );
repbdy := List( cosbdy, Representative );
np := Length( repbdy );
Info( InfoXMod, 1, "repbdy = ", repbdy );
eR := Image( e, R );
Expand All @@ -141,7 +141,7 @@ function( C )
Info( InfoXMod, 1, "loopgp generators: ", loopgp );
loopgp := GroupWithGenerators( loopgp );
cosgp := RightCosets( kert, kerth );
repsgp := List( cosgp, c -> Representative(c) );
repsgp := List( cosgp, Representative );
L1 := List( repsgp, g -> g*eroot );
obs := List( repsgp, g -> ImageElm( h, g ) );
rays1 := List( L1, g -> GroupGroupoidElement( C, root, g ) );
Expand Down
20 changes: 10 additions & 10 deletions lib/gpnmap.gi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## This file implements functions for Higher Dimensional Mappings for
## (pre-)catn-groups.
##
#Y Copyright (C) 2001-2020, Chris Wensley et al,
#Y Copyright (C) 2001-2024, Chris Wensley et al,
#Y School of Computer Science, Bangor University, U.K.

##############################################################################
Expand Down Expand Up @@ -93,12 +93,12 @@ function( mor )
fi;
genPC := GeneratingCat1Groups( PC );
genQC := GeneratingCat1Groups( QC );
srcPC := List( genPC, x -> Source(x) );
srcQC := List( genQC, x -> Source(x) );
rngPC := List( genPC, x -> Range(x) );
rngQC := List( genQC, x -> Range(x) );
rnghoms := List( 2dmor, x -> RangeHom(x) );
srchoms := List( 2dmor, x -> SourceHom(x) );
srcPC := List( genPC, Source );
srcQC := List( genQC, Source );
rngPC := List( genPC, Range );
rngQC := List( genQC, Range );
rnghoms := List( 2dmor, RangeHom );
srchoms := List( 2dmor, SourceHom );
for x in [1..Length(genPC)] do
if ( Source( srchoms[x] ) <> srcPC[x] ) then
Info( InfoXMod, 1, x, "a : ", Source(rnghoms[x]),
Expand Down Expand Up @@ -196,7 +196,7 @@ function( map )
local mors, imors;

mors := ListOf2DimensionalMappings( map );
imors := List( mors, f -> MappingGeneratorsImages(f) );
imors := List( mors, MappingGeneratorsImages );
return imors;
end );

Expand Down Expand Up @@ -282,7 +282,7 @@ function( obj )
if ( dim < 4 ) then
Error( "should be using method for low dimensions" );
else
idmaps := List( GeneratingCat1Groups( obj ), C -> IdentityMapping(C) );
idmaps := List( GeneratingCat1Groups( obj ), IdentityMapping );
return PreCatnGroupMorphismByMorphisms( obj, obj, idmaps );
fi;
end );
Expand Down Expand Up @@ -410,7 +410,7 @@ function( mor )
Info( InfoXMod, 2, "Parameter is not an automorphism" );
return fail;
fi;
return Lcm( List(2d_maps, f -> Order(f) ) );
return Lcm( List(2d_maps, Order ) );
end );

##############################################################################
Expand Down
15 changes: 8 additions & 7 deletions lib/util.gi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
##
#W util.gi GAP4 package `XMod' Chris Wensley
#W & Murat Alp
#Y Copyright (C) 2001-2020, Chris Wensley et al,
#Y Copyright (C) 2001-2024, Chris Wensley et al,
#Y School of Computer Science, Bangor University, U.K.

##############################################################################
Expand Down Expand Up @@ -237,7 +237,7 @@ InstallGlobalFunction( TzPartition, function( T )
fi;
fi;
od;
commpairs := List( commpairs, L -> Set( L ) );
commpairs := List( commpairs, Set );
if ( ( TzOptions(T).printLevel > 1 ) and ( comm2 > 0 ) ) then
Print( "There were ", comm2, " commutators found in phase 1\n" );
fi;
Expand All @@ -249,7 +249,7 @@ InstallGlobalFunction( TzPartition, function( T )
r := rels[j];
lr := Length( r );
if ( lr > 1 ) then
freq := Collected( List( r, x -> AbsInt( x ) ) );
freq := Collected( List( r, AbsInt ) );
fnum := Length( freq );
for x in [1..fnum] do
L := freq[x];
Expand All @@ -270,7 +270,7 @@ InstallGlobalFunction( TzPartition, function( T )
od;
fi;
od;
comm2 := Sum( List( commpairs, L -> Length( L ) ) )/2;
comm2 := Sum( List( commpairs, Length ) )/2;
if ( ( TzOptions(T).printLevel > 1 ) and ( comm2 > comm1 ) ) then
Print( "There were ", comm2 - comm1 );
Print( " commutators found in phase 2\n" );
Expand Down Expand Up @@ -430,7 +430,7 @@ InstallGlobalFunction( FactorsPresentation, function( arg )
posn := Filtered( [1..len], k -> fac[k]=i );
Add( subrels, rel{posn} );
od;
sublen := List( subrels, L -> Length( L ) );
sublen := List( subrels, Length );
subflags := List( chosen[i], k -> flags[k] );
F[i].printLevel := printlevel;
subT := F[i].tietze;
Expand Down Expand Up @@ -697,15 +697,16 @@ function( G, H )
subG := Subgroup( autG, gensub );
while not stop do
stop := true;
reps := List( RightCosets( autG, subG ), c -> Representative(c) );
reps := List( RightCosets( autG, subG ), Representative );
numrep := Length( reps );
i := 1;
found := false;
while ( not found and ( i < numrep ) ) do
i := i+1;
r := reps[i];
ok := ForAll( H, J ->
ForAll( List(GeneratorsOfGroup(J),j->j^r in J), x->x=true) );
ForAll( List( GeneratorsOfGroup(J), j->j^r in J ),
x -> x=true ) );
if ok then
found := true;
stop := false;
Expand Down

0 comments on commit c7de56e

Please sign in to comment.