source: git/Tst/Buch/Example_5_2_4.tst @ 107aac

spielwiese
Last change on this file since 107aac was 891438c, checked in by Gerhard Pfister <pfister@…>, 23 years ago
*GP: initial release git-svn-id: file:///usr/local/Singular/svn/trunk@5579 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 750 bytes
Line 
1LIB "tst.lib";
2tst_init();
3
4proc MonomialHilbertPoincare(ideal I)
5{
6  I    = interred(I); //computes a minimal set of generators
7  int s= size(I);     //of the monomial ideal I
8 
9  if(I[1]     ==0){return(1);}            //I=<0>
10  if(I[1]     ==1){return(0);}            //I=<1>
11  if(deg(I[s])==1){return((1-var(1))^s);} //I is generated by
12                                          //s of the {var(j)}
13  int j=2;                                           
14  while(leadexp(I[s])[j]==0){j++;}        //I[s]=var(j)*m
15  return(MonomialHilbertPoincare(I+var(j))
16        +var(1)*MonomialHilbertPoincare(quotient(I,var(j))));
17}
18
19ring A=0,(t,x,y,z),dp;
20ideal I=x5y2,x3,y3,xy4,xy7;
21
22MonomialHilbertPoincare(I);
23
24intvec v=hilb(std(I),1);
25v;
26
27tst_status(1);$
Note: See TracBrowser for help on using the repository browser.