1 | LIB "tst.lib"; tst_init(); |
---|
2 | |
---|
3 | proc TestRingPrinting(def r, string n) |
---|
4 | { |
---|
5 | def save = basering; |
---|
6 | |
---|
7 | setring r; |
---|
8 | |
---|
9 | "VVVVVVVVVVVV[", n, "]VVVVVVVVVVVV"; |
---|
10 | |
---|
11 | "r == currRing (the following type and print should yield the same output!): "; |
---|
12 | "type: "; r; |
---|
13 | "print(ring): "; print(r); |
---|
14 | |
---|
15 | ring @temp = 2,@a,ds; setring @temp; |
---|
16 | |
---|
17 | "r != currRing (the following type and print may be different!): "; |
---|
18 | "type: "; r; |
---|
19 | "print(ring): "; print(r); |
---|
20 | |
---|
21 | "^^^^^^^^^^^^[", n, "]^^^^^^^^^^^^"; |
---|
22 | kill @temp; |
---|
23 | |
---|
24 | setring save; |
---|
25 | } |
---|
26 | int i; |
---|
27 | ring R = (9,a),x,dp; |
---|
28 | |
---|
29 | TestRingPrinting(R, "commutative polynomial ring over GF(3^2)"); |
---|
30 | |
---|
31 | for(i = 0; i<= 20; i++) |
---|
32 | { |
---|
33 | "exp: ", i, ", a^exp: ", a^i; |
---|
34 | } |
---|
35 | |
---|
36 | kill R; |
---|
37 | |
---|
38 | |
---|
39 | |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | ring R = (0,a), x,dp; minpoly = a2+1; |
---|
44 | |
---|
45 | TestRingPrinting(R, "commutative polynomial ring over Q[a]/<a2+1>"); |
---|
46 | |
---|
47 | for(i = 0; i<= 20; i++) |
---|
48 | { |
---|
49 | "exp: ", i, ", a^exp: ", a^i; |
---|
50 | } |
---|
51 | |
---|
52 | kill R; |
---|
53 | |
---|
54 | |
---|
55 | |
---|
56 | |
---|
57 | ring R = (complex,30,a), x,dp; |
---|
58 | |
---|
59 | TestRingPrinting(R, "commutative polynomial ring over GMP complex numbers with parameter: 'a'"); |
---|
60 | |
---|
61 | for(i = 0; i<= 20; i++) |
---|
62 | { |
---|
63 | "exp: ", i, ", a^exp: ", a^i; |
---|
64 | } |
---|
65 | |
---|
66 | |
---|
67 | kill R; |
---|
68 | |
---|
69 | |
---|
70 | tst_status(1);$ |
---|