Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: which function can generate the coefficients of a polynomial
PostPosted: Sat Feb 20, 2016 4:44 am 
which function can generate the coefficients of a polynomial?


Report this post
Top
  
Reply with quote  
 Post subject: Re: which function can generate the coefficients of a polynomial
PostPosted: Sun Apr 17, 2016 9:17 pm 

Joined: Sat Apr 16, 2016 7:25 pm
Posts: 8
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: which function can generate the coefficients of a polynomial
PostPosted: Fri Apr 29, 2016 2:50 pm 

Joined: Wed Mar 03, 2010 5:08 pm
Posts: 108
Location: Germany, Münster
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

It is currently Fri May 13, 2022 10:56 am
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group