source: git/Tst/Buch/Example_7_3_12.tst

spielwiese
Last change on this file was 75f460, checked in by Hans Schoenemann <hannes@…>, 9 years ago
format
  • Property mode set to 100644
File size: 533 bytes
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 flatteningStrat(matrix M)
13{
14   list l;
15   int v,w;
16   ideal F;
17   while(1)
18   {
19      F=interred(fitting(M,w));
20      if(F[1]==1){return(l);}
21      if(size(F)!=0){v++;l[v]=F;}
22      w++;
23   }
24   return(l);
25}
26
27ring R=0,x(0..4),dp;
28matrix M[2][4]=x(0),x(1),x(2),x(3),
29               x(1),x(2),x(3),x(4);
30
31flatteningStrat(M);
32
33tst_status(1);$
Note: See TracBrowser for help on using the repository browser.