axiom-developer
[Top][All Lists]

[Axiom-developer] 20090508.01.tpd.patch (bookvol10.4 REALSOLV +-> conver

 From: daly Subject: [Axiom-developer] 20090508.01.tpd.patch (bookvol10.4 REALSOLV +-> conversion) Date: Fri, 8 May 2009 11:31:10 -0500

```Convert REALSOLV to use +-> syntax.
Add )d op examples for solve and realSolve

========================================================================
diff --git a/books/bookvol10.4.pamphlet b/books/bookvol10.4.pamphlet
index 724f459..8260a3e 100644
--- a/books/bookvol10.4.pamphlet
+++ b/books/bookvol10.4.pamphlet
@@ -132775,53 +132775,62 @@ o )show RealSolvePackage

<<package REALSOLV RealSolvePackage>>=
)abbrev package REALSOLV RealSolvePackage
+++ Description: This package provides numerical solutions of systems of
+++   polynomial equations for use in ACPLOT
+RealSolvePackage(): Exports == Implementation where
+  I    ==> Integer
+  IE   ==> IndexedExponents Symbol
+  L    ==> List
+  NF   ==> Float
+  P    ==> Polynomial
+  RN   ==> Fraction Integer
+  SE   ==> Symbol
+  RFI  ==> Fraction Polynomial Integer
+  LIFT ==> PolynomialCategoryLifting(IE,SE,RN,P RN, RFI)
+  SOLV ==> FloatingRealPackage Float

-RealSolvePackage(): _
-  with
-
-    solve: (Polynomial Fraction Integer,Float) -> List Float
+  Exports ==> with
+    solve: (P RN,NF) -> L NF
++ solve(p,eps) finds the real zeroes of a
++ univariate rational polynomial p with precision eps.
+      ++
+      ++X p := 4*x^3 - 3*x^2 + 2*x - 4
+      ++X solve(p::POLY(FRAC(INT)),0.01)\$REALSOLV

-    solve: (Polynomial Integer,Float) -> List Float
+    solve: (P I,NF) -> L NF
++ solve(p,eps) finds the real zeroes of a univariate
++ integer polynomial p with precision eps.
+      ++
+      ++X p := 4*x^3 - 3*x^2 + 2*x - 4
+      ++X solve(p,0.01)\$REALSOLV

-    realSolve: (List Polynomial Integer,List Symbol,Float) -> List List Float
+    realSolve: (L P I,L SE,NF) -> L L NF
++ realSolve(lp,lv,eps) = compute the list of the real
++ solutions of the list lp of polynomials with integer
++ coefficients with respect to the variables in lv,
++ with precision eps.
+      ++
+      ++X p1 := x**2*y*z + y*z
+      ++X p2 := x**2*y**2*z + x + z
+      ++X p3 := x**2*y**2*z**2 +  z + 1
+      ++X lp := [p1, p2, p3]
+      ++X realSolve(lp,[x,y,z],0.01)

-    prn2rfi: Polynomial Fraction Integer -> Fraction Polynomial Integer
+    prn2rfi: P RN -> RFI
prn2rfi p ==
-      map(#1 :: Fraction Polynomial Integer,_
-          (numer(#1) :: Fraction Polynomial Integer)_
-            /(denom(#1) :: Fraction Polynomial Integer),p)_
-             \$PolynomialCategoryLifting(IndexedExponents Symbol, _
-               Symbol, _
-               Fraction Integer, _
-               Polynomial Fraction Integer, _
-               Fraction Polynomial Integer)
+      map(x+->x::RFI, x+->(numer(x)::RFI)/(denom(x)::RFI), p)\$LIFT

-    pi2rfi: Polynomial Integer -> Fraction Polynomial Integer
-    pi2rfi p == p :: Fraction Polynomial Integer
+    pi2rfi: P I -> RFI
+    pi2rfi p == p :: RFI

-    solve(p:Polynomial Fraction Integer,eps:Float) ==
-      realRoots(prn2rfi p,eps)\$(FloatingRealPackage(Float))
+    solve(p:P RN,eps:NF) == realRoots(prn2rfi p, eps)\$SOLV

-    solve(p:Polynomial Integer,eps:Float) ==
-      realRoots(p :: Fraction Polynomial Integer,eps)_
-       \$(FloatingRealPackage(Float))
+    solve(p:P I,eps:NF)  == realRoots(p::RFI, eps)\$SOLV

realSolve(lp,lv,eps) ==
-      realRoots(map(pi2rfi,lp)_
-       \$ListFunctions2(Polynomial Integer,Fraction Polynomial Integer),lv,eps)_
-        \$(FloatingRealPackage(Float))
-
-
+      realRoots(map(pi2rfi, lp)\$ListFunctions2(P I,RFI),lv,eps)\$SOLV

@
<<REALSOLV.dotabb>>=
diff --git a/changelog b/changelog
index af426b5..8337ff0 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,5 @@
+20090508 tpd src/axiom-website/patches.html 20090508.01.tpd.patch
+20090508 tpd books/bookvol10.4 REALSOLV +-> conversion
20090501 tpd src/axiom-website/patches.html 20090501.01.tpd.patch
20090501 tpd src/input/*.input modified to use latex tangle
20090501 tpd src/scripts/tex/axiom.sty add chunk environment
diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html
index 3b389cd..bf6aa01 100644
--- a/src/axiom-website/patches.html
+++ b/src/axiom-website/patches.html
@@ -1114,5 +1114,7 @@ tangle.lisp common lisp literate tangle function <br/>
apply.boot removed, rewritten into lisp, not autoloaded <br/>
<a href="patches/20090501.01.tpd.patch">20090501.01.tpd.patch</a>
*.input now uses latex tangle <br/>
+<a href="patches/20090508.01.tpd.patch">20090508.01.tpd.patch</a>
+bookvol10.4 REALSOLV +-> conversion<br/>
</body>
</html>

```