aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/rep2.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/rep2.spad.pamphlet')
-rw-r--r--src/algebra/rep2.spad.pamphlet31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/algebra/rep2.spad.pamphlet b/src/algebra/rep2.spad.pamphlet
index 4219ab67..5524c72d 100644
--- a/src/algebra/rep2.spad.pamphlet
+++ b/src/algebra/rep2.spad.pamphlet
@@ -312,10 +312,10 @@ RepresentationPackage2(R): public == private where
createRandomElement(aG,algElt) ==
numberOfGenerators : NNI := #aG
-- randomIndex := randnum numberOfGenerators
- randomIndex := 1+(random()$Integer rem numberOfGenerators)
+ randomIndex := 1 + random(numberOfGenerators)$Integer
algElt := algElt * aG.randomIndex
-- randomIndxElement := randnum numberOfGenerators
- randomIndex := 1+(random()$Integer rem numberOfGenerators)
+ randomIndex := 1 + random(numberOfGenerators)$Integer
algElt + aG.randomIndex
@@ -481,8 +481,7 @@ RepresentationPackage2(R): public == private where
-- fingerprint.
x0,x1: M R
if randomelements then -- random should not be from I
- --randomIndex : I := randnum numberOfGenerators
- randomIndex := 1+(random()$Integer rem numberOfGenerators)
+ randomIndex := 1 + random(numberOfGenerators)$Integer
x0 := aG0.randomIndex
x1 := aG1.randomIndex
n : NNI := #row(x0,1) -- degree of representation
@@ -496,12 +495,10 @@ RepresentationPackage2(R): public == private where
-- chosen elements form "aG".
if i = 7 then randomelements := true
if randomelements then
- --randomIndex := randnum numberOfGenerators
- randomIndex := 1+(random()$Integer rem numberOfGenerators)
+ randomIndex := 1 + random(numberOfGenerators)$Integer
x0 := x0 * aG0.randomIndex
x1 := x1 * aG1.randomIndex
- --randomIndex := randnum numberOfGenerators
- randomIndex := 1+(random()$Integer rem numberOfGenerators)
+ randomIndex := 1 + random(numberOfGenerators)$Integer
x0 := x0 + aG0.randomIndex
x1 := x1 + aG1.randomIndex
else
@@ -576,8 +573,7 @@ RepresentationPackage2(R): public == private where
result : B := false
numberOfGenerators : NNI := #aG
-- need a start value for creating random matrices:
- -- randomIndex : I := randnum numberOfGenerators
- randomIndex := 1+(random()$Integer rem numberOfGenerators)
+ randomIndex := 1 + random(numberOfGenerators)$Integer
x : M R := aG.randomIndex
n : NNI := #row(x,1) -- degree of representation
foundResult : B := false
@@ -587,11 +583,9 @@ RepresentationPackage2(R): public == private where
-- create random elements recursively:
-- x_i+1 :=x_i * mr1 + mr2, where mr1 and mr2 are randomly
-- chosen elements form "aG".
- -- randomIndex := randnum numberOfGenerators
- randomIndex := 1+(random()$Integer rem numberOfGenerators)
+ randomIndex := 1 + random(numberOfGenerators)$Integer
x := x * aG.randomIndex
- --randomIndex := randnum numberOfGenerators
- randomIndex := 1+(random()$Integer rem numberOfGenerators)
+ randomIndex := 1 + random(numberOfGenerators)$Integer
x := x + aG.randomIndex
-- test whether rank of x is n-1
rk : NNI := rank x
@@ -672,8 +666,7 @@ RepresentationPackage2(R): public == private where
-- if we switch to randomelements later, we take the last
-- fingerprint.
if randomelements then -- random should not be from I
- --randomIndex : I := randnum numberOfGenerators
- randomIndex := 1+(random()$Integer rem numberOfGenerators)
+ randomIndex := 1 + random(numberOfGenerators)$Integer
x : M R := algebraGenerators.randomIndex
foundResult : B := false
for i in 1..numberOfTries until foundResult repeat
@@ -685,11 +678,9 @@ RepresentationPackage2(R): public == private where
-- chosen elements form "algebraGenerators".
if i = 7 then randomelements := true
if randomelements then
- --randomIndex := randnum numberOfGenerators
- randomIndex := 1+(random()$Integer rem numberOfGenerators)
+ randomIndex := 1 + random(numberOfGenerators)$Integer
x := x * algebraGenerators.randomIndex
- --randomIndex := randnum numberOfGenerators
- randomIndex := 1+(random()$Integer rem numberOfGenerators)
+ randomIndex := 1 + random(numberOfGenerators)$Integer
x := x + algebraGenerators.randomIndex
else
x := fingerPrint (i, algebraGenerators.1,_