37.2 Selection Functions

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 The Primitive Groups Library) is called AllPrimitiveGroups, and the selection function for 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 and 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( groups, 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 About Group Libraries).

Previous Up Top Next
Index

GAP 3.4.4
April 1997