Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac 11652: Review patch for the docstring of degree() for multivaria…
Browse files Browse the repository at this point in the history
…te polynomials
  • Loading branch information
saraedum committed Feb 26, 2014
1 parent 7e35305 commit 54604e4
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
Expand Up @@ -2472,13 +2472,13 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
INPUT:
- ``x`` - multivariate polynomial (a generator of the parent of
self) If x is not specified (or is ``None``), return the total
degree, which is the maximum degree of any monomial.
Note that a matrix term ordering alters the grading
of the generators of the ring; see the tests below.
To avoid this behavior, use either ``exponents()``
for the exponents themselves, or the optional argument ``std_grading=False``.
- ``x`` - (default: ``None``) a multivariate polynomial which is (or
coerces to) a generator of the parent of self. If ``x`` is ``None``,
return the total degree, which is the maximum degree of any monomial.
Note that a matrix term ordering alters the grading of the generators
of the ring; see the tests below. To avoid this behavior, use either
``exponents()`` for the exponents themselves, or the optional
argument ``std_grading=False``.
OUTPUT:
integer
Expand All @@ -2504,11 +2504,11 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
sage: P(1).degree(x)
0
With a matrix term ordering, the grading of the generators
is determined by the first row of the matrix.
This affects the behavior of `degree()` when no variable is specified.
To evaluate the degree with a standard grading,
use the optional argument ``std_grading=True``.
With a matrix term ordering, the grading of the generators is
determined by the first row of the matrix. This affects the behavior
of ``degree()`` when no variable is specified.
To evaluate the degree with a standard grading, use the optional
argument ``std_grading=True``.
sage: tord = TermOrder(matrix([3,0,1,1,1,0,1,0,0]))
sage: R.<x,y,z> = PolynomialRing(QQ,'x',3,order=tord)
Expand All @@ -2527,9 +2527,9 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
sage: poly
q^2 + p
There is no canonical coercion from R to the parent of poly,
so this doesn't work::
There is no canonical coercion from ``R`` to the parent of ``poly``, so
this doesn't work::
sage: poly.degree(q)
Traceback (most recent call last):
...
Expand All @@ -2538,7 +2538,7 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
Using a non-canonical coercion does work, but we require this
to be done explicitly, since it can lead to confusing results
if done automatically::
sage: poly.degree(poly.parent()(q))
2
sage: poly.degree(poly.parent()(p))
Expand All @@ -2548,7 +2548,7 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
1
The argument to degree has to be a generator::
sage: pp = poly.parent().gen(0)
sage: poly.degree(pp)
1
Expand All @@ -2558,7 +2558,7 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
TypeError: argument must be a generator
Canonical coercions are used::
sage: S = ZZ['p,q']
sage: poly.degree(S.0)
1
Expand Down

0 comments on commit 54604e4

Please sign in to comment.