[sage-support] Re: Modifying degree of monomial from multivariate polynomial

2009-05-28 Thread Martin Albrecht
On Thursday 28 May 2009, Ryan Hinton wrote: > Martin, > > Thanks for the reply. Did I mention I'm using 3.4.2? When I try > using mon // x instead of mon / x, I get an exception: > > --- > AttributeError

[sage-support] Re: Modifying degree of monomial from multivariate polynomial

2009-05-28 Thread javier
On May 28, 4:19 pm, Ryan Hinton wrote: > > > I also tried working directly > with the degree tuples instead of the monomials, but tuples aren't > mutable, subtraction isn't defined for them, and (x1**(-1)) gives a > FractionFieldElement again. > > Any suggestions? How about copying the degree t

[sage-support] Re: Modifying degree of monomial from multivariate polynomial

2009-05-28 Thread Ryan Hinton
Martin, Thanks for the reply. Did I mention I'm using 3.4.2? When I try using mon // x instead of mon / x, I get an exception: --- AttributeErrorTraceback (most recent call last) /home/ryan/.sa

[sage-support] Re: Modifying degree of monomial from multivariate polynomial

2009-05-28 Thread Martin Albrecht
> # loop over > diff_mu = {} > curr_mons = mu.monomials() > while len(curr_mons) > 0: > mon = curr_mons.pop() > deg = mon.degrees() > diff_mu[deg] = True > for x in xgens: > if mon.degree(x) > 0: > curr_mons.append(mon / x) > # this gives a FractionF