Read-only forum archive

which function can generate the coefficients of a polynomial

which function can generate the coefficients of a polynomial

coeff · Sat Feb 20, 2016 4:44 am

which function can generate the coefficients of a polynomial?

Re: which function can generate the coefficients of a polynomial

pankajsejwal · Sun Apr 17, 2016 9:17 pm

I am not aware of any existing function but this might help,

proc pcoeffs(poly p)
{
list st;
for(int i=0;i<size(p);i++)
{
st=insert(st,leadcoef(p));
p=p-lead(p);
}
st=insert(st,leadcoef(p[size(p)]));
return(st);
}

Usage:
ring r = 0,x,dp;
> pcoeffs(3x3-2x+4);
[1]:
4
[2]:
-2
[3]:
3

Re: which function can generate the coefficients of a polynomial

gorzel · Fri Apr 29, 2016 2:50 pm

Consult the manual. Singular provides the functions
coef
http://www.singular.uni-kl.de/Manual/la ... htm#SEC309
and
coeffs
http://www.singular.uni-kl.de/Manual/la ... htm#SEC310