source: git/Tst/Old/poly.tst @ e706ff

spielwiese
Last change on this file since e706ff was 37cd955, checked in by Hans Schoenemann <hannes@…>, 14 years ago
pagelength removed git-svn-id: file:///usr/local/Singular/svn/trunk@13172 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.4 KB
Line 
1ring r= 32003,(x,y,z),lp;
2
3proc printid
4{
5  int @usage = size(#) != 2;
6  if (@usage == 0)
7  {
8    @usage = typeof(#[1]) != "ideal";
9    if (@usage)
10    {
11      typeof(#[1]), " not allowed for printid";
12    }
13  }
14  if (@usage) {
15    "usage : printid(ideal,prefix)",newline,
16    "        prints nonzero elements, w/ or w/o pref";
17    return();
18  }
19
20  #[2], size(#[1]);
21  int @i;
22  for (@i=1; @i<=size(#[1]); @i=@i+1)
23  {
24    if (#[2] != "")
25    {
26      #[2] , "(", @i, ") ", #[1][@i];
27    }
28    if (#[2] == "")
29    {
30      #[1][@i];
31    }
32  }
33}
34
35poly px = x;
36px;
37poly p1 = 1x2;
38p1;
39
40poly p2 = 3x2yz5;
41p2;
42
43poly p3 =  3 * 1x2yz5;
44p3;
45
46poly p4 =  (2x2yz5)^2;
47p4;
48
49poly p5 =  (2x2yz5)^2 - 1x;
50p5;
51
52poly p6 =  (2x2yz5)^2 - p3;
53p6;
54
55poly p6 =  x;
56p6;
57kill p6;
58poly p6 =  x;
59p6;
60
611a 2x;
621y 2x;
63y 2x;
641y2x;
65
66"p1", p1;
67"p2", p2;
68"p3", p3;
69"p4", p4;
70matrix m[2][2] = p1,p2,p3,p4;
71m;
72kill m;
73matrix m[2][2] = p1,p2,p3,p4;
74m;
75m[1,2];
76"-------------------------------------";
77ideal id = m, xy3;
78id;
79
80ideal sid = std(id);
81sid;
82
83sid[3]+0 == 0;
84sid;
85".....................";
86sid[2] == 1x4y2z10;
87sid[2] == x2;
88sid;
89sid[2] = x2z;
90sid;
91"-------------------";
92printid("?");
93printid(sid,"; ");
94sid;
95printid(sid,"");
96sid;
97printid(m,"");
98listvar(all);
99// lamm@mathematik.uni-kl.de (0.9.2e):
100poly null;
101ord(null);
102"-------------------";
103ring R = 0,x,dp;
104poly f = (x+3)*(x+2);
105poly q = (x+2)^2;
106poly h = 20x + 40;
107(f*q)/h;
108LIB "tst.lib";tst_status(1);$;
Note: See TracBrowser for help on using the repository browser.