Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: First n terms of polynomial
PostPosted: Sun Jan 23, 2011 9:35 pm 

Joined: Tue Jan 13, 2009 4:25 am
Posts: 3
If I have a polynomial, f, with many terms, is there a function that returns another polynomial that is the first n terms f with respect to the term order. For example, say f has 25 terms, I'd like to define a new polynomial that is the first 10 terms of f with respect to a term order.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: First n terms of polynomial
PostPosted: Mon Jan 24, 2011 12:19 pm 

Joined: Sun Feb 28, 2010 10:32 am
Posts: 7
Assume you have defined your polynomial p in SINGULAR. Then you can define an intvec v of the positions of the terms in p (w.r.t. the ordering) you want to be returned, say
Code:
intvec v = 1,2,3,8,12;

Then you can use
Code:
p[v]

to get the sum of the terms 1,2,3,8 and 12 of p.
See also http://www.singular.uni-kl.de/Manual/la ... htm#SEC186.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: First n terms of polynomial
PostPosted: Mon Jan 24, 2011 10:11 pm 

Joined: Tue Jan 13, 2009 4:25 am
Posts: 3
Thank you ederc, that is exactly what I needed.


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 11:06 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group