Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/addcoset.gi
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ InstallMethod( IsFinite,
##
#M Random( <A> ) . . . . . . . . . . . . . . . . . . . . for additive cosets
##
InstallMethod( Random,
"for an additive coset",
InstallMethodWithRandomSource( Random,
"for a random source and an additive coset",
true,
[ IsAdditiveCoset ], 0,
A -> Representative( A ) + Random( AdditivelyActingDomain( A ) ) );
[ IsRandomSource, IsAdditiveCoset ], 0,
{rs, A} -> Representative( A ) + Random( rs, AdditivelyActingDomain( A ) ) );


#############################################################################
Expand Down
2 changes: 1 addition & 1 deletion lib/coll.gi
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ end );


RedispatchOnCondition(Random,true,[IsCollection],[IsFinite],0);
RedispatchOnCondition(Random,true,[IsRandomSource,IsCollection],[IsFinite],0);
RedispatchOnCondition(Random,true,[IsRandomSource,IsCollection],[,IsFinite],0);

#############################################################################
##
Expand Down
13 changes: 13 additions & 0 deletions tst/testinstall/random.tst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,19 @@ gap> randomTest(SL(3,3), Random);
gap> randomTest(GL(2,2), Random);
gap> randomTest(GL(3,3), Random);

#
# additive cosets
#
gap> randomTest(AdditiveCoset(ZmodnZ(1),Identity(ZmodnZ(1))),Random);
gap> randomTest(AdditiveCoset(Integers,2),Random);
gap> randomTest(AdditiveCoset(CF(5),-2/3*E(5)-1/2*E(5)^2+1/3*E(5)^4),Random);
gap> randomTest(AdditiveCoset(GF(17),Z(17)^9),Random);
gap> R := SmallRing(10,2);;
gap> randomTest(AdditiveCoset(R,5*R.1),Random);
gap> a:= Algebra( GF(2), [ [ [ Z(2) ] ] ] );;
gap> rm:= FreeMagmaRing( GF(2), a );;
gap> randomTest(AdditiveCoset(rm, rm.1), Random);

#
# other stuff
#
Expand Down