source: git/Tst/Short/liftstd_s.tst @ 5ebd4bc

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