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

# Edit detail for SandBoxMultivariatePolynomialDivision revision 3 of 3

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

changed:
-A tutorial written by Angelos Mantzaflaris (currently on in Greek)
-
A tutorial written by Angelos Mantzaflaris (webpage:
http://users.uoa.gr/~amantzaf/proje.html )

(currently only in Greek)


A tutorial written by Angelos Mantzaflaris (webpage: http://users.uoa.gr/~amantzaf/proje.html )

(currently only in Greek)

contains the following routine:

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

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