source: git/Tst/Long/mpsr_l.tst @ e38016b

fieker-DuValspielwiese
Last change on this file since e38016b was e48ffd7, checked in by Olaf Bachmann <obachman@…>, 26 years ago
* finvar_l: commit changes which are _not_ verified by Agnes * mpsr_l: Use close instead of kill git-svn-id: file:///usr/local/Singular/svn/trunk@2601 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 7.6 KB
Line 
1LIB "tst.lib";
2tst_init();
3LIB "general.lib";
4
5option(noredefine);
6
7proc vcheckdump(link l, string vn)
8{
9  if (typeof(`vn`) != "proc" && typeof(`vn`) != "link")
10  {
11    write(l, `vn`);
12    read(l);
13    if (typeof(`vn`) == "ring")
14    {
15       setring `vn`;
16       rcheckdump(l, names(`vn`));
17    }
18  }
19}
20 
21proc rcheckdump(link l, list nameslist)
22{
23  int i;
24  for (i=1; i<size(nameslist); i++)
25  {
26    vcheckdump(l, nameslist[i]);
27  }
28}
29
30proc checkdump(link l)
31{
32  rcheckdump(l, names());
33}
34
35// data
36int i;
37int i1 = 1;
38int i2 = -100092;
39
40intvec iv;
41intvec iv1 = 1,2,3;
42intvec iv2 = -1,2,-3,4,-5;
43
44intmat im;
45intmat im1[2][3]=1,3,5,7,8;
46intmat im2[3][3]= -1,2,-3,4,-5;
47
48string s;
49string s1 = "Hello World";
50
51list l;
52list l1 = i,iv,im,i1,iv1,im1;
53list l2 = l1, iv2, l, im2;
54
55ring r;
56
57poly p;
58number n;
59number n1 = 2;
60number n2 = -7;
61
62poly p1 = x + y;
63poly p2 = xyz - 2x3y4z5 + 3xy -4yz + 5z;
64poly p3 = p2^4;
65
66vector v;
67vector v1 = [p1, p2];
68vector v2 = [p, p1,p2, p3] + p1*gen(5);
69
70ideal id;
71ideal id1 = p, p1, p2, p3;
72ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
73
74module mv;
75module mv1 = v, v1, v2;
76module mv2 = v1+v2, p1*v2, p2*v1, v, v1, v2;
77
78matrix m;
79matrix m1[2][3] = p, p1, p2, id1;
80matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
81
82
83ideal j = std(id1);
84
85// the following does not work properly -- run it with Singularg and
86// you'll see what I mean -- debug it eventually !!!
87// qring q = j;
88poly p11 = x + y;
89poly p12 = xyz - 2x3y4z5 + 3xy -4yz + 5z;
90poly p13 = p12^4;
91
92ring rtm = 32003, (x,y,z,t), dp;
93ideal ex = t3y7z4 + 9x8 + 5t2x4y2 + 2t2xy2z3,
942t2x5y4+7txy6+9y8 + 2t2x2yz3,  3t4x2y3z2 + 9z8, 3x2y9 +
95y9 + 5x4;
96
97ring rt0 = 0, (x,y,z,t), dp;
98ideal ex = t3y7z4 + 9x8 + 5t2x4y2 + 2t2xy2z3,
992t2x5y4+7txy6+9y8 + 2t2x2yz3,  3t4x2y3z2 + 9z8, 3x2y9 +
100y9 + 5x4;
101
102
103ring rr = 32003,(a,b),dp;
104map f = r, a,b,a+b;
105map g   = rr,a2,b2;
106map phi = g(f);
107
108
109ring r0 = 0, x, lp;
110number n;
111number n1 = 29734481274863241234589;
112number n2 = n1/(n1-6);
113
114poly p;
115poly p1 = n1*x + n2*x^4 + 7/3*x^2*x^5 - 6;
116poly p2 = x*x*x - 2*x^3*x^4*x^5 + 3*x*x -4*x*x + 5*x^2 + p1;
117poly p3 = p2*p2;
118
119vector v;
120vector v1 = [p1, p2];
121vector v2 = [p, p1,p2, p3] + p1*gen(5);
122
123ideal id;
124ideal id1 = p, p1, p2, p3;
125ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
126
127module mv;
128module mv1 = v, v1, v2;
129module mv2 = v1+v2, p1*v2, p2*v1, v, v1, v2;
130
131matrix m;
132matrix m1[2][3] = p, p1, p2, id1;
133matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
134
135
136ring r1 = 0, x(1..10), ls;
137
138number n;
139number n1 = 29734481274863241234589;
140number n2 = n1/(n1-6);
141
142poly p;
143poly p1 = n1*x(1) + n2*x(5)^4 + 7/3*x(3)^2*x(4)^5 - 6;
144poly p2 = x(2)*x(5)*x(6) - 2*x(7)^3*x(8)^4*x(9)^5 + 3*x(1)*x(5) -4*x(5)*x(9) +
1455*x(9)^2 + p1;
146poly p3 = p2*p2;
147
148vector v;
149vector v1 = [p1, p2];
150vector v2 = [p, p1,p2, p3] + p1*gen(5);
151
152ideal id;
153ideal id1 = p, p1, p2, p3;
154ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
155
156module mv;
157module mv1 = v, v1, v2;
158module mv2 = v1+v2, p1*v1, v1-v2, v, v1, v2;
159
160matrix m;
161matrix m1[2][3] = p, p1, p2, id1;
162matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
163
164ring r2=10,(x(1..6)),(lp(2),dp(4));
165number n;
166number n1 = 29734481274863241234589;
167number n2 = n1/(n1-6);
168
169poly p;
170poly p1 = n1*x(1) + n2*x(5)^4 + 7/3*x(3)^2*x(4)^5 - 6;
171poly p2 = x(2)*x(5)*x(6) - 2*x(1)^3*x(2)^4*x(3)^5 + 3*x(1)*x(5) -4*x(5)*x(3) +
1725*x(3)^2 + p1;
173poly p3 = p2*p2;
174
175vector v;
176vector v1 = [p1, p2];
177vector v2 = [p, p1,p2, p3] + p1*gen(5);
178
179ideal id;
180ideal id1 = p, p1, p2, p3;
181ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
182
183module mv;
184module mv1 = v, v1, v2;
185module mv2 = v1+v2, p1*v2, v1-v2, v, v1, v2;
186
187matrix m;
188matrix m1[2][3] = p, p1, p2, id1;
189matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
190
191ring r3=(7,a, b, c),(x,y,z),dp;
192number n;
193number n1 = 2*a^2*b*c -3*b*c + -1*a + 4;
194number n2 = n1 / (n1 - 5c)^2;
195
196poly p;
197poly p1 = x + y + a;
198poly p2 = 3*a^2*xyz*n1 - 2*n2*x3y4z5 + 3xy -4yz + n1*z;
199poly p3 = p2*p1;
200
201vector v;
202vector v1 = [p1, p2];
203vector v2 = [p, p1,p2, p3] + p1*gen(5);
204
205ideal id;
206ideal id1 = p, p1, p2, p3;
207ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
208
209module mv;
210module mv1 = v, v1, v2;
211module mv2 = v1+v2, p1*v2, v1-v2, v, v1, v2;
212
213matrix m;
214matrix m1[2][3] = p, p1, p2, id1;
215matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
216
217ring r4=(7,a),(x,y,z),dp;
218minpoly=a^2+a+3;
219poly p;
220number n;
221number n1 = 2*a^2 + 3;
222number n2 = n1 / (n1 -5)^3;
223
224poly p1 = x + y + a;
225poly p2 = 3*a^2*xyz*n1 - 2*n2*x3y4z5 + 3xy -4yz + n1*z;
226poly p3 = p2^4;
227
228vector v;
229vector v1 = [p1, p2];
230vector v2 = [p, p1,p2, p3] + p1*gen(5);
231
232ideal id;
233ideal id1 = p, p1, p2, p3;
234ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
235
236module mv;
237module mv1 = v, v1, v2;
238module mv2 = v1+v2, p1*v2, v1-v2, v, v1, v2;
239
240matrix m;
241matrix m1[2][3] = p, p1, p2, id1;
242matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
243
244ring r5=(49,a),(x,y,z),dp;
245poly p;
246number n;
247number n1 = 2*a^2 + 3;
248number n2 = n1 / (n1 -5)^3;
249
250poly p1 = x + y + a;
251poly p2 = 3*a^2*xyz*n1 - 2*n2*x3y4z5 + 3xy -4yz + n1*z;
252poly p3 = p2^4;
253
254vector v;
255vector v1 = [p1, p2];
256vector v2 = [p, p1,p2, p3] + p1*gen(5);
257
258ideal id;
259ideal id1 = p, p1, p2, p3;
260ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
261
262module mv;
263module mv1 = v, v1, v2;
264module mv2 = v1+v2, p1*v2, v1-v2, v, v1, v2;
265
266matrix m;
267matrix m1[2][3] = p, p1, p2, id1;
268matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
269
270ring r6 = 32003, (x,y,z), wp(1,2,3);
271poly p = (xyz - 2x3y4z5 + 3xy -4yz + 5z + 2)^2;
272
273ring r7 = 32003, (x,y,z), Ws(1,2,3);
274poly p = (xyz - 2x3y4z5 + 3xy -4yz + 5z + 2)^2;
275
276ring r8 = 32003, (a,b,c,x,y,z), (dp(3), wp(1,2,3));
277poly p = (xyzabc - 2x3y4z5a2b4c3 + 3xya2 -4yzb3c2 + 5zc + 2)^2;
278
279ring r9 = 32003, (a,b,c,x,y,z), (a(1,2,3,4,5),Dp(3), ds(3));
280poly p = (xyzabc - 2x3y4z5a2b4c3 + 3xya2 -4yzb3c2 + 5zc + 2)^2;
281
282ring r10 = 32003, (x,y,z), M(1, 0, 0, 0, 1, 0, 0, 0, 1);
283poly p = (xyz - 2x3y4z5 + 3xy -4yz + 5z + 2)^2;
284
285ring r11 = 0, x(1..10), (lp(2), M(1, 2, 3, 1, 1, 1, 1, 0, 0), ds(2), ws(1,2,3));
286poly p1 = x(1) + 123399456085/(123399456085 + 1)*x(5)^4 + 7/3*x(3)^2*x(4)^5 - 6;
287poly p2 = x(2)*x(5)*x(6) - 2*x(7)^3*x(8)^4*x(9)^5 + 3*x(1)*x(5) -4*x(5)*x(9) +
2885*x(9)^2 + p1;
289
290ring r12 = 0, (x,y,z), (C,lp);
291vector v1 = [x+y2,z3+xy];
292vector v2 = [x,x,x];
293
294ring r13 = 0, (x,y,z), (lp,c);
295vector v1 = [x+y2,z3+xy];
296vector v2 = [x,x,x];
297
298ring r14 = 0, (x,y,z), (c,lp);
299vector v1 = [x+y2,z3+xy];
300vector v2 = [x,x,x];
301
302// First, make ASCII-dump of everything
303dump(":w _dump.txt");
304killall();
305getdump("_dump.txt");
306
307// Does our version have MP?
308if (! (system("with", "MP")))
309{
310  // no -- so simply dump everything to stdout and exit
311  dump("");
312  $;
313}
314
315// Yes, so let's make an MPfile dump
316dump("MPfile: _dump.mp");
317killall();
318getdump("MPfile:r _dump.mp");
319
320// checkdump("MPfile: _dump.mp");
321
322// MPfork dump
323link ll = "MPtcp:fork";
324open(ll);
325if (status(ll, "openwrite", "yes"))
326{
327  write(ll, quote(getdump(mp_ll))); dump(ll); read(ll);
328  killall("not", "link");
329  write(ll, quote(dump(mp_ll))); getdump(ll); read(ll);
330
331  checkdump(ll);
332}
333kill ll;
334
335
336// MPlaunch dump
337string sing = system("Singular");
338
339if (size(sing))
340{
341  // check whether rsh works and whether remote Singular can be executed
342  if (system("sh","rsh `hostname` -n test -x "+sing+" 1>/dev/null 2>&1"))
343  {
344    if (system("sh","remsh `hostname` -n test -x "+sing+" 1>/dev/null 2>&1"))
345    {
346      if (system("sh","ssh `hostname` -f test -x "+sing+" 1>/dev/null 2>&1"))
347      {
348        sing = "";
349      }
350    }
351  }
352 
353  if (size(sing))
354  {
355    link ll = "MPtcp:launch";
356    open(ll);
357    if (status(ll, "openwrite", "yes"))
358    {
359      kill sing;
360      write(ll, quote(getdump(mp_ll))); dump(ll); read(ll);
361      killall("not", "link");
362      write(ll, quote(dump(mp_ll))); getdump(ll); read(ll);
363
364      checkdump(ll);
365    }
366    close(ll);
367  }
368}
369
370if (defined(sing))
371{
372  kill sing;
373}
374tst_ignore(system("sh", "rm -rf _dump.*"));
375
376killall("proc");
377dump("");
378tst_status(1);$
379
380
381 
382
Note: See TracBrowser for help on using the repository browser.