source: git/Tst/Short/gcd0_s.tst @ a866f1

spielwiese
Last change on this file since a866f1 was ef52d6, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
Update testsuite wrt current master (320c4f5e64cad778b4ada9556a9b0a6c71cab83a) NOTE: some wrong/bad tests were removed... TODO: add the reset of these updates after updating LIB/
  • Property mode set to 100644
File size: 5.1 KB
Line 
1//
2// gcd0_s.tst - short tests for gcd calculations in Z.
3//
4// All univariate non-trivial examples come from gcdUniv0Std.fex or
5// gcdUniv0Alpha.fex.  Some of the examples are multiplied with elements
6// from Q to test clearing of denominators.
7//
8// The examples in variables `u' and `v' came from `coprasse(2/0/1)'
9// in stdMultiv0Gcd.in.
10//
11// To Do:
12//
13// o multivariate gcd calculations with parameters
14// o algrebraic extensions of char 0 not implemented yet
15//   (but tests already exist)
16//
17
18LIB "tst.lib";
19tst_init();
20
21//
22// - ring r1=0,x,dp.
23//
24
25tst_ignore( "ring r1=0,x,dp;" );
26ring r1=0,x,dp;
27
28poly f=(-9554*x^4-12895*x^3-10023*x^2-6213*x);
29poly g;
30
31// some trivial examples
32gcd(0, 0);
33gcd(0, 3123);
34gcd(4353, 0);
35
36gcd(0, f);
37gcd(f, 0);
38
39gcd(23123, f);
40gcd(f, 13123);
41
42// some trivial examples involving rational numbers
43f=11/47894*19*(-9554*x^4-12895*x^3-10023*x^2-6213*x);
44
45gcd(0, 3123/123456);
46gcd(4353/8798798, 0);
47
48gcd(0, f);
49gcd(f, 0);
50
51gcd(23123/3, f);
52gcd(f, 13123/2);
53
54// some less trivial examples
55f=(2*x^3+2*x^2+2*x);
56g=(x^3+2*x^2+2*x+1);
57gcd(f, g);
58
59f=(-x^9-6*x^8-11*x^7-17*x^6-14*x^5-14*x^4-8*x^3-6*x^2-2*x-1);
60g=(-x^9-2*x^8-2*x^7-3*x^4-6*x^3-6*x^2-3*x-1);
61gcd(f, g);
62
63f=(4*x^9+12*x^8+29*x^7+42*x^6+54*x^5+48*x^4+35*x^3+17*x^2+6*x+1);
64g=(x^11+6*x^10+11*x^9+17*x^8+14*x^7+14*x^6+8*x^5+6*x^4+2*x^3+x^2);
65gcd(f, g);
66gcd(1/13*f, 1/4*g);
67
68f=(1412500*x^6+6218750*x^5-6910000*x^4-1201250*x^3-19470000*x^2-27277500*x);
69g=(156600000*x^5-1363865625*x^4+2627604000*x^3-2727731250*x^2+4628808000*x);
70gcd(f, g);
71
72//
73// - ring r2=(0,a),x,dp; minpoly=a^4+a^3+a^2+a+1.
74//
75
76tst_ignore( "ring r2=(0,a),x,dp;" );
77ring r2=(0,a),x,dp;
78minpoly=a^4+a^3+a^2+a+1;
79
80poly f=(-9554*x^4-12895*x^3-10023*x^2-6213*x);
81poly g;
82
83// first, some of the r1 examples (slightly modified)
84gcd(0, 0);
85gcd(0, 3123*a);
86gcd(4353, 0);
87
88gcd(0, f);
89gcd(f, 0);
90
91gcd(23123, f);
92gcd(f, 13123);
93
94// some trivial examples involving rational numbers
95f=11/47894*19*(-9554*x^4-12895*x^3-10023*x^2-6213*x);
96
97gcd(0, 3123/(123456*a));
98gcd(4353/8798798, 0);
99
100gcd(0, f/a);
101gcd(f, 0);
102
103gcd(23123/(3*a), f);
104gcd(f, 13123/2);
105
106// some less trivial examples
107f=(2*x^3+2*x^2+2*x);
108g=(x^3+2*x^2+2*x+1);
109gcd(f, g);
110
111// we go on with modified variable names
112tst_ignore( "ring r2=(0,v),u,dp;" );
113kill r2;
114ring r2=(0,v),u,dp;
115minpoly=v^4+v^3+v^2+v+1;
116
117poly f;
118poly g;
119
120// last not least, some less trivial examples
121// involving the algebraic variable.  Examples
122// are from r3.
123f=(-8*u^2*v+8*u*v^2-24*u);
124g=(-64*u^2*v+16*u*v^2);
125gcd(f, g);
126
127f=(192*u^6*v^4-240*u^5*v^5+384*u^5*v^3+48*u^4*v^6+96*u^4*v^4-576*u^4*v^2-48*u^3*v^5+144*u^3*v^3);
128g=(1536*u^6*v^4-768*u^5*v^5-1536*u^5*v^3+96*u^4*v^6+768*u^4*v^4-96*u^3*v^5);
129gcd(f, g);
130
131f=(-256*u^3*v+128*u^2*v^2-16*u*v^3);
132g=(-64*u^3+48*u^2*v^2+32*u^2*v-192*u^2-12*u*v^3-4*u*v^2+48*u*v);
133gcd(f, g);
134
135//
136// - ring r3=(0,t),x,dp.
137//
138
139tst_ignore( "ring r3=(0,t),x,dp;" );
140ring r3=(0,t),x,dp;
141
142poly f=(-9554*x^4-12895*x^3-10023*x^2-6213*x);
143poly g;
144
145// first, some of the r1 examples (slightly modified)
146gcd(0, 0);
147gcd(0, 3123*t);
148gcd(4353, 0);
149
150gcd(0, f);
151gcd(f, 0);
152
153gcd(23123, f);
154gcd(f, 13123);
155
156// some trivial examples involving rational numbers
157f=11/47894*19*(-9554*x^4-12895*x^3-10023*x^2-6213*x);
158
159gcd(0, 3123/(123456*t));
160gcd(4353/8798798, 0);
161
162gcd(0, f/t);
163gcd(f, 0);
164
165gcd(23123/(3*t), f);
166gcd(f, 13123/2);
167
168// some less trivial examples
169f=(2*x^3+2*x^2+2*x);
170g=(x^3+2*x^2+2*x+1);
171gcd(f, g);
172
173// we go on with modified variable names
174tst_ignore( "ring r3=(0,u),v,dp;" );
175kill r3;
176ring r3=(0,u),v,dp;
177
178poly f;
179poly g;
180
181// last not least, some less trivial examples
182// involving the transcendental variable
183f=(-8*u^2*v+8*u*v^2-24*u);
184g=(-64*u^2*v+16*u*v^2);
185gcd(f, g);
186
187f=(192*u^6*v^4-240*u^5*v^5+384*u^5*v^3+48*u^4*v^6+96*u^4*v^4-576*u^4*v^2-48*u^3*v^5+144*u^3*v^3);
188g=(1536*u^6*v^4-768*u^5*v^5-1536*u^5*v^3+96*u^4*v^6+768*u^4*v^4-96*u^3*v^5);
189gcd(f, g);
190
191f=(-256*u^3*v+128*u^2*v^2-16*u*v^3);
192g=(-64*u^3+48*u^2*v^2+32*u^2*v-192*u^2-12*u*v^3-4*u*v^2+48*u*v);
193gcd(f, g);
194
195//
196// - ring r4=0,(t,x),dp.
197//
198// The examples from r4 are those from r3 with parameters
199// changed to ring variables.
200//
201
202tst_ignore( "ring r4=0,(t,x),dp;" );
203ring r4=0,(t,x),dp;
204
205poly f=(-9554*x^4-12895*x^3-10023*x^2-6213*x);
206poly g;
207
208// first, some of the r1 examples (slightly modified)
209gcd(0, 0);
210gcd(0, 3123*t);
211gcd(4353, 0);
212
213gcd(0, f);
214gcd(f, 0);
215
216gcd(23123, f);
217gcd(f, 13123);
218
219// some trivial examples involving rational numbers
220f=11/47894*19*(-9554*x^4-12895*x^3-10023*x^2-6213*x);
221
222gcd(0, 3123/123456*t);
223gcd(4353/8798798, 0);
224
225gcd(23123/3*t, f);
226gcd(f, 13123/2);
227
228// some less trivial examples
229f=(2*x^3+2*x^2+2*x);
230g=(x^3+2*x^2+2*x+1);
231gcd(f, g);
232
233// we go on with modified variable names
234tst_ignore( "ring r4=0,(u,v),dp;" );
235kill r4;
236ring r4=0,(u,v),dp;
237
238poly f;
239poly g;
240
241// last not least, some less trivial examples
242// involving both variables
243f=(-8*u^2*v+8*u*v^2-24*u);
244g=(-64*u^2*v+16*u*v^2);
245gcd(f, g);
246
247f=(192*u^6*v^4-240*u^5*v^5+384*u^5*v^3+48*u^4*v^6+96*u^4*v^4-576*u^4*v^2-48*u^3*v^5+144*u^3*v^3);
248g=(1536*u^6*v^4-768*u^5*v^5-1536*u^5*v^3+96*u^4*v^6+768*u^4*v^4-96*u^3*v^5);
249gcd(f, g);
250
251f=(-256*u^3*v+128*u^2*v^2-16*u*v^3);
252g=(-64*u^3+48*u^2*v^2+32*u^2*v-192*u^2-12*u*v^3-4*u*v^2+48*u*v);
253gcd(f, g);
254tst_status(1);$
Note: See TracBrowser for help on using the repository browser.