Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: select polynomials including given variables from set of pol
PostPosted: Tue Mar 16, 2010 12:27 am 

Joined: Thu Jul 09, 2009 7:28 am
Posts: 24
Since I cannot put all the words in the subject frame, I leave it here:
how to choose polynomials containing given variables from a list of polynomials?

Hi, all,

I have a list of polynomials and then I want to get What I want are polynomials only containing all subsets of the set of given variables (including the whole set itself, but without empty subset).

For example, I have a list: L:=[a+b+c,x+ab+d^3,y+c];
and I am only interested in polynomials which include varaibles "a", "b", "c", which is finally "a+b+c".

Which command can implement this?

thanks

Gepo


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: select polynomials including given variables from set of pol
PostPosted: Wed Mar 17, 2010 11:04 pm 

Joined: Wed Mar 03, 2010 5:08 pm
Posts: 108
Location: Germany, Münster
First, you should use the data type ideal, when working
with a collection of polynomials; it offers more functionality than
the data type list, which must be used when objects of different type should grouped together.

As I understand, you want to define a set of variables, and then
select those polynomials, which depend on all, but only on,
these variables.

Is this what you want to do?

Some ingredients how to do this.

There is a command variables which, applied to a polynomial, returns an ideal of the variables which occur in the polynomial.

To check if this coincides with those you want to consider,
you have to verify equality of ideals. You do this with the command reduce by vice versa checking the inclusion.

Best you define a reference polynmial, which is built on the
variables you want to have. Then call this

Code:
proc dependent(ideal I,poly f)
"
USAGE: dependent(I,f); I ideal, f poly
RETURN: ideal, entries of I which contain the same variables as f
              0 if no such entry exist
"
{
ideal refvars = variables(f);
ideal J;
int i,j;

for (i=1;i<=ncols(I);i++)
{
   if ((reduce(I[i],std(refvars))+0 == 0) and   
       (reduce(refvars,std(I[i]))+0 == 0) )
   {
     j++;
     J[j]=I[i];
   }
}
return(J);
}

Be aware, I don't have tested but just coded it.

Your example then should work as follows:

Code:
> ring r =0,(a,b,c,d,x,y),dp;
> ideal I = a+b+c,x+ab+d^3,y+c;
> dependent(I,abc);
_[1] = a+b+c


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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