Comment #15 on issue 4096 by [email protected]: Poly.coeff works only after .simply().expand()
http://code.google.com/p/sympy/issues/detail?id=4096

Either as a flag to coeff, or maybe a new function (or method) coefficient.

Probably a better way to actually implement it would be to do it recursively. For example, coefficient(a + b, x, n) would be coefficient(a, x, n) + coefficient(b, x, n), coefficient(a**m, x, n) would be coefficient(a, x, n/m), and so on (the hardest one would be Mul). You could even dispatch it (i.e., implement Add._eval_coefficient and Pow._eval_coefficient, and so on).

Actually, I wouldn't be surprised if this basic functionality already exists in some form, so the first thing to do would probably be to check that first. I suspect you could somehow achieve the same thing roughly as efficiently using the series code somehow.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to