diff options
author | dos-reis <gdr@axiomatics.org> | 2011-08-14 03:30:48 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-08-14 03:30:48 +0000 |
commit | 775f2c3cca11ab64df713afb7f35363afe5d4ce0 (patch) | |
tree | aec69a68ef31a45f12368475b501841bada1f010 /src/algebra | |
parent | 1734e62de427defcd090a95bc8b3b879c67d3fbf (diff) | |
download | open-axiom-775f2c3cca11ab64df713afb7f35363afe5d4ce0.tar.gz |
* interp/compiler.boot (compRepeatOrCollect): Set $loopKind directly.
(complainIfShadowing): Don't complain when collecting.
* algebra/contfrac.spad.pamphlet: Remove capsule-level declaration
of local variables.
* algebra/cycles.spad.pamphlet: Likewise.
* algebra/cyclotom.spad.pamphlet: Likewise.
* algebra/ddfact.spad.pamphlet: Likewise.
* algebra/fortpak.spad.pamphlet: Likewise.
* algebra/lingrob.spad.pamphlet: Likewise.
* algebra/numode.spad.pamphlet: Likewise.
* algebra/numquad.spad.pamphlet: Likewise.
* algebra/out.spad.pamphlet: Likewise.
* algebra/perman.spad.pamphlet: Likewise.
* algebra/view2D.spad.pamphlet: Likewise.
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/contfrac.spad.pamphlet | 3 | ||||
-rw-r--r-- | src/algebra/cycles.spad.pamphlet | 1 | ||||
-rw-r--r-- | src/algebra/cyclotom.spad.pamphlet | 2 | ||||
-rw-r--r-- | src/algebra/ddfact.spad.pamphlet | 1 | ||||
-rw-r--r-- | src/algebra/fortpak.spad.pamphlet | 5 | ||||
-rw-r--r-- | src/algebra/lingrob.spad.pamphlet | 8 | ||||
-rw-r--r-- | src/algebra/numode.spad.pamphlet | 3 | ||||
-rw-r--r-- | src/algebra/numquad.spad.pamphlet | 13 | ||||
-rw-r--r-- | src/algebra/out.spad.pamphlet | 9 | ||||
-rw-r--r-- | src/algebra/perman.spad.pamphlet | 11 | ||||
-rw-r--r-- | src/algebra/view2D.spad.pamphlet | 4 |
11 files changed, 16 insertions, 44 deletions
diff --git a/src/algebra/contfrac.spad.pamphlet b/src/algebra/contfrac.spad.pamphlet index c1adc3ea..6b0b598e 100644 --- a/src/algebra/contfrac.spad.pamphlet +++ b/src/algebra/contfrac.spad.pamphlet @@ -294,7 +294,6 @@ ContinuedFraction(R): Exports == Implementation where c, d: % a: R q: Q - n: Integer 0 == (0$R) :: % 1 == (1$R) :: % @@ -305,7 +304,7 @@ ContinuedFraction(R): Exports == Implementation where c * d == genFromSequence map(#1 * #2, apx c, apx d) a * d == genFromSequence map( a * #1, apx d) q * d == genFromSequence map( q * #1, apx d) - n * d == genFromSequence map( n * #1, apx d) + n: Integer * d == genFromSequence map( n * #1, apx d) c / d == genFromSequence map(#1 / #2, apx c, rest apx d) recip c ==(c = 0 => "failed"; genFromSequence map( 1 / #1, rest apx c)) diff --git a/src/algebra/cycles.spad.pamphlet b/src/algebra/cycles.spad.pamphlet index b8dea37f..f74ba814 100644 --- a/src/algebra/cycles.spad.pamphlet +++ b/src/algebra/cycles.spad.pamphlet @@ -252,7 +252,6 @@ EvaluateCycleIndicators(F):T==C where fn:I->F pt:PTN spol:SPOL RN - i:I evp(fn, pt)== */[fn i for i in pt::L(PositiveInteger)] eval(fn,spol)== diff --git a/src/algebra/cyclotom.spad.pamphlet b/src/algebra/cyclotom.spad.pamphlet index aa7fba78..631476a2 100644 --- a/src/algebra/cyclotom.spad.pamphlet +++ b/src/algebra/cyclotom.spad.pamphlet @@ -43,7 +43,6 @@ CyclotomicPolynomialPackage: public == private where cyclotomicDecomposition(n:Integer):LSUP == x,y,z: SUP l,ll,m: LSUP - rr: Integer g := factors factor(n)$IFP l := [monomial(1,1) - monomial(1,0)] --Now, for each prime in the factorization apply recursion @@ -57,7 +56,6 @@ CyclotomicPolynomialPackage: public == private where l cyclotomicFactorization(n:Integer):FR == - f : SUP fr : FR := 1$FR for f in cyclotomicDecomposition(n) repeat fr := fr * primeFactor(f,1$Integer) diff --git a/src/algebra/ddfact.spad.pamphlet b/src/algebra/ddfact.spad.pamphlet index 80e8b3fd..069ae724 100644 --- a/src/algebra/ddfact.spad.pamphlet +++ b/src/algebra/ddfact.spad.pamphlet @@ -148,7 +148,6 @@ DistinctDegreeFactorize(F,FP): C == T dg:NNI :=0 ddfact:List(fact):=empty() --evaluation of x**p mod m - k1:NNI u:= m du := degree u setPoly u diff --git a/src/algebra/fortpak.spad.pamphlet b/src/algebra/fortpak.spad.pamphlet index 911ed3d5..05d33441 100644 --- a/src/algebra/fortpak.spad.pamphlet +++ b/src/algebra/fortpak.spad.pamphlet @@ -535,7 +535,6 @@ MultiVariableCalculusFunctions(S,F,FLAF,FLAS) : Exports == Implementation where xlist:List(S) := parts(xflas) localGradient(v,xlist) localDivergence(vf:Vector(F),xlist:List(S)):F == - i: PI n: NNI ans: F -- Perhaps should report error if two args of min different @@ -545,7 +544,6 @@ MultiVariableCalculusFunctions(S,F,FLAF,FLAS) : Exports == Implementation where ans divergence(vf,xflas) == xlist:List(S) := parts(xflas) - i: PI n: NNI ans: F -- Perhaps should report error if two args of min different @@ -565,11 +563,9 @@ MultiVariableCalculusFunctions(S,F,FLAF,FLAS) : Exports == Implementation where -- matrix([[D(vf(i),x) for x in xlist] for i in 1 .. maxIndex(vf)]) jacobian(vf,xflas) == xlist:List(S) := parts(xflas) - i: PI matrix([[D(vf(i),x) for x in xlist] for i in 1 .. maxIndex(vf)]) bandedHessian(v,xflas,k) == xlist:List(S) := parts(xflas) - j,iw: PI n: NNI bandM: Matrix F n:= #(xlist) @@ -581,7 +577,6 @@ MultiVariableCalculusFunctions(S,F,FLAF,FLAS) : Exports == Implementation where bandM bandedJacobian(vf,xflas,kl,ku) == xlist:List(S) := parts(xflas) - j,iw: PI n: NNI bandM: Matrix F n:= #(xlist) diff --git a/src/algebra/lingrob.spad.pamphlet b/src/algebra/lingrob.spad.pamphlet index 95284786..a3018052 100644 --- a/src/algebra/lingrob.spad.pamphlet +++ b/src/algebra/lingrob.spad.pamphlet @@ -128,10 +128,10 @@ LinGroebnerPackage(lv,F) : C == T ofirstmon:=firstmon orecfmon := recfmon lm:=zero(2*ndim+1) - j : Integer for j in 1..ndim repeat lm(j):=veccoef(j) lm(ndim+i):=recfmon.mult lm := reduceRow(linmat, lm, i-1, pivots) + j : Integer if i=ndim1 then j:=ndim1 else j:=1 @@ -179,11 +179,10 @@ LinGroebnerPackage(lv,F) : C == T omult := (omult exquo cc)::F veccoef:VF:=coord(f,algBasis) lm:=zero(2*ndim+1) - j : Integer for j in 1..ndim repeat lm(j) := veccoef(j) lm(ndim+i):=omult lm := reduceRow(linmat, lm, i-1, pivots) - j:=1 + j: Integer :=1 while lm(j)=0 and j<ndim1 repeat j:=j+1 if j=ndim1 then return g:HDPoly:=0 @@ -287,11 +286,10 @@ LinGroebnerPackage(lv,F) : C == T ofirstmon:=firstmon orecfmon := recfmon lm:=zero(2*ndim+1) - j : Integer for j in 1..ndim repeat lm(j):=veccoef(j) lm(ndim+i):=recfmon.mult lm := reduceRow(linmat, lm, i-1, pivots) - j:=1 + j: Integer :=1 while lm(j) = 0 and j<ndim1 repeat j:=j+1 if j=ndim1 then cordlist:List F:=[lm(j) for j in ndim1..ndim1+(#nBasis)] diff --git a/src/algebra/numode.spad.pamphlet b/src/algebra/numode.spad.pamphlet index 4a88a636..b602916c 100644 --- a/src/algebra/numode.spad.pamphlet +++ b/src/algebra/numode.spad.pamphlet @@ -193,7 +193,6 @@ NumericalOrdinaryDifferentialEquations(): Exports == Implementation where tiny : NF := 10.0**(-(digits()+1)::I) m : I := nvar outlist : L OFORM := [x::E,x::E,x::E] - i : I eps := 1.0/eps for i in 1..m repeat @@ -263,7 +262,6 @@ NumericalOrdinaryDifferentialEquations(): Exports == Implementation where errcon : NF := 0.6E-04 --(this is 4/safety)**(1/grow) hh : NF errmax : NF - i : I m : I := n -- for i in 1..m repeat @@ -343,7 +341,6 @@ NumericalOrdinaryDifferentialEquations(): Exports == Implementation where h6 : NF := h/6.0 xh : NF := x+hh m : I := n - i : I -- first step for i in 1..m repeat yt(i) := y(i) + hh*dydx(i) diff --git a/src/algebra/numquad.spad.pamphlet b/src/algebra/numquad.spad.pamphlet index c63bf852..6d3c42f3 100644 --- a/src/algebra/numquad.spad.pamphlet +++ b/src/algebra/numquad.spad.pamphlet @@ -226,7 +226,6 @@ NumericalQuadrature(): Exports == Implementation where x1 : F := a x2 : F := a + hh io : L OFORM := [x1::E,x2::E] - i : I for i in 1..nint repeat ans := romberg(func,x1,x2,epsrel,epsabs,nmin,nmax) if (not ans.success) then @@ -253,7 +252,6 @@ NumericalQuadrature(): Exports == Implementation where x1 : F := a x2 : F := a + hh io : L OFORM := [x1::E,x2::E] - i : I for i in 1..nint repeat ans := simpson(func,x1,x2,epsrel,epsabs,nmin,nmax) if (not ans.success) then @@ -275,7 +273,6 @@ NumericalQuadrature(): Exports == Implementation where sum : F := 0.0 err : F := 0.0 pts : I := 1 - i : I done : B := true hh : F := (b-a) / nint x1 : F := a @@ -307,10 +304,8 @@ NumericalQuadrature(): Exports == Implementation where change : F := 0.0 qx1 : F := newsum table : V F := new((nmax+1)::PI,0.0) - n : I := 1 pts : I := 1 four : I - j : I i : I if (nmin < 2) then output("romberg: nmin to small (nmin > 1) nmin = ",nmin::E) @@ -361,7 +356,6 @@ NumericalQuadrature(): Exports == Implementation where oldsum : F := 0.0 oldest : F := 0.0 change : F := 0.0 - n : I := 1 pts : I := 1 if (nmin < 2) then output("simpson: nmin to small (nmin > 1) nmin = ",nmin::E) @@ -403,7 +397,6 @@ NumericalQuadrature(): Exports == Implementation where newsum : F := 0.5*(b-a)*(func(a)+func(b)) change : F := 0.0 oldsum : F - n : I := 1 pts : I := 1 if (nmin < 2) then output("trapezoidal: nmin to small (nmin > 1) nmin = ",nmin::E) @@ -447,9 +440,7 @@ NumericalQuadrature(): Exports == Implementation where qx1 : F := newsum table : V F := new((nmax+1)::PI,0.0) four : I - j : I i : I - n : I := 1 pts : I := 1 for n in 1..nmax repeat oldsum := newsum @@ -486,7 +477,6 @@ NumericalQuadrature(): Exports == Implementation where oldsum : F := 0.0 oldest : F := 0.0 change : F := 0.0 - n : I := 1 pts : I := 1 for n in 1..nmax repeat oldsum := newsum @@ -514,7 +504,6 @@ NumericalQuadrature(): Exports == Implementation where change : F := 0.0 pts : I := 1 oldsum : F - n : I for n in 1..nmax repeat oldsum := newsum newsum := trapopen(func,a,delta,oldsum,pts) @@ -534,7 +523,6 @@ NumericalQuadrature(): Exports == Implementation where trapclosed(func,start,h,oldsum,numpoints) == x : F := start + 0.5*h sum : F := 0.0 - i : I for i in 1..numpoints repeat sum := sum + func(x) x := x + h @@ -546,7 +534,6 @@ NumericalQuadrature(): Exports == Implementation where ddel : F := 2.0*del x : F := start + 0.5*del sum : F := 0.0 - i : I for i in 1..numpoints repeat sum := sum + func(x) x := x + ddel diff --git a/src/algebra/out.spad.pamphlet b/src/algebra/out.spad.pamphlet index 57b24451..2ee2b81f 100644 --- a/src/algebra/out.spad.pamphlet +++ b/src/algebra/out.spad.pamphlet @@ -204,14 +204,13 @@ DisplayPackage: public == private where center0: (I,I,S) -> RECLR - s : S l : L S HION : S := "%b" HIOFF : S := "%d" NEWLINE : S := "%l" - bright s == [HION,s,HIOFF]$(L S) + bright(s: S) == [HION,s,HIOFF]$(L S) bright l == cons(HION,append(l,list HIOFF)) newLine() == NEWLINE @@ -228,7 +227,7 @@ DisplayPackage: public == private where t : S := copies(1 + (m quo (sayLength fill)),fill) [t(1..m),t(1..wid-len-m)]$RECLR - center(s, wid, fill) == + center(s: S, wid: I, fill: S) == wid < 1 => "" len : I := sayLength s len = wid => s @@ -244,13 +243,13 @@ DisplayPackage: public == private where rec : RECLR := center0(len,wid,fill) cons(rec.lhs,append(l,list rec.rhs)) - say s == + say(s: S) == sayBrightly$Lisp s say l == sayBrightly$Lisp l - sayLength s == #s + sayLength(s: S) == #s sayLength l == sum : I := 0 diff --git a/src/algebra/perman.spad.pamphlet b/src/algebra/perman.spad.pamphlet index 49519edb..b45620a4 100644 --- a/src/algebra/perman.spad.pamphlet +++ b/src/algebra/perman.spad.pamphlet @@ -152,7 +152,6 @@ Permanent(n : PositiveInteger, R : Ring with commutative("*")): x : SM a,b : R - i,j,k,l : I permanent3(x) == -- This algorithm is based upon the principle of inclusion- @@ -214,8 +213,9 @@ Permanent(n : PositiveInteger, R : Ring with commutative("*")): while j ~= n repeat -- we sum over all subsets of (1,...,n-1) sgn := -sgn b := sgn - if vv.1.j = 1 then k := -1 - else k := 1 -- was that element deleted(k=-1) or added(k=1)? + k := + vv.1.j = 1 => -1 + 1 -- was that element deleted(k=-1) or added(k=1)? for i in 1..n repeat w.i := w.i +$R k *$R x(i,j) b := b *$R w.i @@ -259,8 +259,9 @@ Permanent(n : PositiveInteger, R : Ring with commutative("*")): while j ~= n repeat -- we sum over all subsets of (1,...,n-1) sgn := -sgn b := sgn - if vv.1.j = 1 then k := -1 - else k := 1 -- was that element deleted(k=-1) or added(k=1)? + k := + vv.1.j = 1 => -1 + 1 -- was that element deleted(k=-1) or added(k=1)? c := k * two for i in 1..n repeat w.i := w.i +$R c *$R x(i,j) diff --git a/src/algebra/view2D.spad.pamphlet b/src/algebra/view2D.spad.pamphlet index c132bcec..5a032a44 100644 --- a/src/algebra/view2D.spad.pamphlet +++ b/src/algebra/view2D.spad.pamphlet @@ -307,7 +307,7 @@ GraphImage (): Exports == Implementation where makeGraph graf == doOptions(graf) - (s := #(graf.llPoints)) = 0 => + (n := #(graf.llPoints)) = 0 => error "You are trying to make a graph with no points" key graf ~= 0 => error "You are trying to draw over an existing graph" @@ -327,7 +327,7 @@ GraphImage (): Exports == Implementation where sendSF(VIEW,hi(second tonto))$Lisp sendSF(VIEW,first (graf.unitsField))$Lisp sendSF(VIEW,second (graf.unitsField))$Lisp - sendI(VIEW,s)$Lisp -- how many lists of points are being sent + sendI(VIEW,n)$Lisp -- how many lists of points are being sent for aList in graf.llPoints for pColor in graf.pointColors for lColor in graf.lineColors for s in graf.pointSizes repeat sendI(VIEW,#aList)$Lisp -- how many points in this list for p in aList repeat |