On Friday 18 January 2008, Joel B. Mohler wrote:
> Hi,
>
> The following snippet is from 2.9.3.   What does the 'order' parameter do? 
> I thought it affected the order in which monomials appear in the string
> representation.  I wanted x^2+1 to print as '1+x^2' (i.e. small degree
> appears first).
>
> sage: R.<x,y>=PolynomialRing(QQ,order="degrevlex")
> sage: R.term_order()
> Degree reverse lexicographic term order
> sage: x+y
> x + y
> sage: x^2+1
> x^2 + 1
> sage: R.<x,y>=PolynomialRing(QQ,order="deglex")
> sage: R.term_order()
> Degree lexicographic term order
> sage: x+y
> x + y
> sage: x^2+1
> x^2 + 1
>
> Is this correct operation?

Yes, because both degrevlex and deglex are global orderings (x > 1) and 
multivariate polynomials always print largest to smallest. Try neglex

sage: R.<x,y>=PolynomialRing(QQ,order="neglex")
sage: x + 1
1 + x

More details can be found in the reference manual (since docday I rediscovered 
that there is such a thing)

http://www.sagemath.org/doc/html/ref/module-sage.rings.polynomial.term-order.html

Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to