Skip to content

Commit dab0ab0

Browse files
committed
define monomial_reduction
1 parent 98f8ee3 commit dab0ab0

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/sage/rings/polynomial/laurent_polynomial.pyx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,25 @@ cdef class LaurentPolynomial_univariate(LaurentPolynomial):
15711571
"""
15721572
return (self.__u, self.__n)
15731573

1574-
monomial_reduction = polynomial_construction
1574+
def monomial_reduction(self):
1575+
"""
1576+
Return the decomposition as a polynomial and a power of the variable.
1577+
Constructed for compatibility with the multivariate case.
1578+
1579+
OUTPUT:
1580+
1581+
A tuple ``(u, t^n)`` where ``u`` is the underlying polynomial and ``n``
1582+
is the power of the exponent shift.
1583+
1584+
EXAMPLES::
1585+
1586+
sage: R.<x> = LaurentPolynomialRing(QQ)
1587+
sage: f = 1/x + x^2 + 3*x^4
1588+
sage: f.monomial_reduction()
1589+
(3*x^5 + x^3 + 1, x^-1)
1590+
"""
1591+
u, n = self.polynomial_construction()
1592+
return (u, self.parent().gen(0) ** n)
15751593

15761594
def is_constant(self):
15771595
"""

0 commit comments

Comments
 (0)