source: git/Tst/Short/mpsr_s.tst @ b35b93

spielwiese
Last change on this file since b35b93 was b35b93, checked in by Olaf Bachmann <obachman@…>, 26 years ago
This commit was generated by cvs2svn to compensate for changes in r1396, which included commits to RCS files with non-trunk default branches. git-svn-id: file:///usr/local/Singular/svn/trunk@1397 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.0 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
36 
37// data
38int i;
39int i1 = 1;
40int i2 = -100092;
41
42intvec iv;
43intvec iv1 = 1,2,3;
44intvec iv2 = -1,2,-3,4,-5;
45
46intmat im;
47intmat im1[2][3]=1,3,5,7,8;
48intmat im2[3][3]= -1,2,-3,4,-5;
49
50string s;
51string s1 = "Hello World";
52
53list l;
54list l1 = i,iv,im,i1,iv1,im1;
55list l2 = l1, iv2, l, im2;
56
57ring r;
58
59poly p;
60number n;
61number n1 = 2;
62number n2 = -7;
63
64poly p1 = x + y;
65poly p2 = xyz - 2x3y4z5 + 3xy -4yz + 5z;
66poly p3 = p2^2;
67
68vector v;
69vector v1 = [p1, p2];
70vector v2 = [p, p1,p2, p3] + p1*gen(5);
71
72ideal id;
73ideal id1 = p, p1, p2, p3;
74ideal id2 = p, p1+p2, p2+3, p1+p2+p3, p1, p2, p3;
75
76module mv;
77module mv1 = v, v1, v2;
78module mv2 = v1+v2, p1*v2, p2*v1, v, v1, v2;
79
80matrix m;
81matrix m1[2][3] = p, p1, p2, id1;
82matrix m2[4][4] =  p, p1, p2, p3, id1, id2;
83
84ring rr = 32003,(a,b),dp;
85map f = r, a,b,a+b;
86map g   = rr,a2,b2;
87map phi = g(f);
88
89
90ring r0 = 0, x, lp;
91number n;
92number n1 = 29734481274863241234589;
93number n2 = n1/(n1-6);
94
95poly p;
96poly p1 = n1*x + n2*x^4 + 7/3*x^2*x^5 - 6;
97poly p2 = x*x*x - 2*x^3*x^4*x^5 + 3*x*x -4*x*x + 5*x^2 + p1;
98poly p3 = p2*p2;
99
100
101// First, make two (preserves order of variables) ASCII-dumps of everything
102dump(":w _dump.txt");
103killall();
104getdump("_dump.txt");
105
106// Does our version have MP?
107if (! (system("with", "MP")))
108{
109  // no -- so simply dump everything to stdout and exit
110  dump("");
111  $;
112}
113
114// Yes, so let's make an MPfile dump
115dump("MPfile: _dump.mp");
116killall();
117getdump("MPfile:r _dump.mp");
118
119// checkdump("MPfile: _dump.mp");
120
121// MPfork dump
122link ll = "MPtcp:fork";
123open(ll);
124if (status(ll, "openwrite", "yes"))
125{
126  write(ll, quote(getdump(mp_ll))); dump(ll); read(ll);
127  killall("not", "link");
128  write(ll, quote(dump(mp_ll))); getdump(ll); read(ll);
129
130  checkdump(ll);
131}
132kill ll;
133
134
135// MPlaunch dump
136string sing = system("whoami");
137
138if (size(sing))
139{
140  // check whether rsh works and whether remote Singular can be executed
141  if (system("sh","rsh `hostname` -n test -x "+sing+" 1>/dev/null 2>&1"))
142  {
143    if (system("sh","remsh `hostname` -n test -x "+sing+" 1>/dev/null 2>&1"))
144    {
145      if (system("sh","ssh `hostname` -f test -x "+sing+" 1>/dev/null 2>&1"))
146      {
147        sing = "";
148      }
149    }
150  }
151
152  if (size(sing))
153  {
154    link ll = "MPtcp:launch";
155    open(ll);
156    if (status(ll, "openwrite", "yes"))
157    {
158      kill sing;
159      write(ll, quote(getdump(mp_ll))); dump(ll); read(ll);
160      killall("not", "link");
161      write(ll, quote(dump(mp_ll))); getdump(ll); read(ll);
162
163      checkdump(ll);
164    }
165    kill ll;
166  }
167}
168
169if (defined(sing))
170{
171  kill sing;
172}
173tst_ignore(system("sh", "rm -rf _dump.*"));
174
175killall("proc");
176dump("");
177$
178
179
180 
181
Note: See TracBrowser for help on using the repository browser.