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

Edit detail for SandBoxMultivariatePolynomialDivision revision 2 of 3

1 2 3
Editor: Bill Page
Time: 2008/07/22 06:23:26 GMT-7
Note: new

changed:
-      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
    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

changed:
-.quotient 1 * d2 + %.quotient 2 * d1 + %.remainder
%.quotient 1 * d2 + %.quotient 2 * d1 + %.remainder

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

contains the following routine:

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
Type: Void

Here is an example of it's use:

axiom
lex:=DMP([x,y,z], FRAC INT)
LatexWiki Image(1)
Type: Domain
axiom
d1: lex := -2* x^12 + 4* x^2 * y^4
LatexWiki Image(2)
Type: DistributedMultivariatePolynomial?([x,y,z]?,Fraction Integer)
axiom
d2: lex := x^2 - y^11
LatexWiki Image(3)
Type: DistributedMultivariatePolynomial?([x,y,z]?,Fraction Integer)
axiom
f :lex := 3*x^14*y^10 + 5*x*y^3 -6*y^7 + 1
LatexWiki Image(4)
Type: DistributedMultivariatePolynomial?([x,y,z]?,Fraction Integer)
axiom
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.
LatexWiki Image(5)
Type: Record(quotient: List DistributedMultivariatePolynomial?([x,y,z]?,Fraction Integer),remainder: DistributedMultivariatePolynomial?([x,y,z]?,Fraction Integer))
axiom
mpolydiv(f, [d2,d1])
LatexWiki Image(6)
Type: Record(quotient: List DistributedMultivariatePolynomial?([x,y,z]?,Fraction Integer),remainder: DistributedMultivariatePolynomial?([x,y,z]?,Fraction Integer))
axiom
%.quotient 1 * d2 + %.quotient 2 * d1 + %.remainder
LatexWiki Image(7)
Type: DistributedMultivariatePolynomial?([x,y,z]?,Fraction Integer)