1 | // File: hnoether_l.tst |
---|
2 | // Intensive tests for hnoether lib |
---|
3 | LIB "tst.lib"; |
---|
4 | tst_init(); |
---|
5 | LIB "hnoether.lib"; |
---|
6 | // ------------ test of develop: ------------------- |
---|
7 | ring zuklein=0,x,dp; |
---|
8 | develop(x2+2x3); |
---|
9 | ring r=0,(x,y),ds; |
---|
10 | develop(x2+2x+3+y); |
---|
11 | develop(0); |
---|
12 | develop(x2+y2); |
---|
13 | develop(x2+y+y2); |
---|
14 | develop(2x2+3xy+4xy3-x2y); |
---|
15 | poly p_1 = y2+x3; |
---|
16 | poly p_2 = p_1^2 + x5y; |
---|
17 | poly p_3 = p_2^2 + x^10 *p_1; |
---|
18 | poly p_4 = p_3^2 + x^20 *p_2; |
---|
19 | poly p_5 = p_4^2 + x^40 *p_3; |
---|
20 | param(develop(p_2)); |
---|
21 | int z=timer; |
---|
22 | param(develop(p_4)); |
---|
23 | tst_ignore(timer-z,"time"); |
---|
24 | z=timer; |
---|
25 | list hne=develop(p_4,-1); |
---|
26 | tst_ignore(timer-z,"time"); |
---|
27 | print(extdevelop(hne,4)[1]); |
---|
28 | tst_ignore(timer-z,"time"); |
---|
29 | z=timer; |
---|
30 | print(develop(p_4,4)[1]); |
---|
31 | tst_ignore(timer-z,"time"); |
---|
32 | poly heme=xy8+y8+x4y6+4x3y6+2x5y5+6x6y4+4x8y3+x10y2+4x9y2+2x11y+x12; |
---|
33 | hne=develop(heme); |
---|
34 | print(hne[1]); |
---|
35 | ring R=32003,(x,y),dp; |
---|
36 | poly p_5=imap(r,p_5); |
---|
37 | z=timer; |
---|
38 | print(develop(p_5,-1)[1]); |
---|
39 | tst_ignore(timer-z,"time"); |
---|
40 | kill r; |
---|
41 | ring r=32003,(x,y),ls; |
---|
42 | poly p_5=fetch(R,p_5); |
---|
43 | z=timer; |
---|
44 | print(develop(p_5,-1)[1]); |
---|
45 | tst_ignore(timer-z,"time"); |
---|
46 | kill r,R; |
---|
47 | ring r=2,(x,y,t),ds; |
---|
48 | poly f=y2+x7y+x9+x8; |
---|
49 | param(develop(f)); |
---|
50 | kill r; |
---|
51 | ring r=7,(x,y),dp; |
---|
52 | poly f=2*(y-3x7)^14; |
---|
53 | develop(f+x12y14); |
---|
54 | develop(f+x7y14); |
---|
55 | kill r; |
---|
56 | ring r=(0,i),(a,b),dp; |
---|
57 | develop(a2+ib3); |
---|
58 | develop(a5+i2*a4+2i*a2b+b2); |
---|
59 | kill r; |
---|
60 | ring r=(0,i),(a,b),dp; |
---|
61 | minpoly=i2+1; |
---|
62 | develop(a2+ib3); |
---|
63 | develop(a5+i2*a4+2i*a2b+b2); |
---|
64 | develop((a+2b)^2+ib5); |
---|
65 | kill r; |
---|
66 | ring r=(7,i),(x,y),dp; |
---|
67 | develop(x+y); |
---|
68 | kill r; |
---|
69 | ring r=(7,i),(x,y),dp; |
---|
70 | minpoly=i2+1; |
---|
71 | develop(x); |
---|
72 | kill r; |
---|
73 | ring r=(49,k),(g,h),Dp; |
---|
74 | develop(g3+h4); |
---|
75 | develop((g2+2h)^7+h9); |
---|
76 | kill r; |
---|
77 | ring r=real,(x,y),dp; |
---|
78 | develop(x-y); |
---|
79 | kill r; |
---|
80 | ring r=(11,a,b,c),(d,e,f),ls; |
---|
81 | develop(ad2+a2b3e3+2bc4e4); |
---|
82 | kill r; |
---|
83 | |
---|
84 | // ------------ test of reddevelop: ------------------- |
---|
85 | setring zuklein; |
---|
86 | reddevelop(x); |
---|
87 | ring r=7,(a,b),dp; |
---|
88 | reddevelop(a6+b4); |
---|
89 | kill HNEring,r; |
---|
90 | ring r=0,(x,y),dp; |
---|
91 | reddevelop(x6-y4); |
---|
92 | setring r; |
---|
93 | kill HNEring; |
---|
94 | reddevelop((x6-y4)*(y6-x4)); |
---|
95 | setring r;kill HNEring; |
---|
96 | reddevelop((y-x2+x3)*(y-x2-x3)); |
---|
97 | setring r; |
---|
98 | kill HNEring; |
---|
99 | reddevelop((x7-2x4y2+xy4-1y5)*(x7-4x4y2+4xy4-1y5)); |
---|
100 | setring r; |
---|
101 | kill HNEring; |
---|
102 | reddevelop((y2-x3)*(y2-x3-x4)); |
---|
103 | setring r; |
---|
104 | kill HNEring; |
---|
105 | reddevelop((y2-x3-x4)*(y2+x3+x4)); |
---|
106 | setring r; |
---|
107 | kill HNEring; |
---|
108 | reddevelop(((x2-y)^2+x5)*((2x2-y)^2+x5)); |
---|
109 | setring r; |
---|
110 | kill HNEring; |
---|
111 | reddevelop(x2+1+y3); |
---|
112 | setring r; |
---|
113 | kill HNEring; |
---|
114 | reddevelop(0); |
---|
115 | kill HNEring,r; |
---|
116 | ring r=(49,i),(x,y),dp; |
---|
117 | reddevelop(x); |
---|
118 | kill r; |
---|
119 | ring r=(7,i),(x,y),dp; |
---|
120 | list hne=reddevelop(x3+y6); |
---|
121 | hne; |
---|
122 | displayHNE(hne); |
---|
123 | setring r; |
---|
124 | kill HNEring; |
---|
125 | reddevelop((x2+y4)*(x+y4)); |
---|
126 | setring r; |
---|
127 | kill HNEring; |
---|
128 | reddevelop(x2+y4); |
---|
129 | kill r,HNEring; |
---|
130 | ring r=(0,e),(x,y),lp; |
---|
131 | reddevelop(x2-y2); |
---|
132 | kill HNEring; |
---|
133 | setring r; |
---|
134 | reddevelop(x2-ey2); |
---|
135 | kill r,HNEring; |
---|
136 | ring r=(32003,i),(x,y),dp; |
---|
137 | minpoly=i2+1; |
---|
138 | reddevelop(x2+y4); |
---|
139 | HNEring; |
---|
140 | kill r,HNEring; |
---|
141 | ring r=(32003,i),(x,y),dp; |
---|
142 | minpoly=i2+i+1; |
---|
143 | reddevelop(x2+y4); |
---|
144 | basering; |
---|
145 | kill r,HNEring; |
---|
146 | ring r=real,(x,y),dp; |
---|
147 | reddevelop(x); |
---|
148 | kill r; |
---|
149 | ring r=(11,a,b,c),(d,e,f,g),dp; |
---|
150 | list hne=reddevelop(a2bd2+bce3+a2c3e4); |
---|
151 | hne; |
---|
152 | displayHNE(hne[1]); |
---|
153 | basering; |
---|
154 | kill r,HNEring; |
---|
155 | ring r=(11,a,b,c),(d,e),Ds; |
---|
156 | reddevelop(a2bd2+bce3+a2c3e4); |
---|
157 | kill r,HNEring; |
---|
158 | ring r=(11,a),(x,y,z),wp(1,2,3); |
---|
159 | minpoly=a2+4; |
---|
160 | list hne=reddevelop(x2+ay3); |
---|
161 | hne; |
---|
162 | displayHNE(hne[1]); |
---|
163 | basering; |
---|
164 | kill r,HNEring; |
---|
165 | ring r=(11,a),(x,y,z),wp(1,2,3); |
---|
166 | reddevelop(x2+ay3); |
---|
167 | kill HNEring,r; |
---|
168 | //--------------- examples with change to ring extension |
---|
169 | ring F2=2,(x,y),dp; |
---|
170 | reddevelop(y2+x7y+x9+x8); |
---|
171 | ring R=32003,(x,y),dp; |
---|
172 | kill HNEring; |
---|
173 | reddevelop((x6+(y-x)^4)*(y+x)); |
---|
174 | setring R; |
---|
175 | kill HNEring; |
---|
176 | poly f=x19-4x18+3x17+8x16y-1x16-10x15y-4x14y2+6x14y+10x13y2-16x12y2+26x10y3-5x9y4-30x8y4+2x7y5+26x6y5-16x4y6+6x2y7-1y8; |
---|
177 | reddevelop(f); |
---|
178 | setring R; |
---|
179 | kill HNEring; |
---|
180 | f=x29-6x28+14x27+12x26y-18x26-56x25y-6x24y2+13x25+110x24y+84x23y2-5x24-108x23y-282x22y2-56x21y3+54x22y+396x21y2+390x20y3+14x19y4-266x20y2-840x19y3-310x18y4+790x18y3+1134x17y4+138x16y5-1575x16y4-1008x15y5-30x14y6+2220x14y5+588x13y6+2x12y7-2268x12y6-216x11y7+1692x10y7+45x9y8-915x8y8-4x7y9+350x6y9-90x4y10+14x2y11-1y12; |
---|
181 | list hne=reddevelop(f); |
---|
182 | displayHNE(hne); |
---|
183 | displayInvariants(hne); |
---|
184 | setring R; |
---|
185 | kill HNEring; |
---|
186 | reddevelop(xy6+x3y4-4x5y3+6x7y2-4x9y+x11); |
---|
187 | setring R; kill HNEring; |
---|
188 | reddevelop(y10-4x3y8+6x6y6-4x9y4+x12y2+x16); |
---|
189 | setring R; kill HNEring; |
---|
190 | reddevelop((y10-4x3y8+6x6y6-4x9y4+x12y2+x16)*(x6-y4)); |
---|
191 | kill HNEring,R; |
---|
192 | //--------------- example with more than one ring change |
---|
193 | ring F3=3,(x,y),dp; |
---|
194 | list hne=reddevelop((x3-xy2+y3)*(x2+y2)*(x4-x3y+xy3+y4)); |
---|
195 | map T; int i; |
---|
196 | poly f=(x3-xy2+y3)*(x2+y2)*(x4-x3y+xy3+y4); |
---|
197 | for (i=1; i<=size(hne); i++) { |
---|
198 | T=basering,param(hne[i]); |
---|
199 | T(f); |
---|
200 | } |
---|
201 | displayHNE(hne); |
---|
202 | displayHNE(hne[3],1); |
---|
203 | kill displayring; |
---|
204 | kill HNEring; |
---|
205 | setring F3; |
---|
206 | reddevelop((x3-xy4+y6)*(x2+y2)*(x4-x3y+xy3+y4)); |
---|
207 | setring F3; |
---|
208 | kill HNEring; |
---|
209 | reddevelop((x3-xy4+y6)*(x2+y6)*(x4-x3y4+xy12+y16)); |
---|
210 | kill HNEring; |
---|
211 | // -------------- bigger examples with timings |
---|
212 | ring r=0,(x,y),dp; |
---|
213 | poly p_1 = y2+x3; |
---|
214 | poly p_2 = p_1^2 + x5y; |
---|
215 | poly p_3 = p_2^2 + x^10 *p_1; |
---|
216 | poly p_4 = p_3^2 + x^20 *p_2; |
---|
217 | poly p_5 = p_4^2 + x^40 *p_3; |
---|
218 | z=timer; |
---|
219 | list hne=reddevelop(p_1*p_2*p_3*p_4); |
---|
220 | tst_ignore(timer-z,"time"); |
---|
221 | tst_ignore(kmemory(),"memory"); |
---|
222 | print(hne[3][1]); |
---|
223 | print(hne[4][1]); |
---|
224 | displayInvariants(hne); |
---|
225 | setring r; |
---|
226 | kill HNEring; |
---|
227 | z=timer; |
---|
228 | list hne=reddevelop(p_5); |
---|
229 | tst_ignore(timer-z,"time"); |
---|
230 | tst_ignore(kmemory(),"memory"); |
---|
231 | print(hne[1][1]); |
---|
232 | displayInvariants(hne); |
---|
233 | displayInvariants(hne[1]); |
---|
234 | kill HNEring; |
---|
235 | // ------------ test of extdevelop: ------------------- |
---|
236 | setring r; |
---|
237 | list hne=develop(x2+y3+y4-y5,-1); |
---|
238 | extdevelop(hne,2); |
---|
239 | extdevelop(hne,4); |
---|
240 | extdevelop(hne,10); |
---|
241 | kill r; |
---|
242 | ring r=(49,i),(x,y),ls; |
---|
243 | list hne=develop((x2+iy3)^7+x15); |
---|
244 | extdevelop(hne,8); |
---|
245 | kill r; |
---|
246 | // ------------ test of param: ------------------------ |
---|
247 | ring r=0,(x,y),dp; |
---|
248 | param(develop(x+1+y2)); |
---|
249 | param(develop(x2+y3)); |
---|
250 | param(develop(y2+x3)); |
---|
251 | param(develop(x+y2-y3)); |
---|
252 | param(develop(x2+y3+y4)); |
---|
253 | param(develop((x-2y3)^2+x3)); |
---|
254 | param(develop(y+x2-y3)); |
---|
255 | param(develop((y-2x3)^2+x7)); |
---|
256 | z=timer; |
---|
257 | param(develop((y-2x3)^2+y5)); |
---|
258 | tst_ignore(timer-z,"time"); |
---|
259 | kill r; |
---|
260 | ring r=(27,j),(k,l,t),lp; |
---|
261 | list hne=develop((k3-jl)^6+l7,9); |
---|
262 | param(hne); |
---|
263 | // ------------ test of displayHNE: ------------------- |
---|
264 | displayHNE(hne); |
---|
265 | kill r; |
---|
266 | ring r=3,(k,l,t),lp; |
---|
267 | list hne=develop((k3+l)^6+l7,9); |
---|
268 | displayHNE(hne); |
---|
269 | basering; |
---|
270 | displayHNE(hne,1); |
---|
271 | basering; |
---|
272 | kill displayring,r; |
---|
273 | ring r=0,(x,y),dp; |
---|
274 | displayHNE(develop(x)); |
---|
275 | displayHNE(develop(y)); |
---|
276 | displayHNE(develop(1)); |
---|
277 | // ------------ test of displayInvariants: ------------ |
---|
278 | list hne=reddevelop((x2+y3+y4)*(x+y2+y3-y4)*(x5+y7)); |
---|
279 | displayInvariants(hne[1]); |
---|
280 | displayInvariants(hne[2]); |
---|
281 | displayInvariants(hne); |
---|
282 | kill HNEring; |
---|
283 | // ---------------------------------------------------------------------------- |
---|
284 | // ------- test of invariants, intersection, stripHNE, puiseux2generators, --- |
---|
285 | // ------- multiplicities, newtonpoly --- |
---|
286 | example invariants; |
---|
287 | setring r; |
---|
288 | list hne=reddevelop((x2-y3)*(x2+y3)); |
---|
289 | intersection(hne[1],hne[2]); |
---|
290 | example stripHNE; |
---|
291 | puiseux2generators(intvec(3,7,15,31,63,127),intvec(2,2,2,2,2,2)); |
---|
292 | setring r; |
---|
293 | multiplicities(develop(x5+y7)); |
---|
294 | example newtonpoly; |
---|
295 | // ------- test of getnm, T_Transform, T1_Transform, T2_Transform, koeff, ----- |
---|
296 | // ------- redleit, squarefree, allsquarefree, set_list, referencepoly ----- |
---|
297 | example getnm; |
---|
298 | T_Transform(y2+x3,1,2); |
---|
299 | T1_Transform(y-x2+x3,1,2); |
---|
300 | T2_Transform(y2+x3-x2y,-1,3,2,referencepoly(newtonpoly(y2+x3-x2y))); |
---|
301 | koeff(x2+2xy+3xy2-x2y-2y3,1,2); |
---|
302 | example redleit; |
---|
303 | example squarefree; |
---|
304 | ring R=(27,k),(x,y),dp; |
---|
305 | squarefree(x2); |
---|
306 | squarefree(y3); |
---|
307 | squarefree((x2+y)^3*(x-y)^2*(x+y)); |
---|
308 | |
---|
309 | example allsquarefree; |
---|
310 | list L=list(poly(x-y),ideal(x,y)); |
---|
311 | set_list(L,intvec(2,1),x2+y7); |
---|
312 | tst_status(1);$ |
---|