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

Commit

Permalink
17399: roll back previous commit to allow merge of 17428
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Dec 4, 2014
1 parent 32ae67c commit 99820cf
Showing 1 changed file with 8 additions and 28 deletions.
36 changes: 8 additions & 28 deletions src/sage/symbolic/expression.pyx
Expand Up @@ -5156,37 +5156,17 @@ cdef class Expression(CommutativeRingElement):
sage: p = (17/3*a)*x^(3/2) + x*y + 1/x + x^x
sage: p.coefficients(x)
[[1, -1], [x^x, 0], [y, 1], [17/3*a, 3/2]]
Series coefficients are now handled correctly (:trac:`17399`)::
sage: s=(1/(1-x)).series(x,6)
sage: s.coeffs()
[[1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [1, 5]]
sage: x,y = var("x,y")
sage: s=(1/(1-y-x)).series(x,6)
sage: s.coeffs(y)
[]
sage: s.coeffs()
[[-1/(y - 1), 0],
[(y - 1)^(-2), 1],
[-1/(y - 1)^3, 2],
[(y - 1)^(-4), 3],
[-1/(y - 1)^5, 4],
[(y - 1)^(-6), 5]]
"""
f = self._maxima_()
maxima = f.parent()
maxima._eval_line('load(coeflist)')
if x is None:
x = self.default_variable()
# x = self.parent().var(str(x))
if is_a_series(self._gobj):
return [[self.coeff(x, d), d] for d in xrange(self.degree(x))]
else:
f = self._maxima_()
maxima = f.parent()
maxima._eval_line('load(coeflist)')
G = f.coeffs(x)
from sage.calculus.calculus import symbolic_expression_from_maxima_string
S = symbolic_expression_from_maxima_string(repr(G))
return S[1:]
x = self.parent().var(repr(x))
G = f.coeffs(x)
from sage.calculus.calculus import symbolic_expression_from_maxima_string
S = symbolic_expression_from_maxima_string(repr(G))
return S[1:]

coeffs = coefficients

Expand Down

0 comments on commit 99820cf

Please sign in to comment.