> < ^ Date: Mon, 21 May 2001 10:36:50 -0400 (EDT)
> < ^ From: Alexander Hulpke <hulpke@math.colostate.edu >
< ^ Subject: Re: am I missing something??

Dear GAP-Forum,

Michael Hartley wrote:
> But when I try to take the union or intersection of a DoubleCoset
> with a Set of group elements, GAP4 can't do it! It enters the break
> loop...

As Greg Gamble already wrote, the error message shows that an `Enumerator'
method for double cosets is missing. Such a method will be supplied in the
next bugfix, until then you can use the code I append below. (Simply put
this code in a file and read it in.)

With this extra code `Intersection' and `Union' should work as desired
(though they are not ``clever'' as they will produce a list of all
elements).

I hope this is of help,

Alexander Hulpke

# cut here ----
# missing methods for double coset enumerator. ahulpke, may 20, 2001

#############################################################################
##
#R  IsDoubleCosetEnumerator
##
DeclareRepresentation( "IsDoubleCosetEnumerator",
    IsDomainEnumerator and IsAttributeStoringRep,
    [ "leftgroupEnumerator", "leftgroup", "rightCosetReps", "leftsize" ] );

InstallMethod(Enumerator, "for a double coset",true,[IsDoubleCoset],0,
function( d )
local enum;
enum := Objectify( NewType( FamilyObj(d), IsDoubleCosetEnumerator ),
rec( leftgroupEnumerator := Enumerator( LeftActingGroup( d ) ),
leftgroup := LeftActingGroup( d ),
leftsize := Size( LeftActingGroup( d ) ),
rightCosetReps := RepresentativesContainedRightCosets(d) ) );
SetUnderlyingCollection( enum, d );
if HasIsFinite( d ) then
SetIsFinite( enum, IsFinite( d ) );
fi;
return enum;
end );

InstallMethod( \[\], "for double coset enumerator", true,
[ IsDoubleCosetEnumerator, IsPosInt ], 0,
function( enum, pos )
pos:=pos-1;
return enum!.leftgroupEnumerator[ (pos mod enum!.leftsize)+1]
* enum!.rightCosetReps[QuoInt(pos,enum!.leftsize)+1];
end );

InstallMethod( Position, "for double coset enumerator", true,
[ IsRightCosetEnumerator, IsMultiplicativeElementWithInverse, IsInt ], 0,
function( enum, elm, after )
local p;
p:=First([1..Length(enum!.rightCosetReps)],
i->elm/enum!.rightCosetReps[i] in enum!.leftgroup);
p:=(p-1)*enum!.leftsize
+Position(enum!.leftgroupEnumerator,elm/enum!.rightCosetReps[p],0);
if p<=after then
return fail; # no double elements
else
return p;
fi;
end );


> < [top]