source: git/Tst/Buch/Example_7_3_14.tst @ 19609c

spielwiese
Last change on this file since 19609c 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: 1.1 KB
Line 
1LIB "tst.lib";
2tst_init();
3
4proc fitting(matrix M, int n)
5{
6  n=nrows(M)-n;
7  if(n<=0){return(ideal(1));}
8  if((n>nrows(M))||(n>ncols(M))){return(ideal(0));}
9  return(std(minor(M,n))); 
10}
11
12proc isFlat(matrix M)
13{
14   if(size(ideal(M))==0){return(1);}
15   int w;
16   ideal F=fitting(M,0);
17   while(size(F)==0)
18   {
19      w++;
20      F=fitting(M,w);
21   }
22   if(deg(std(F)[1])==0){return(1);}
23   return(0);
24}
25
26ring A=0,(x,y),dp;
27matrix M[3][3]=x-1,y,x,x,x+1,y,x2,xy+x+1,x2+y;
28print(M);
29qring B=std(x2+x-y);   
30matrix M=fetch(A,M);
31isFlat(M);
32setring A;
33qring C=std(x2+x+y);     
34matrix M=fetch(A,M);
35isFlat(M);
36
37proc flatLocus(matrix M)
38{
39   if(size(ideal(M))==0){return(ideal(1));}
40   int v,w;
41   ideal F=fitting(M,0);
42   while(size(F)==0)
43   {
44      w++;
45      F=fitting(M,w);
46   }
47   if(typeof(basering)=="qring")
48   {
49      for(v=w+1;v<=nrows(M);v++)
50      {
51         F=F+intersect(fitting(M,v),quotient(ideal(0),
52         fitting(M,v-1)));
53      }
54   }
55   return(interred(F));
56}
57
58ring R=0,(x,y,z),dp;
59qring S=std(xyz);
60matrix M[3][3]=x,y,z,0,0,0,xyz,x3,z3;
61
62flatLocus(M);
63
64tst_status(1);$
Note: See TracBrowser for help on using the repository browser.