login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for SandBoxMultivariatePolynomialDivision revision 1 of 3

1 2 3
Editor: Bill Page
Time: 2008/07/22 05:59:38 GMT-7
Note: new

changed:
-
A tutorial written by Angelos Mantzaflaris (currently on in Greek)
 
- http://eclass.uoa.gr/courses/MATH117/document/Simeioseis_axiom.pdf

contains the following routine:
\begin{axiom}
-- Multivariate Polynomial Division
mpolydiv (f,D)==
  lex := typeOf (f)
  Q:=[ 0:: lex for j in D ]
  r:= 0:: lex
  m:= #D
  lms :=[ leadingMonomial (D.j) for j in 1..m]
  j:= 1
  flag := false
  while f ~= 0 repeat
    if j>m then
      j:= 1
      if flag = false then
        t:= leadingMonomial f
        r:= r + t
        f:= f - t
      flag := false
      if normalForm ( leadingMonomial (f),[ lms .j ])=0 then
        t := ( leadingMonomial f/lms.j):: lex
        Q.j := Q.j + t
        f := f - t*D.j
        flag := true
      else
        j:= j+1
  rec := Record ( quotient : LIST lex , remainder : lex)
  return [Q,r]:: rec
\end{axiom}

Here is an example of it's use:
\begin{axiom}
lex:=DMP([x,y,z], FRAC INT)
d1: lex := -2* x^12 + 4* x^2 * y^4
d2: lex := x^2 - y^11
f :lex := 3*x^14*y^10 + 5*x*y^3 -6*y^7 + 1
mpolydiv(f, [d1,d2])
mpolydiv(f, [d2,d1])
.quotient 1 * d2 + %.quotient 2 * d1 + %.remainder
\end{axiom}

A tutorial written by Angelos Mantzaflaris (currently on in Greek)

  • http://eclass.uoa.gr/courses/MATH117/document/Simeioseis_axiom.pdf

contains the following routine: \begin{axiom} -- Multivariate Polynomial Division mpolydiv (f,D)== lex := typeOf (f) Q:=[ 0:: lex for j in D ] r:= 0:: lex m:= #D lms :=[ leadingMonomial (D.j) for j in 1..m] j:= 1 flag := false while f ~= 0 repeat if j>m then j:= 1 if flag = false then t:= leadingMonomial f r:= r + t f:= f - t flag := false if normalForm ( leadingMonomial (f),[ lms .j ])=0 then t := ( leadingMonomial f/lms.j):: lex Q.j := Q.j + t f := f - t*D.j flag := true else j:= j+1 rec := Record ( quotient : LIST lex , remainder : lex) return [Q,r]:: rec \end{axiom}

Here is an example of it's use: \begin{axiom} lex:=DMP([x,y,z], FRAC INT) d1: lex := -2 x^12 + 4 x^2 y^4 d2: lex := x^2 - y^11 f :lex := 3x^14y^10 + 5xy^3 -6y^7 + 1 mpolydiv(f, [d1,d2]) mpolydiv(f, [d2,d1]) .quotient 1 d2 + %.quotient 2 d1 + %.remainder \end{axiom}


Some or all expressions may not have rendered properly, because Axiom returned the following error:
Error: export AXIOM=/usr/local/lib/axiom/target/x86_64-unknown-linux; ALDORROOT=/usr/local/aldor/linux/1.1.0; export PATH=$ALDORROOT/bin:$PATH; export HOME=/var/zope2/var/LatexWiki; ulimit -t 240; $AXIOM/bin/AXIOMsys < /var/zope2/var/LatexWiki/7310038064502082312-25px.axm

GCL (GNU Common Lisp) 2.6.8 CLtL1 Nov 9 2007 07:47:56 Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl) Binary License: GPL due to GPL'ed components: (READLINE BFD UNEXEC) Modifications of this banner must retain notice of a compatible license Dedicated to the memory of W. Schelter

Use (help) to get some basic information on how to use GCL. Temporary directory for compiler files set to /tmp/ FriCAS (AXIOM fork) Computer Algebra System Version: FriCAS 2007-10-02 Timestamp: Friday November 9, 2007 at 19:35:06 ----------------------------------------------------------------------------- Issue )copyright to view copyright notices. Issue )summary for a summary of useful system commands. Issue )quit to leave FriCAS and return to shell. -----------------------------------------------------------------------------

(1) -> (1) -> (1) -> (1) -> (1) ->
Multivariate Polynomial Division mpolydiv (f,D)== lex := typeOf (f) Q:=[ 0:: lex for j in D ] r:= 0:: lex m:= #D lms :=[ leadingMonomial (D.j) for j in 1..m] j:= 1 flag := false while f ~= 0 repeat if j>m then j:= 1 if flag = false then t:= leadingMonomial f r:= r + t f:= f - t flag := false if normalForm ( leadingMonomial (f),[ lms .j ])=0 then t := ( leadingMonomial f/lms.j):: lex Q.j := Q.j + t f := f - t*D.j flag := true else j:= j+1 rec := Record ( quotient : LIST lex , remainder : lex) return [Q,r]:: rec

Type: Void (2) -> lex:=DMP([x,y,z], FRAC INT)

$$ \mbox{\rm DistributedMultivariatePolynomial([x,y,z],Fraction Integer)} \leqno(2) $$

Type: Domain d1: lex := -2 x^12 + 4 x^2 * y^4

$$ -{2 \ {x \sp {12}}}+{4 \ {x \sp 2} \ {y \sp 4}} \leqno(3) $$

Type: DistributedMultivariatePolynomial([x,y,z],Fraction Integer) d2: lex := x^2 - y^11

$$ {x \sp 2} -{y \sp {11}} \leqno(4) $$

Type: DistributedMultivariatePolynomial([x,y,z],Fraction Integer) f :lex := 3x^14y^10 + 5xy^3 -6*y^7 + 1

$$ {3 \ {x \sp {14}} \ {y \sp {10}}}+{5 \ x \ {y \sp 3}} -{6 \ {y \sp 7}}+1 \leqno(5) $$

Type: DistributedMultivariatePolynomial([x,y,z],Fraction Integer) mpolydiv(f, [d1,d2])

Cannot compile conversion for types involving local variables. In particular, could not compile the expression involving :: lex FriCAS will attempt to step through and interpret the code.


Some or all expressions may not have rendered properly, because Latex returned the following error:
This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
 \write18 enabled.
entering extended mode
(./4324228999094147848-18.0px.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.
(/usr/share/texmf-tetex/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-tetex/tex/latex/base/size12.clo))
(/usr/share/texmf-tetex/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texmf-tetex/tex/latex/amsmath/amstext.sty
(/usr/share/texmf-tetex/tex/latex/amsmath/amsgen.sty))
(/usr/share/texmf-tetex/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texmf-tetex/tex/latex/amsmath/amsopn.sty))
(/usr/share/texmf-tetex/tex/latex/amsfonts/amsfonts.sty)
(/usr/share/texmf-tetex/tex/latex/amsfonts/amssymb.sty)
(/usr/share/texmf-tetex/tex/latex/amscls/amsthm.sty)
(/usr/share/texmf-tetex/tex/generic/xypic/xy.sty
(/usr/share/texmf-tetex/tex/generic/xypic/xy.tex Bootstrap'ing: catcodes,
docmode, (/usr/share/texmf-tetex/tex/generic/xypic/xyrecat.tex)
(/usr/share/texmf-tetex/tex/generic/xypic/xyidioms.tex)

Xy-pic version 3.7 <1999/02/16> Copyright (c) 1991-1998 by Kristoffer H. Rose <krisrose@ens-lyon.fr> Xy-pic is free software: see the User's Guide for details.

Loading kernel: messages; fonts; allocations: state, direction, utility macros; pictures: \xy, positions, objects, decorations; kernel objects: directionals, circles, text; options; algorithms: directions, edges, connections; Xy-pic loaded) (/usr/share/texmf-tetex/tex/generic/xypic/xyall.tex Xy-pic option: All features v.3.3 (/usr/share/texmf-tetex/tex/generic/xypic/xycurve.tex Xy-pic option: Curve and Spline extension v.3.7 curve, circles, loaded) (/usr/share/texmf-tetex/tex/generic/xypic/xyframe.tex Xy-pic option: Frame and Bracket extension v.3.7 loaded) (/usr/share/texmf-tetex/tex/generic/xypic/xycmtip.tex Xy-pic option: Computer Modern tip extension v.3.3 (/usr/share/texmf-tetex/tex/generic/xypic/xytips.tex Xy-pic option: More Tips extension v.3.3 loaded) loaded) (/usr/share/texmf-tetex/tex/generic/xypic/xyline.tex Xy-pic option: Line styles extension v.3.6 loaded) (/usr/share/texmf-tetex/tex/generic/xypic/xyrotate.tex Xy-pic option: Rotate and Scale extension v.3.3 loaded) (/usr/share/texmf-tetex/tex/generic/xypic/xycolor.tex Xy-pic option: Colour extension v.3.3 loaded) (/usr/share/texmf-tetex/tex/generic/xypic/xymatrix.tex Xy-pic option: Matrix feature v.3.4 loaded) (/usr/share/texmf-tetex/tex/generic/xypic/xyarrow.tex Xy-pic option: Arrow and Path feature v.3.5 path, \ar, loaded) (/usr/share/texmf-tetex/tex/generic/xypic/xygraph.tex Xy-pic option: Graph feature v.3.7 loaded) loaded)) (/usr/share/texmf-tetex/tex/latex/graphics/graphicx.sty (/usr/share/texmf-tetex/tex/latex/graphics/keyval.sty) (/usr/share/texmf-tetex/tex/latex/graphics/graphics.sty (/usr/share/texmf-tetex/tex/latex/graphics/trig.sty) (/usr/share/texmf-tetex/tex/latex/graphics/graphics.cfg) (/usr/share/texmf-tetex/tex/latex/graphics/dvips.def))) (/usr/share/texmf-tetex/tex/latex/graphics/color.sty (/usr/share/texmf-tetex/tex/latex/graphics/color.cfg) (/usr/share/texmf-tetex/tex/latex/graphics/dvipsnam.def)) (/usr/share/texmf-tetex/tex/latex/tools/verbatim.sty) (/usr/share/texmf-tetex/tex/latex/graphviz/graphviz.sty (/usr/share/texmf-tetex/tex/latex/psfrag/psfrag.sty)) (/usr/share/texmf-tetex/tex/latex/sage/sagetex.sty Writing sage input file 4324228999094147848-18.0px.sage (./4324228999094147848-18.0px.sout)) (/usr/share/texmf-tetex/tex/latex/gnuplottex/gnuplottex.sty (/usr/share/texmf-tetex/tex/latex/base/latexsym.sty) (/usr/share/texmf-tetex/tex/latex/moreverb/moreverb.sty) (/usr/share/texmf-tetex/tex/latex/base/ifthen.sty)) (./4324228999094147848-18.0px.aux) [1] Text line contains an invalid character. l.97 ^^B .quotient 1 d2 + %.quotient 2 d1 + %.remainder [2] (/usr/share/texmf-tetex/tex/latex/amsfonts/umsa.fd) (/usr/share/texmf-tetex/tex/latex/amsfonts/umsb.fd) (/usr/share/texmf-tetex/tex/latex/base/ulasy.fd) [3] [4] [5] [6] [7] (./4324228999094147848-18.0px.aux) ) (see the transcript file for additional information) Output written on 4324228999094147848-18.0px.dvi (7 pages, 2976 bytes). Transcript written on 4324228999094147848-18.0px.log.