spielwiese
Last change
on this file since 57f898 was
a866f1,
checked in by Martin Lee <martinlee84@…>, 10 years ago
|
chg: added test for possible seg fault in factorization
|
-
Property mode set to
100644
|
File size:
2.2 KB
|
Line | |
---|
1 | LIB "tst.lib"; |
---|
2 | tst_init(); |
---|
3 | |
---|
4 | proc testfactors (list l, poly f) |
---|
5 | { |
---|
6 | poly g= 1; |
---|
7 | for (int i= 1; i <= size (l[1]); i++) |
---|
8 | { |
---|
9 | g= g*(l[1][i]^l[2][i]); |
---|
10 | } |
---|
11 | g == f; |
---|
12 | l; |
---|
13 | } |
---|
14 | |
---|
15 | //tr. 439 |
---|
16 | ring rQ=0,(u,v),dp; |
---|
17 | poly f = u*(3v+1)^2; |
---|
18 | list l= factorize(f); |
---|
19 | testfactors (l,f); |
---|
20 | |
---|
21 | //tr. 448 |
---|
22 | ring r = (0, ah, bh, sh0), (ch2, ch1, sh1, ch0), lp; |
---|
23 | poly p= ((bh^4)*ch0^4+(11232*ah^2*bh^2*sh0^2-11232*ah^2*bh^2-24960*ah*bh^3*sh0^2+24960*ah*bh^3+12168*bh^4*sh0^2-13736*bh^4)*ch0^2+(51609856*ah^4*sh0^4-103219712*ah^4*sh0^2+51609856*ah^4-179312640*ah^3*bh*sh0^4+358625280*ah^3*bh*sh0^2-179312640*ah^3*bh+243165312*ah^2*bh^2*sh0^4-475066112*ah^2*bh^2*sh0^2+231900800*ah^2*bh^2-151856640*ah*bh^3*sh0^4+284144640*ah*bh^3*sh0^2-132288000*ah*bh^3+37015056*bh^4*sh0^4-64490400*bh^4*sh0^2+28090000*bh^4))*((bh^4)*ch0^4+(11232*ah^2*bh^2*sh0^2-11232*ah^2*bh^2+24960*ah*bh^3*sh0^2-24960*ah*bh^3+12168*bh^4*sh0^2-13736*bh^4)*ch0^2+(51609856*ah^4*sh0^4-103219712*ah^4*sh0^2+51609856*ah^4+179312640*ah^3*bh*sh0^4-358625280*ah^3*bh*sh0^2+179312640*ah^3*bh+243165312*ah^2*bh^2*sh0^4-475066112*ah^2*bh^2*sh0^2+231900800*ah^2*bh^2+151856640*ah*bh^3*sh0^4-284144640*ah*bh^3*sh0^2+132288000*ah*bh^3+37015056*bh^4*sh0^4-64490400*bh^4*sh0^2+28090000*bh^4))*((bh^4)*ch0^4+(11232*ah^2*bh^2*sh0^2-11232*ah^2*bh^2-24320*ah*bh^3*sh0^2+24320*ah*bh^3+11552*bh^4*sh0^2-13120*bh^4)*ch0^2+(51609856*ah^4*sh0^4-103219712*ah^4*sh0^2+51609856*ah^4-174714880*ah^3*bh*sh0^4+349429760*ah^3*bh*sh0^2-174714880*ah^3*bh+230855168*ah^2*bh^2*sh0^4-450445824*ah^2*bh^2*sh0^2+219590656*ah^2*bh^2-140472320*ah*bh^3*sh0^4+261877760*ah*bh^3*sh0^2-121405440*ah*bh^3+33362176*bh^4*sh0^4-57667584*bh^4*sh0^2+24920064*bh^4)); |
---|
24 | list l= factorize (p); |
---|
25 | testfactors (l,p); |
---|
26 | |
---|
27 | kill r; |
---|
28 | |
---|
29 | ring r=0,(a,b,c,d,e,f),dp; |
---|
30 | poly g=(-4*c*d + 8*d^2 + 12*f^2 + 8*a)*(8*b*c - 12*c + 4*f)*(3*a*c + 3*b*c - |
---|
31 | 3*a*d + 33*d^2 - 3*f)*(-4*a*b - 4*b*d + 140*d^2 - 4*d*f - 4*a)*(4*a*b - |
---|
32 | 8*b*d - 12*d^2 - 12*c*f - 8)*(-21*b*c - 3*b*d - 222*d^2 - 6*d*f - |
---|
33 | 39*f)*(16*a*d + 128*b*d - 2)*(8*b*c + 4*c^2 - 4*b*f + 12*f)*(4*a*b + 4*b*c |
---|
34 | - 2*a*f + 6*f^2 - 2*b)*(-48*b^2 + 8*c*d + 144*c)*(-3*b^2 + 4*c^2 - b*d + |
---|
35 | f^2 + 3*a)*(4*c^2 + 4*b*d - 4*d^2 + 12*a*f); |
---|
36 | |
---|
37 | system ("--random",12345643); |
---|
38 | list l=factorize (g); |
---|
39 | testfactors (l, g); |
---|
40 | |
---|
41 | tst_status(1);$ |
---|
Note: See
TracBrowser
for help on using the repository browser.