source: git/Tst/Short/primdec3.tst @ a866f1

spielwiese
Last change on this file since a866f1 was 8d7d31, checked in by Hans Schönemann <hannes@…>, 15 years ago
*hannes: interred/redSB/elim git-svn-id: file:///usr/local/Singular/svn/trunk@11199 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.8 KB
Line 
1LIB "tst.lib";
2tst_init();
3
4LIB"primdec.lib";
5proc sortMinAss(list l)
6{
7   int i,j,notReady;
8   ideal K;
9   intvec save=option(get);option(redSB);
10   for(i=1;i<=size(l);i++){"start interrred";l[i]=interred(l[i]);"end interred";}
11 
12   
13   notReady=1;
14   while(notReady)
15   {
16      notReady=0;
17      i=0;
18      while(i<size(l)-1)
19      {
20         i++;
21         j=i;
22         while(j<size(l))
23         {
24            j++;
25            if(compareI(l[i],l[j]))
26            {
27               notReady=1;
28               K=l[i];
29               l[i]=l[j];
30               l[j]=K;
31               i--;
32               break;
33            }
34         }
35      }
36   }
37   option(set,save);
38   return(l);
39}
40proc sortGTZ(list l)
41{
42   int i,j,notReady;
43   list K;
44   intvec save_opt=option(get);
45   option(redSB,redTail);
46   for(i=1;i<=size(l);i++){"start";l[i][1]=std(l[i][1]);l[i][2]=std(l[i][2]);"end";}
47   option(set,save_opt);
48   notReady=1;
49   while(notReady)
50   {
51      notReady=0;
52      i=0;
53      while(i<size(l)-1)
54      {
55         i++;
56         j=i;
57         while(j<size(l))
58         {
59            j++;
60            if(compareI(l[i][2],l[j][2]))
61            {
62               notReady=1;
63               K=l[i];
64               l[i]=l[j];
65               l[j]=K;
66               i--;
67               break;
68            }
69         }
70      }
71   }
72   return(l); 
73}
74proc compareI(ideal I, ideal J)
75{
76   return(string(I)>string(J));
77}
78
79
80printlevel =0;
81
82// 1. Beispiel
83example zerodec;
84
85//2. Beispiel  (2sec)
86ring r1= 0,(a,b,c),dp;
87poly f1= a^2*b*c + a*b^2*c + a*b*c^2 + a*b*c + a*b + a*c + b*c;
88poly f2= a^2*b^2*c + a*b^2*c^2 + a^2*b*c + a*b*c + b*c + a + c;
89poly f3= a^2*b^2*c^2 + a^2*b^2*c + a*b^2*c + a*b*c + a*c + c + 1;
90ideal gls=f1,f2,f3;
91sortMinAss(zerodec(gls));
92sortGTZ(primdecGTZ(gls));
93
94//3. Beispiel  (5sec)
95ring rs=0,(x1,x2,x3,x4),dp;
96poly f1=16*x1^2 + 3*x2^2 + 5*x3^4 - 1 - 4*x4 + x4^3;
97poly f2=5*x1^3 + 3*x2^2 + 4*x3^2*x4 + 2*x1*x4 - 1 + x4 + 4*x1 + x2 + x3 + x4;
98poly f3=-4*x1^2 + x2^2 + x3^2 - 3 + x4^2 + 4*x1 + x2 + x3 + x4;
99poly f4=-4*x1 + x2 + x3 + x4;
100ideal gls=f1,f2,f3,f4;
101sortMinAss(zerodec(gls));
102sortGTZ(primdecGTZ(gls));
103
104//4. Beispiel  (23sec)
105ring r2= 0,(y,z,x,t),dp;
106ideal gls=y^2*z+2*y*x*t-z-2*x,
1074*y^2*z*x-z*x^3+2*y^3*t+4*y*x^2*t-10*y^2+4*z*x+4*x^2-10*y*t+2,
1082*y*z*t+x*t^2-2*z-x,
109-z^3*x+4*y*z^2*t+4*z*x*t^2+2*y*t^3+4*z^2+4*z*x-10*y*t-10*t^2+2;
110sortMinAss(zerodec(gls));
111sortGTZ(primdecGTZ(gls));
112
113//5. cyclic5  vdim=70,
114//zerodec-time:49  (matrix:0 charpoly:25 factor:23)
115//primdecGTZ-time: 28
116ring rs= 0,(a,b,c,d,e),dp;
117poly f0= a + b + c + d + e + 1;
118poly f1= a + b + c + d + e;
119poly f2= a*b + b*c + c*d + a*e + d*e;
120poly f3= a*b*c + b*c*d + a*b*e + a*d*e + c*d*e;
121poly f4= a*b*c*d + a*b*c*e + a*b*d*e + a*c*d*e + b*c*d*e;
122poly f5= a*b*c*d*e - 1;
123ideal gls= f1,f2,f3,f4,f5;
124sortMinAss(zerodec(gls));
125sortGTZ(primdecGTZ(gls));
126
127tst_status(1);$
Note: See TracBrowser for help on using the repository browser.