source: git/Tst/Old/poly.tst @ 267fe2d

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