diff --git a/books/bookvol10.3.pamphlet b/books/bookvol10.3.pamphlet index 569e470..49498e8 100644 --- a/books/bookvol10.3.pamphlet +++ b/books/bookvol10.3.pamphlet @@ -36434,6 +36434,7 @@ g :: FRAC COMPLEX INT --R 15 --R Type: Fraction Complex Integer --E 12 + )spool )lisp (bye) @ @@ -36897,14 +36898,14 @@ Fraction(S: IntegralDomain): QuotientFieldCategory S with zero? qq => pp zero? degree pp or zero? degree qq => 1 denpp:="lcm"/[denom u for u in coefficients pp] - ppD:DP:=map(retract(#1*denpp),pp) + ppD:DP:=map(x+->retract(x*denpp),pp) denqq:="lcm"/[denom u for u in coefficients qq] - qqD:DP:=map(retract(#1*denqq),qq) + qqD:DP:=map(x+->retract(x*denqq),qq) g:=gcdPolynomial(ppD,qqD) zero? degree g => 1 -- one? (lc:=leadingCoefficient g) => map(#1::%,g) - ((lc:=leadingCoefficient g) = 1) => map(#1::%,g) - map(#1 / lc,g) + ((lc:=leadingCoefficient g) = 1) => map(x+->x::%,g) + map(x+->x/lc,g) if (S has PolynomialFactorizationExplicit) then -- we'll let the solveLinearPolynomialEquations operator @@ -36944,36 +36945,38 @@ Fraction(S: IntegralDomain): QuotientFieldCategory S with factorPolynomial(pp) == zero? pp => 0 denpp:="lcm"/[denom u for u in coefficients pp] - ppD:DP:=map(retract(#1*denpp),pp) + ppD:DP:=map(x+->retract(x*denpp),pp) ff:=factorPolynomial ppD den1:%:=denpp::% lfact:List Record(flg:Union("nil", "sqfr", "irred", "prime"), fctr:QFP, xpnt:Integer) lfact:= [[w.flg, - if leadingCoefficient w.fctr =1 then map(#1::%,w.fctr) + if leadingCoefficient w.fctr =1 then + map(x+->x::%,w.fctr) else (lc:=(leadingCoefficient w.fctr)::%; den1:=den1/lc**w.xpnt; - map(#1::%/lc,w.fctr)), + map(x+->x::%/lc,w.fctr)), w.xpnt] for w in factorList ff] - makeFR(map(#1::%/den1,unit(ff)),lfact) + makeFR(map(x+->x::%/den1,unit(ff)),lfact) factorSquareFreePolynomial(pp) == zero? pp => 0 degree pp = 0 => makeFR(pp,empty()) lcpp:=leadingCoefficient pp pp:=pp/lcpp denpp:="lcm"/[denom u for u in coefficients pp] - ppD:DP:=map(retract(#1*denpp),pp) + ppD:DP:=map(x+->retract(x*denpp),pp) ff:=factorSquareFreePolynomial ppD den1:%:=denpp::%/lcpp lfact:List Record(flg:Union("nil", "sqfr", "irred", "prime"), fctr:QFP, xpnt:Integer) lfact:= [[w.flg, - if leadingCoefficient w.fctr =1 then map(#1::%,w.fctr) + if leadingCoefficient w.fctr =1 then + map(x+->x::%,w.fctr) else (lc:=(leadingCoefficient w.fctr)::%; den1:=den1/lc**w.xpnt; - map(#1::%/lc,w.fctr)), + map(x+->x::%/lc,w.fctr)), w.xpnt] for w in factorList ff] - makeFR(map(#1::%/den1,unit(ff)),lfact) + makeFR(map(x+->x::%/den1,unit(ff)),lfact) @ <>= diff --git a/changelog b/changelog index 3dbaa1e..6a41191 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +20090419 tpd src/axiom-website/patches.html 20090419.02.tpd.patch +20090419 tpd books/bookvol10.3 convert FRAC to +-> notation +20090419 tpd src/input/Makefile add FRAC regression test +20090419 tpd src/input/unittest4.input add FRAC regression test 20090419 tpd src/axiom-website/patches.html 20090419.01.tpd.patch 20090419 tpd books/bookvol9 move portions of the compiler 20090418 tpd src/axiom-website/patches.html 20090418.02.tpd.patch diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index f730fea..8858d1b 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -1104,5 +1104,7 @@ bookvol10.4 convert EF to +-> syntax
bookvol9 move portions of the compiler
20090419.01.tpd.patch bookvol9 move portions of the compiler
+20090419.02.tpd.patch +bookvol10.3 convert FRAC to +-> syntax
diff --git a/src/input/Makefile.pamphlet b/src/input/Makefile.pamphlet index 8cfea16..4a823b5 100644 --- a/src/input/Makefile.pamphlet +++ b/src/input/Makefile.pamphlet @@ -380,7 +380,7 @@ REGRES= algaggr.regress algbrbf.regress algfacob.regress alist.regress \ textfile.regress torus.regress \ triglim.regress tsetcatvermeer.regress tutchap1.regress \ typetower.regress void.regress uniseg.regress \ - unittest1.regress unittest2.regress unittest3.regress + unittest1.regress unittest2.regress unittest3.regress unittest4.regress IN= ${SRC}/input MID= ${INT}/input @@ -690,7 +690,7 @@ FILES= ${OUT}/algaggr.input ${OUT}/algbrbf.input ${OUT}/algfacob.input \ ${OUT}/tutchap4.input ${OUT}/tutchap67.input ${OUT}/typetower.input \ ${OUT}/typo.input \ ${OUT}/uniseg.input ${OUT}/up.input ${OUT}/unittest1.input \ - ${OUT}/unittest2.input ${OUT}/unittest3.input \ + ${OUT}/unittest2.input ${OUT}/unittest3.input ${OUT}/unittest4.input \ ${OUT}/vector.input ${OUT}/vectors.input ${OUT}/viewdef.input \ ${OUT}/void.input ${OUT}/wiggle.input \ ${OUT}/wutset.input \ diff --git a/src/input/unittest4.input.pamphlet b/src/input/unittest4.input.pamphlet new file mode 100644 index 0000000..0bf8616 --- /dev/null +++ b/src/input/unittest4.input.pamphlet @@ -0,0 +1,64 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/input unittest4.input} +\author{Timothy Daly} +\maketitle +\begin{abstract} +Unit test the $+->$ syntax changes +\end{abstract} +\eject +\tableofcontents +\eject +<<*>>= +)set break resume +)sys rm -f unittest4.output +)spool unittest4.output +)set mes auto off +)clear all + +@ +Unit tests of $+->$ syntax change to gcdPolynomial in FRAC +<<*>>= + +--S 1 of 4 +gcdPolynomial((3*x^2+6)::SUP(FRAC(INT)),(9*x^3+12)::SUP(FRAC(INT)))$FRAC(POLY(INT)) +--E 1 + +--S 2 of 4 +)lisp (trace |FRAC;gcdPolynomial;3Sup;35!0|) +--R +--RValue = (|FRAC;gcdPolynomial;3Sup;35!0|) +--E 2 + +--S 3 of 4 +)lisp (trace |FRAC;gcdPolynomial;3Sup;35!1|) +--R +--RValue = (|FRAC;gcdPolynomial;3Sup;35!1|) +--E 3 + +--S 4 of 4 +gcdPolynomial((3*x^2+6)::SUP(FRAC(INT)),(9*x^3+12)::SUP(FRAC(INT)))$FRAC(POLY(INT)) +--R +--I 1> (|FRAC;gcdPolynomial;3Sup;35!0| ((0 . 3) 0 . 1) #) +--R <1 (|FRAC;gcdPolynomial;3Sup;35!0| (0 . 3)) +--I 1> (|FRAC;gcdPolynomial;3Sup;35!0| ((0 . 6) 0 . 1) #) +--R <1 (|FRAC;gcdPolynomial;3Sup;35!0| (0 . 6)) +--I 1> (|FRAC;gcdPolynomial;3Sup;35!1| ((0 . 9) 0 . 1) #) +--R <1 (|FRAC;gcdPolynomial;3Sup;35!1| (0 . 9)) +--I 1> (|FRAC;gcdPolynomial;3Sup;35!1| ((0 . 12) 0 . 1) #) +--R <1 (|FRAC;gcdPolynomial;3Sup;35!1| (0 . 12)) +--R +--R (2) 1 +--R Type: SparseUnivariatePolynomial Fraction Polynomial Integer +--E 4 + +)spool +)lisp (bye) + +@ +\eject +\begin{thebibliography}{99} +\bibitem{1} nothing +\end{thebibliography} +\end{document}