> < ^ Date: Wed, 26 Apr 1995 10:03:00 +0200
> ^ From: Frank Luebeck <frank.luebeck@math.rwth-aachen.de >
> ^ Subject: Loops and iterators

Dear GAP-Forum,

I have written some time ago an example of an "iterator"-function
which I use in my programs.

Since these functions may be useful for other GAP-users too, I have
put them into a file named 'IRTransversal.g', added some documentation
and copied this file to ftp.math.rwth-aachen.de, directory
pub/incoming.

Here is the documentation part of this file:
##
##  This file  contains GAP-functions for  looping through a list of right
##  coset representatives for a  permutation  group  modulo some  subgroup
##  (which may be trivial), but without producing such a list.
##
##  The two functions to use are  called  'IterativeRightTransversal'  and
##  'NextIRT'.
##
##  Let g be a permutation group in GAP and u a subgroup of g.  The output
##  of 'IterativeRightTransversal(g,u)'  is  a  record <IRT>  which mainly
##  contains   the stabilizer chain   of the  bigger  group.   The call of
##  'NextIRT(<IRT>)' produces a  new coset representative  as long as  the
##  record component <IRT>.more equals 'true'.
##
##  The easiest way to understand the usage may be to look at an example:
##
##
##      gap> g:=Group((1,2,3,4),(1,2));
##      Group( (1,2,3,4), (1,2) )
##      gap> u:=Subgroup(g,[(1,2),(3,4)]);
##      Subgroup( Group( (1,2,3,4), (1,2) ), [ (1,2), (3,4) ] )
##      gap> irt:=IterativeRightTransversal(g,u);;
##      gap> while irt.more do Print(NextIRT(irt),"\n"); od;
##      ()
##      (2,4,3)
##      (1,4,2,3)
##      (2,3,4)
##      (1,4)
##      (1,2,3,4)
##      gap> irt.more;
##      false
##      gap> NextIRT(irt); # from now always the last element is returned:
##      (1,2,3,4)
##      gap>
##
##  (OK, this  is  example is not  very  interesting because  in this case
##  'irt' is bigger than the output of 'RightTransversal'.)
##

I'm anxious to know how such constructs will be realized in future
versions of GAP.

Best regards,
Frank Luebeck


> < [top]