source: git/Tst/Short/liftstd_s.tst @ 699dcd

spielwiese
Last change on this file since 699dcd was 6e1e866, checked in by Hans Schönemann <hannes@…>, 25 years ago
* hannes: ~ does not work in test scipt (at the moment... at least) git-svn-id: file:///usr/local/Singular/svn/trunk@3432 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.4 KB
Line 
1LIB "tst.lib";
2tst_init();
3//
4// test script for liftstd command
5//
6pagelength = 10000;
7ring r1 = 32003,(x,y,z),(c,ls);
8r1;
9
10proc pmat (matrix m,list #)
11{
12  if ( size(#) == 0)
13  {
14//------------- main case: input is a matrix, no second argument---------------
15    int @elems;
16    int @mlen;
17    int @slen;
18    int @c;
19    int @r;
20//-------------- count maximal size of each column, and sum up ----------------
21
22    for ( @c=1; @c<=ncols(m); @c=@c+1)
23    {  int @len(@c);
24      for (@r=1; @r<=nrows(m); @r=@r+1)
25      {
26        @elems = @elems + 1;
27        string @s(@elems) = string(m[@r,@c])+",";
28        @slen = size(@s(@elems));
29        if (@slen > @len(@c))
30        {
31          @len(@c) = @slen;
32        }
33      }
34      @mlen = @mlen + @len(@c);
35    }
36//---------------------- print all - except last - rows -----------------------
37
38    string @aus;
39    string @sep = " ";
40    if (@mlen >= pagewidth)
41    {
42      @sep = newline;
43    }
44
45    for (@r=1; @r<nrows(m); @r=@r+1)
46    {
47      @elems = @r;
48      @aus = "";
49      for (@c=1; @c<=ncols(m); @c=@c+1)
50      {
51        @aus = @aus + @s(@elems)[1,@len(@c)] + @sep;
52        @elems = @elems + nrows(m);
53      }
54      @aus;
55    }
56//--------------- print last row (no comma after last entry) ------------------
57
58    @aus = "";
59    @elems = nrows(m);
60    for (@c=1; @c<ncols(m); @c=@c+1)
61    {
62      @aus = @aus + @s(@elems)[1,@len(@c)] + @sep;
63      @elems = @elems + nrows(m);
64    }
65    @aus = @aus + string(m[nrows(m),ncols(m)]);
66    @aus;
67    return();
68  }
69//--------- second case: input is a matrix, second argument is given ----------
70
71  if ( size(#) == 1 )
72  {
73    if ( typeof(#[1]) == "int" )
74    {
75      string @aus;
76      string @tmp;
77      int @ll;
78      int @c;
79      int @r;
80      for ( @r=1; @r<=nrows(m); @r=@r+1)
81      {
82        @aus = "";
83        for (@c=1; @c<=ncols(m); @c=@c+1)
84        {
85          @tmp = string(m[@r,@c]);
86          @aus = @aus + @tmp[1,#[1]] + " ";
87        }
88        @aus;
89      }
90    }
91  }
92}
93
94"-------------------------------";
95ideal i1=maxideal(3);
96ideal i2=x6,y4,z5,xy,yz,xz;
97i2;
98matrix m1[3][3]=x,y,z,xz,yx,12zx,0,y2,3xy2;
99pmat(m1);
100liftstd(i2,m1);
101"---------------------------------";
102vector v1=[x4,y2,xz2];
103vector v2=[y3,x8,2z4];
104module m=v1,v2;
105m;
106pmat(m1);
107liftstd(m,m1);
108"--------------------------------";
109listvar(all);
110kill r1;
111ring R;
112poly f=x3+y7+z2+xyz;
113ideal i=jacob(f);
114matrix T;
115ideal sm=liftstd(i,T);
116matrix(sm)-matrix(i)*T;
117kill R;
118tst_status(1);$;
Note: See TracBrowser for help on using the repository browser.