Getting the coefficients of a polynomial



Wilhelm Haager <wilhelm.haager at htlstp.ac.at> writes:

> Probably a stupid remark; but doesn't meet the following
> function all requirements? (same name as the corresponding function
> in Mathematica)
>
> coefficient_list(p,s) :=
> block(
>  [n:floor(hipow(p,s))],
>  p:expand(p),
>  map(lambda([u],coeff(p,s,u)),makelist(i,i,0,n))
> )$

Yes, but Stavros's original point is that this is rather inefficient if
p is already in CRE form. That form stores the expression as basically a
list of powers of s along with their corresponding coefficients. As it
stands, the implementation of hipow starts by throwing away all that
information (as does expand, for that matter)

Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20130419/76ee5edc/attachment-0001.pgp>;