AllLibraryGroups( fun1,
val1, fun2, val2, ... )
For each group library there is a selection function. This function allows you to select all groups from the library that have a given set of properties.
The name of the selection functions always begins with All and
always ends with Groups. Inbetween is a name that hints at the
nature of the group library. For example the selection function for the
library of all primitive groups of degree at most 50 (see
The Primitive Groups Library) is called AllPrimitiveGroups, and
the selection function for the library of all 2-groups of size at most 256 (see
The 2-Groups Library) is called AllTwoGroups.
These functions take an arbitrary number of pairs of arguments. The first argument in such a pair is a function that can be applied to the groups in the library, and the second argument is either a single value that this function must return in order to have this group included in the selection, or a list of such values.
For example
AllPrimitiveGroups( DegreeOperation, [10..15],
Size, [1..100],
IsAbelian, false );
should return a list of all primitive groups with degree between 10 and 15, size less than 100, that are not abelian.
Thus the AllPrimitiveGroups behaves as if it was implemented by
a function similar to the one defined below, where PrimitiveGroupsList
is a list of all primitive groups. Note, in the definition below we assume
for simplicity that AllPrimitiveGroups accepts exactly 4
arguments. It is of course obvious how to change this definition so that the
function would accept a variable number of arguments.
AllPrimitiveGroups := function ( fun1, val1, fun2, val2 )
local groups, g, i;
groups := [];
for i in [ 1 .. Length( PrimitiveGroupsList ) ] do
g := PrimitiveGroupsList[i];
if fun1(g) = val1 or IsList(val1) and fun1(g) in val1
and fun2(g) = val2 or IsList(val2) and fun2(g) in val2
then
Add( group, g );
fi;
od;
return groups;
end;
Note that the real selection functions are considerably more difficult, to improve the efficiency. Most important, each recognizes a certain set of functions and handles those properties using an index (see About Group Libraries).