diff options
Diffstat (limited to 'src/algebra/permgrps.spad.pamphlet')
-rw-r--r-- | src/algebra/permgrps.spad.pamphlet | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/algebra/permgrps.spad.pamphlet b/src/algebra/permgrps.spad.pamphlet index 39a9db79..652d4dbd 100644 --- a/src/algebra/permgrps.spad.pamphlet +++ b/src/algebra/permgrps.spad.pamphlet @@ -272,16 +272,16 @@ PermutationGroup(S:SetCategory): public == private where ranelt ( group : L V NNI , word : L L NNI , maxLoops : I ) : REC3 == -- generate a "random" element numberOfGenerators := # group - randomInteger : I := 1 + (random()$Integer rem numberOfGenerators) + randomInteger : I := 1 + random(numberOfGenerators)$Integer randomElement : V NNI := group.randomInteger words := nil()$(L NNI) if wordProblem then words := word.(randomInteger::NNI) if positive? maxLoops then - numberOfLoops : I := 1 + (random()$Integer rem maxLoops) + numberOfLoops : I := 1 + random(maxLoops)$Integer else numberOfLoops : I := maxLoops while positive? numberOfLoops repeat - randomInteger : I := 1 + (random()$Integer rem numberOfGenerators) + randomInteger : I := 1 + random(numberOfGenerators)$Integer randomElement := times ( group.randomInteger , randomElement ) if wordProblem then words := append ( word.(randomInteger::NNI) , words) numberOfLoops := numberOfLoops - 1 @@ -651,11 +651,11 @@ PermutationGroup(S:SetCategory): public == private where maximalNumberOfFactors < 1 => 1$(PERM S) gp : L PERM S := group.gens numberOfGenerators := # gp - randomInteger : I := 1 + (random()$Integer rem numberOfGenerators) + randomInteger : I := 1 + random(numberOfGenerators)$Integer randomElement := gp.randomInteger - numberOfLoops : I := 1 + (random()$Integer rem maximalNumberOfFactors) + numberOfLoops : I := 1 + random(maximalNumberOfFactors)$Integer while positive? numberOfLoops repeat - randomInteger : I := 1 + (random()$Integer rem numberOfGenerators) + randomInteger : I := 1 + random(numberOfGenerators)$Integer randomElement := gp.randomInteger * randomElement numberOfLoops := numberOfLoops - 1 randomElement |