1 | LIB "tst.lib"; |
---|
2 | tst_init(); |
---|
3 | LIB "general.lib"; |
---|
4 | |
---|
5 | option(noredefine); |
---|
6 | |
---|
7 | proc 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 | |
---|
21 | proc 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 | |
---|
30 | proc checkdump(link l) |
---|
31 | { |
---|
32 | rcheckdump(l, names()); |
---|
33 | } |
---|
34 | |
---|
35 | // data |
---|
36 | int i; |
---|
37 | int i1 = 1; |
---|
38 | int i2 = -100092; |
---|
39 | |
---|
40 | intvec iv; |
---|
41 | intvec iv1 = 1,2,3; |
---|
42 | intvec iv2 = -1,2,-3,4,-5; |
---|
43 | |
---|
44 | intmat im; |
---|
45 | intmat im1[2][3]=1,3,5,7,8; |
---|
46 | intmat im2[3][3]= -1,2,-3,4,-5; |
---|
47 | |
---|
48 | string s; |
---|
49 | string s1 = "Hello World"; |
---|
50 | |
---|
51 | list l; |
---|
52 | list l1 = i,iv,im,i1,iv1,im1; |
---|
53 | list l2 = l1, iv2, l, im2; |
---|
54 | |
---|
55 | ring r; |
---|
56 | |
---|
57 | poly p; |
---|
58 | number n; |
---|
59 | number n1 = 2; |
---|
60 | number n2 = -7; |
---|
61 | |
---|
62 | poly p1 = x + y; |
---|
63 | poly p2 = xyz - 2x3y4z5 + 3xy -4yz + 5z; |
---|
64 | poly p3 = p2^4; |
---|
65 | |
---|
66 | vector v; |
---|
67 | vector v1 = [p1, p2]; |
---|
68 | vector v2 = [p, p1,p2, p3] + p1*gen(5); |
---|
69 | |
---|
70 | ideal id; |
---|
71 | ideal id1 = p, p1, p2, p3; |
---|
72 | ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3; |
---|
73 | |
---|
74 | module mv; |
---|
75 | module mv1 = v, v1, v2; |
---|
76 | module mv2 = v1+v2, p1*v2, p2*v1, v, v1, v2; |
---|
77 | |
---|
78 | matrix m; |
---|
79 | matrix m1[2][3] = p, p1, p2, id1; |
---|
80 | matrix m2[4][4] = p, p1, p2, p3, id1, id2; |
---|
81 | |
---|
82 | |
---|
83 | ideal 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; |
---|
88 | poly p11 = x + y; |
---|
89 | poly p12 = xyz - 2x3y4z5 + 3xy -4yz + 5z; |
---|
90 | poly p13 = p12^4; |
---|
91 | |
---|
92 | ring rtm = 32003, (x,y,z,t), dp; |
---|
93 | ideal ex = t3y7z4 + 9x8 + 5t2x4y2 + 2t2xy2z3, |
---|
94 | 2t2x5y4+7txy6+9y8 + 2t2x2yz3, 3t4x2y3z2 + 9z8, 3x2y9 + |
---|
95 | y9 + 5x4; |
---|
96 | |
---|
97 | ring rt0 = 0, (x,y,z,t), dp; |
---|
98 | ideal ex = t3y7z4 + 9x8 + 5t2x4y2 + 2t2xy2z3, |
---|
99 | 2t2x5y4+7txy6+9y8 + 2t2x2yz3, 3t4x2y3z2 + 9z8, 3x2y9 + |
---|
100 | y9 + 5x4; |
---|
101 | |
---|
102 | |
---|
103 | ring rr = 32003,(a,b),dp; |
---|
104 | map f = r, a,b,a+b; |
---|
105 | map g = rr,a2,b2; |
---|
106 | map phi = g(f); |
---|
107 | |
---|
108 | |
---|
109 | ring r0 = 0, x, lp; |
---|
110 | number n; |
---|
111 | number n1 = 29734481274863241234589; |
---|
112 | number n2 = n1/(n1-6); |
---|
113 | |
---|
114 | poly p; |
---|
115 | poly p1 = n1*x + n2*x^4 + 7/3*x^2*x^5 - 6; |
---|
116 | poly p2 = x*x*x - 2*x^3*x^4*x^5 + 3*x*x -4*x*x + 5*x^2 + p1; |
---|
117 | poly p3 = p2*p2; |
---|
118 | |
---|
119 | vector v; |
---|
120 | vector v1 = [p1, p2]; |
---|
121 | vector v2 = [p, p1,p2, p3] + p1*gen(5); |
---|
122 | |
---|
123 | ideal id; |
---|
124 | ideal id1 = p, p1, p2, p3; |
---|
125 | ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3; |
---|
126 | |
---|
127 | module mv; |
---|
128 | module mv1 = v, v1, v2; |
---|
129 | module mv2 = v1+v2, p1*v2, p2*v1, v, v1, v2; |
---|
130 | |
---|
131 | matrix m; |
---|
132 | matrix m1[2][3] = p, p1, p2, id1; |
---|
133 | matrix m2[4][4] = p, p1, p2, p3, id1, id2; |
---|
134 | |
---|
135 | |
---|
136 | ring r1 = 0, x(1..10), ls; |
---|
137 | |
---|
138 | number n; |
---|
139 | number n1 = 29734481274863241234589; |
---|
140 | number n2 = n1/(n1-6); |
---|
141 | |
---|
142 | poly p; |
---|
143 | poly p1 = n1*x(1) + n2*x(5)^4 + 7/3*x(3)^2*x(4)^5 - 6; |
---|
144 | poly 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) + |
---|
145 | 5*x(9)^2 + p1; |
---|
146 | poly p3 = p2*p2; |
---|
147 | |
---|
148 | vector v; |
---|
149 | vector v1 = [p1, p2]; |
---|
150 | vector v2 = [p, p1,p2, p3] + p1*gen(5); |
---|
151 | |
---|
152 | ideal id; |
---|
153 | ideal id1 = p, p1, p2, p3; |
---|
154 | ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3; |
---|
155 | |
---|
156 | module mv; |
---|
157 | module mv1 = v, v1, v2; |
---|
158 | module mv2 = v1+v2, p1*v1, v1-v2, v, v1, v2; |
---|
159 | |
---|
160 | matrix m; |
---|
161 | matrix m1[2][3] = p, p1, p2, id1; |
---|
162 | matrix m2[4][4] = p, p1, p2, p3, id1, id2; |
---|
163 | |
---|
164 | ring r2=10,(x(1..6)),(lp(2),dp(4)); |
---|
165 | number n; |
---|
166 | number n1 = 29734481274863241234589; |
---|
167 | number n2 = n1/(n1-6); |
---|
168 | |
---|
169 | poly p; |
---|
170 | poly p1 = n1*x(1) + n2*x(5)^4 + 7/3*x(3)^2*x(4)^5 - 6; |
---|
171 | poly 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) + |
---|
172 | 5*x(3)^2 + p1; |
---|
173 | poly p3 = p2*p2; |
---|
174 | |
---|
175 | vector v; |
---|
176 | vector v1 = [p1, p2]; |
---|
177 | vector v2 = [p, p1,p2, p3] + p1*gen(5); |
---|
178 | |
---|
179 | ideal id; |
---|
180 | ideal id1 = p, p1, p2, p3; |
---|
181 | ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3; |
---|
182 | |
---|
183 | module mv; |
---|
184 | module mv1 = v, v1, v2; |
---|
185 | module mv2 = v1+v2, p1*v2, v1-v2, v, v1, v2; |
---|
186 | |
---|
187 | matrix m; |
---|
188 | matrix m1[2][3] = p, p1, p2, id1; |
---|
189 | matrix m2[4][4] = p, p1, p2, p3, id1, id2; |
---|
190 | |
---|
191 | ring r3=(7,a, b, c),(x,y,z),dp; |
---|
192 | number n; |
---|
193 | number n1 = 2*a^2*b*c -3*b*c + -1*a + 4; |
---|
194 | number n2 = n1 / (n1 - 5c)^2; |
---|
195 | |
---|
196 | poly p; |
---|
197 | poly p1 = x + y + a; |
---|
198 | poly p2 = 3*a^2*xyz*n1 - 2*n2*x3y4z5 + 3xy -4yz + n1*z; |
---|
199 | poly p3 = p2*p1; |
---|
200 | |
---|
201 | vector v; |
---|
202 | vector v1 = [p1, p2]; |
---|
203 | vector v2 = [p, p1,p2, p3] + p1*gen(5); |
---|
204 | |
---|
205 | ideal id; |
---|
206 | ideal id1 = p, p1, p2, p3; |
---|
207 | ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3; |
---|
208 | |
---|
209 | module mv; |
---|
210 | module mv1 = v, v1, v2; |
---|
211 | module mv2 = v1+v2, p1*v2, v1-v2, v, v1, v2; |
---|
212 | |
---|
213 | matrix m; |
---|
214 | matrix m1[2][3] = p, p1, p2, id1; |
---|
215 | matrix m2[4][4] = p, p1, p2, p3, id1, id2; |
---|
216 | |
---|
217 | ring r4=(7,a),(x,y,z),dp; |
---|
218 | minpoly=a^2+a+3; |
---|
219 | poly p; |
---|
220 | number n; |
---|
221 | number n1 = 2*a^2 + 3; |
---|
222 | number n2 = n1 / (n1 -5)^3; |
---|
223 | |
---|
224 | poly p1 = x + y + a; |
---|
225 | poly p2 = 3*a^2*xyz*n1 - 2*n2*x3y4z5 + 3xy -4yz + n1*z; |
---|
226 | poly p3 = p2^4; |
---|
227 | |
---|
228 | vector v; |
---|
229 | vector v1 = [p1, p2]; |
---|
230 | vector v2 = [p, p1,p2, p3] + p1*gen(5); |
---|
231 | |
---|
232 | ideal id; |
---|
233 | ideal id1 = p, p1, p2, p3; |
---|
234 | ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3; |
---|
235 | |
---|
236 | module mv; |
---|
237 | module mv1 = v, v1, v2; |
---|
238 | module mv2 = v1+v2, p1*v2, v1-v2, v, v1, v2; |
---|
239 | |
---|
240 | matrix m; |
---|
241 | matrix m1[2][3] = p, p1, p2, id1; |
---|
242 | matrix m2[4][4] = p, p1, p2, p3, id1, id2; |
---|
243 | |
---|
244 | ring r5=(49,a),(x,y,z),dp; |
---|
245 | poly p; |
---|
246 | number n; |
---|
247 | number n1 = 2*a^2 + 3; |
---|
248 | number n2 = n1 / (n1 -5)^3; |
---|
249 | |
---|
250 | poly p1 = x + y + a; |
---|
251 | poly p2 = 3*a^2*xyz*n1 - 2*n2*x3y4z5 + 3xy -4yz + n1*z; |
---|
252 | poly p3 = p2^4; |
---|
253 | |
---|
254 | vector v; |
---|
255 | vector v1 = [p1, p2]; |
---|
256 | vector v2 = [p, p1,p2, p3] + p1*gen(5); |
---|
257 | |
---|
258 | ideal id; |
---|
259 | ideal id1 = p, p1, p2, p3; |
---|
260 | ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3; |
---|
261 | |
---|
262 | module mv; |
---|
263 | module mv1 = v, v1, v2; |
---|
264 | module mv2 = v1+v2, p1*v2, v1-v2, v, v1, v2; |
---|
265 | |
---|
266 | matrix m; |
---|
267 | matrix m1[2][3] = p, p1, p2, id1; |
---|
268 | matrix m2[4][4] = p, p1, p2, p3, id1, id2; |
---|
269 | |
---|
270 | ring r6 = 32003, (x,y,z), wp(1,2,3); |
---|
271 | poly p = (xyz - 2x3y4z5 + 3xy -4yz + 5z + 2)^2; |
---|
272 | |
---|
273 | ring r7 = 32003, (x,y,z), Ws(1,2,3); |
---|
274 | poly p = (xyz - 2x3y4z5 + 3xy -4yz + 5z + 2)^2; |
---|
275 | |
---|
276 | ring r8 = 32003, (a,b,c,x,y,z), (dp(3), wp(1,2,3)); |
---|
277 | poly p = (xyzabc - 2x3y4z5a2b4c3 + 3xya2 -4yzb3c2 + 5zc + 2)^2; |
---|
278 | |
---|
279 | ring r9 = 32003, (a,b,c,x,y,z), (a(1,2,3,4,5),Dp(3), ds(3)); |
---|
280 | poly p = (xyzabc - 2x3y4z5a2b4c3 + 3xya2 -4yzb3c2 + 5zc + 2)^2; |
---|
281 | |
---|
282 | ring r10 = 32003, (x,y,z), M(1, 0, 0, 0, 1, 0, 0, 0, 1); |
---|
283 | poly p = (xyz - 2x3y4z5 + 3xy -4yz + 5z + 2)^2; |
---|
284 | |
---|
285 | ring r11 = 0, x(1..10), (lp(2), M(1, 2, 3, 1, 1, 1, 1, 0, 0), ds(2), ws(1,2,3)); |
---|
286 | poly p1 = x(1) + 123399456085/(123399456085 + 1)*x(5)^4 + 7/3*x(3)^2*x(4)^5 - 6; |
---|
287 | poly 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) + |
---|
288 | 5*x(9)^2 + p1; |
---|
289 | |
---|
290 | ring r12 = 0, (x,y,z), (C,lp); |
---|
291 | vector v1 = [x+y2,z3+xy]; |
---|
292 | vector v2 = [x,x,x]; |
---|
293 | |
---|
294 | ring r13 = 0, (x,y,z), (lp,c); |
---|
295 | vector v1 = [x+y2,z3+xy]; |
---|
296 | vector v2 = [x,x,x]; |
---|
297 | |
---|
298 | ring r14 = 0, (x,y,z), (c,lp); |
---|
299 | vector v1 = [x+y2,z3+xy]; |
---|
300 | vector v2 = [x,x,x]; |
---|
301 | |
---|
302 | // First, make ASCII-dump of everything |
---|
303 | dump(":w _dump.txt"); |
---|
304 | killall(); |
---|
305 | getdump("_dump.txt"); |
---|
306 | |
---|
307 | // Does our version have MP? |
---|
308 | if (! (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 |
---|
316 | dump("MPfile: _dump.mp"); |
---|
317 | killall(); |
---|
318 | getdump("MPfile:r _dump.mp"); |
---|
319 | |
---|
320 | // checkdump("MPfile: _dump.mp"); |
---|
321 | |
---|
322 | // MPfork dump |
---|
323 | link ll = "MPtcp:fork"; |
---|
324 | open(ll); |
---|
325 | if (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 | } |
---|
333 | kill ll; |
---|
334 | |
---|
335 | |
---|
336 | // MPlaunch dump |
---|
337 | string sing = system("whoami"); |
---|
338 | |
---|
339 | if (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 | kill ll; |
---|
367 | } |
---|
368 | } |
---|
369 | |
---|
370 | if (defined(sing)) |
---|
371 | { |
---|
372 | kill sing; |
---|
373 | } |
---|
374 | tst_ignore(system("sh", "rm -rf _dump.*")); |
---|
375 | |
---|
376 | killall("proc"); |
---|
377 | dump(""); |
---|
378 | $ |
---|
379 | |
---|
380 | |
---|
381 | |
---|
382 | |
---|