aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog10
-rw-r--r--src/algebra/array1.spad.pamphlet9
-rw-r--r--src/algebra/array2.spad.pamphlet2
-rw-r--r--src/algebra/intfact.spad.pamphlet5
-rw-r--r--src/algebra/numode.spad.pamphlet9
-rw-r--r--src/algebra/numtheor.spad.pamphlet11
-rw-r--r--src/algebra/solvelin.spad.pamphlet4
-rw-r--r--src/algebra/stream.spad.pamphlet1
8 files changed, 32 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9c1f2e42..00c7642b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,15 @@
2010-06-13 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * algebra/array1.spad.pamphlet (IndexedFlexibleArray) [merge!]: Tidy.
+ * algebra/intfact.spad.pamphlet (IntegerRoots) [perfectNthRoot]:
+ Likewise.
+ * algebra/numode.spad.pamphlet
+ (NumericalOrdinaryDifferentialEquations) [rf4a]: Likewise.
+ * algebra/solvelin.spad.pamphlet (LinearSystemMatrixPackage)
+ [aSolution]: Likewise.
+
+2010-06-13 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* algebra/padic.spad.pamphlet (InnerPAdicInteger) [coerce]: Tidy.
2010-06-12 Gabriel Dos Reis <gdr@cs.tamu.edu>
diff --git a/src/algebra/array1.spad.pamphlet b/src/algebra/array1.spad.pamphlet
index d159b942..3f93b26f 100644
--- a/src/algebra/array1.spad.pamphlet
+++ b/src/algebra/array1.spad.pamphlet
@@ -305,11 +305,14 @@ IndexedFlexibleArray(S:Type, mn: Integer): Exports == Implementation where
m := #a; n := #b; growAdding(a, n, b)
for i in m-1..0 by -1 for j in m+n-1.. by -1 repeat a.f.j := a.f.i
i := n; j := 0
- k : Integer
- for k in 0.. while i < n+m and j < n repeat
+ k : Integer := 0
+ while i < n+m and j < n repeat
if g(a.f.i,b.f.j) then (a.f.k := a.f.i; i := i+1)
else (a.f.k := b.f.j; j := j+1)
- for k in k.. for j in j..n-1 repeat a.f.k := b.f.j
+ k := k + 1
+ for j' in j..n-1 repeat
+ a.f.k := b.f.j'
+ k := k + 1
a
select!(g:(S->Boolean), a:%) ==
diff --git a/src/algebra/array2.spad.pamphlet b/src/algebra/array2.spad.pamphlet
index eceb691a..0a89e53f 100644
--- a/src/algebra/array2.spad.pamphlet
+++ b/src/algebra/array2.spad.pamphlet
@@ -355,11 +355,9 @@ InnerIndexedTwoDimensionalArray(R,mnRow,mnCol,Row,Col):_
if R has SetCategory then
latex(m : %) : String ==
s : String := "\left[ \begin{array}{"
- j : Integer
for j in minColIndex(m)..maxColIndex(m) repeat
s := concat(s,"c")$String
s := concat(s,"} ")$String
- i : Integer
for i in minRowIndex(m)..maxRowIndex(m) repeat
for j in minColIndex(m)..maxColIndex(m) repeat
s := concat(s, latex(qelt(m,i,j))$R)$String
diff --git a/src/algebra/intfact.spad.pamphlet b/src/algebra/intfact.spad.pamphlet
index 00c54b24..8615cf7f 100644
--- a/src/algebra/intfact.spad.pamphlet
+++ b/src/algebra/intfact.spad.pamphlet
@@ -271,13 +271,14 @@ IntegerRoots(I:IntegerNumberSystem): Exports == Implementation where
perfectNthPower?(b, n) == perfectNthRoot(b, n) case I
perfectNthRoot n == -- complexity (log log n)**2 (log n)**2
- m:NNI
one? n or zero? n or n = -1 => [n, 1]
e:NNI := 1
p:NNI := 2
while p::I <= length(n) + 1 repeat
- for m in 0.. while (r := perfectNthRoot(n, p)) case I repeat
+ m: NNI := 0
+ while (r := perfectNthRoot(n, p)) case I repeat
n := r::I
+ m := m + 1
e := e * p ** m
p := convert(nextPrime(p::I))@Integer :: NNI
[n, e]
diff --git a/src/algebra/numode.spad.pamphlet b/src/algebra/numode.spad.pamphlet
index e2cdf52f..6e6be9bd 100644
--- a/src/algebra/numode.spad.pamphlet
+++ b/src/algebra/numode.spad.pamphlet
@@ -194,12 +194,12 @@ NumericalOrdinaryDifferentialEquations(): Exports == Implementation where
m : I := nvar
outlist : L OFORM := [x::E,x::E,x::E]
i : I
- iter : I
eps := 1.0/eps
for i in 1..m repeat
y(i) := ystart(i)
- for iter in 1..nstep repeat
+ iter : I := 1
+ while iter <= nstep repeat
--compute the derivative
derivs(dydx,y,x)
--if overshoot, the set h accordingly
@@ -212,15 +212,12 @@ NumericalOrdinaryDifferentialEquations(): Exports == Implementation where
rk4qclocal(y,dydx,nvar,x,step,eps,yscal,derivs
,t1,t2,t3,t4,t5,t6)
x := x + step.did
--- outlist.0 := x::E
--- outlist.1 := y(0)::E
--- outlist.2 := y(1)::E
--- output(blankSeparate(outlist)::E)
--check to see if done
if (x-x2) >= 0.0 then
leave
--next stepsize to use
step.try := step.next
+ iter := iter + 1
--end nstep repeat
if iter = (nstep+1) then
output("ode: ERROR ")
diff --git a/src/algebra/numtheor.spad.pamphlet b/src/algebra/numtheor.spad.pamphlet
index e3ed3b72..a4174263 100644
--- a/src/algebra/numtheor.spad.pamphlet
+++ b/src/algebra/numtheor.spad.pamphlet
@@ -405,8 +405,10 @@ IntegerNumberTheoryFunctions(): Exports == Implementation where
even? b and positiveRemainder(a,4) > 1 =>
error "J(a/b) not defined for b even and a = 2 or 3 (mod 4)"
even? b and even? a => 0
- k : Integer
- for k in 0.. while even? b repeat b := b quo 2
+ k : Integer := 0
+ while even? b repeat
+ b := b quo 2
+ k := k + 1
j:I := (odd? k and positiveRemainder(a,8) = 5 => -1; 1)
b = 1 => j
a := positiveRemainder(a,b)
@@ -418,7 +420,10 @@ IntegerNumberTheoryFunctions(): Exports == Implementation where
(a,b) := (b rem a,a)
else
-- J(2*a/b) = J(a/b) (-1) (b**2-1)/8
- for k in 0.. until odd? a repeat a := a quo 2
+ k := 0
+ until odd? a repeat
+ a := a quo 2
+ k := k + 1
if odd? k and (b+2) rem 8 > 4 then j := -j
a = 0 => 0
j
diff --git a/src/algebra/solvelin.spad.pamphlet b/src/algebra/solvelin.spad.pamphlet
index 470dd200..c7412659 100644
--- a/src/algebra/solvelin.spad.pamphlet
+++ b/src/algebra/solvelin.spad.pamphlet
@@ -79,8 +79,8 @@ LinearSystemMatrixPackage(F, Row, Col, M): Cat == Capsule where
-- find leading elements of diagonal
v := new(nvar, minRowIndex m - 1)$PrimitiveArray(Integer)
for i in minRowIndex m .. rk repeat
- j : Integer
- for j in 0.. while zero? qelt(m, i, j+minColIndex m) repeat 0
+ j : Integer := 0
+ while zero? qelt(m, i, j+minColIndex m) repeat j := j + 1
v.j := i
for j in 0..nvar-1 repeat
if v.j >= minRowIndex m then
diff --git a/src/algebra/stream.spad.pamphlet b/src/algebra/stream.spad.pamphlet
index fd13ff0f..79c37753 100644
--- a/src/algebra/stream.spad.pamphlet
+++ b/src/algebra/stream.spad.pamphlet
@@ -535,7 +535,6 @@ CyclicStreamTools(S,ST): Exports == Implementation where
eq?(x,y) => return y
computeCycleLength cycElt ==
- i : NonNegativeInteger
y := cycElt
for i in 1.. repeat
y := rst y