1 | // |
---|
2 | LIB "tst.lib"; |
---|
3 | LIB "ffmodstd.lib"; |
---|
4 | tst_init(); |
---|
5 | |
---|
6 | proc tst_test_ffmodstd(ideal I) |
---|
7 | { |
---|
8 | ideal Jtst = ffmodStd(I); |
---|
9 | Jtst; |
---|
10 | } |
---|
11 | ring R = (0,t(1..4)),(x(1..6)),dp; |
---|
12 | poly f1 = (96*t(1)+59)/(13*t(1)^2)*x(3)*x(4)^2*x(6) |
---|
13 | +10/(23*t(1)^3+4*t(1))*x(3)*x(5)^2*x(6); |
---|
14 | poly f2 = (1165*t(1)^2)/(252*t(2)^2)*x(1)*x(2)^3 |
---|
15 | +(89*t(2)^2)/(82*t(1)^3)*x(1)*x(2); |
---|
16 | poly f3 = (10*t(2)^3)/(33*t(1)^3)*x(1)^3 |
---|
17 | +(5*t(2))/(41*t(3))*x(1); |
---|
18 | poly f4 = (3977*t(1)^3+533*t(1)^2*t(2)+2173*t(1)*t(2)^2 |
---|
19 | +806*t(1)*t(2)+3286*t(2)^2)/(3977*t(1)^2 |
---|
20 | +6014*t(1))*x(1)^3+(22*t(1)*t(2)^2)/(5*t(1)^2+ |
---|
21 | 61*t(2)^2)*x(2)^3+(42*t(1)^3 |
---|
22 | +65*t(2)^3)/(65*t(1)^2*t(2)+47*t(1))*x(1)^2; |
---|
23 | poly f5 = (3741*t(1)^4+94)/43*x(2)*x(3)^2 |
---|
24 | +(8*t(1)^2)/21*x(3)*x(6)^2+(54*t(1)^2)*x(3)^2; |
---|
25 | poly f6 = (96*t(1)^2*t(2)^2+41*t(1)*t(2)^2*t(4))/(95*t(1)^2*t(3)^2 |
---|
26 | +32*t(2)^3*t(4))*x(1)*x(2)*x(3)*x(5) |
---|
27 | +(31*t(1)*t(2)*t(3)^2+11*t(2)^2*t(3)*t(4))/(39*t(1)^4+ |
---|
28 | 51*t(1)^3*t(2))*x(3)^3*x(5)+(21*t(1)*t(4) |
---|
29 | +90*t(3)^2)/(37*t(1)*t(3)+62*t(2)^2)*x(3)*x(4)*x(5)^2 |
---|
30 | +(63*t(1)^2*t(2)*t(3)+27*t(2)^4)/(16*t(1)^3*t(3) |
---|
31 | +67*t(2)^4)*x(2)*x(3)^2; |
---|
32 | poly f7 = (726*t(1)^4+205*t(1)*t(2)^4)/(110*t(2)^3)*x(1)^2 |
---|
33 | +(61*t(2)^2)/(36*t(1)^2)*x(1)*x(3); |
---|
34 | ideal I = f1,f2,f3,f4,f5,f6,f7; |
---|
35 | |
---|
36 | tst_test_ffmodstd(I); |
---|
37 | kill R; |
---|
38 | ring Ra=(0,a),(x,y,z),dp; |
---|
39 | ideal I = (a^2+2)*x^2*y+a*y*z^2, x*z^2+(a+1)*x^2-a*y^2; |
---|
40 | tst_test_ffmodstd(I); |
---|
41 | kill R; |
---|
42 | ring R=(0,a,b),(x,y,z),dp; |
---|
43 | ideal I = x^2*y^3*z+2*a*x*y*z^2+7*y^3, |
---|
44 | x^2*y^4*z+(a-7b)*x^2*y*z^2-x*y^2*z^2+2*x^2*y*z-12*x+by, |
---|
45 | (a2+b-2)*y^5*z+(a+5b)*x^2*y^2*z-b*x*y^3*z-x*y^3+y^4+2*a2*y^2*z, |
---|
46 | a*x^2*y^2*z-x*y^3*z+3a*x*y*z^3+(-a+4)*y^3*z^2+4*z^2-bx; |
---|
47 | tst_test_ffmodstd(I); |
---|
48 | kill R; |
---|
49 | proc tst_test_polyInterpolation(list l, list m, list #) |
---|
50 | { |
---|
51 | def F = polyInterpolation(l,m,#); |
---|
52 | F; |
---|
53 | } |
---|
54 | |
---|
55 | ring R = 0,x,dp; |
---|
56 | list l, m; |
---|
57 | int i,j; |
---|
58 | j=5; |
---|
59 | poly g = x12+6x10+15x8+21x6+20x4+18x2+9; |
---|
60 | g = g**3 + g**2; |
---|
61 | for(i=1;i<=deg(g)+1;i++) |
---|
62 | { |
---|
63 | l[i] = number(subst(g, var(1), j)); |
---|
64 | m[i] = j; |
---|
65 | j = j+2; |
---|
66 | } |
---|
67 | list G = m,l; |
---|
68 | tst_test_polyInterpolation(G[1],G[2]); |
---|
69 | kill R; |
---|
70 | |
---|
71 | proc tst_test_fareypoly(poly g, poly f) |
---|
72 | { |
---|
73 | def F = fareypoly(g,f); |
---|
74 | F; |
---|
75 | } |
---|
76 | |
---|
77 | ring R = 0,x,dp; |
---|
78 | poly g = x+2; |
---|
79 | poly f = x+5; |
---|
80 | poly f1 = g**2*(2*g+1); |
---|
81 | poly f2 = f**3*(5*f+3); |
---|
82 | poly g1 = f1**2*(2*f1+1); |
---|
83 | poly g2 = f2**3*(5*f2+3); |
---|
84 | |
---|
85 | poly V = (x+1)**40; |
---|
86 | poly B = extgcd(g2,V)[2]; |
---|
87 | poly D = B*g1; |
---|
88 | D = reduce(D, std(V)); |
---|
89 | tst_test_fareypoly(D, V); |
---|
90 | kill R; |
---|
91 | |
---|
92 | proc tst_test_BerlekampMassey(list L, int i, list #) |
---|
93 | { |
---|
94 | def F = BerlekampMassey(L,i, #); |
---|
95 | F; |
---|
96 | } |
---|
97 | |
---|
98 | proc tst_test_sparseInterpolation(poly Br, list La, list lpr, int n, list #) |
---|
99 | { |
---|
100 | def F = sparseInterpolation(Br, La, lpr, n, #); |
---|
101 | F; |
---|
102 | } |
---|
103 | |
---|
104 | ring R = 0, (x,y,z), dp; |
---|
105 | poly f = xy + yz + x3 + xz + y2 + z2; |
---|
106 | f = f*(5*f+3); |
---|
107 | list lpr = 3,5,7; |
---|
108 | list La; |
---|
109 | int i; |
---|
110 | int sz = size(f); |
---|
111 | for(i=0;i<=2*sz;i++) |
---|
112 | { |
---|
113 | La[i+1] = number(subst(f,x,bigint(lpr[1])^i,y,bigint(lpr[2])^i, z, bigint(lpr[3])^i)); |
---|
114 | } |
---|
115 | |
---|
116 | tst_test_BerlekampMassey(La,1); |
---|
117 | |
---|
118 | poly Br = x24-15302x23+108153538x22-469822785006x21+1407508896239640x20-3091943125563504810x19 |
---|
119 | +5168112767194393020422x18-6729723784556809568734354x17+6931464551637490752291339929x16 |
---|
120 | -5699848400675330822165442096828x15+3760033336187084132321077964447220x14 |
---|
121 | -1991661667180376045309477779945538700x13+844842071446573758035869063546129683000x12 |
---|
122 | -285178513120947332205887203363460453332500x11 |
---|
123 | +75811568321033868929115724018317018412987500x10 |
---|
124 | -15635458692849224898228692620395578209262062500x9 |
---|
125 | +2451053560315230678380665790179304182681733671875x8 |
---|
126 | -284379998009191272424401092954106259377042386718750x7 |
---|
127 | +23641079761297766943853576941070123797406993066406250x6 |
---|
128 | -1360130446827557647250743113079186076430133454589843750x5 |
---|
129 | +52556801545000906318441420070679293954946411621093750000x4 |
---|
130 | -1321635241786467719242433527312853738727799653625488281250x3 |
---|
131 | +20572945477752454884036085702463299663396845817565917968750x2 |
---|
132 | -178934876180957551616320723528162371797337555885314941406250x |
---|
133 | +661370587133842412643287880417356305385582149028778076171875; |
---|
134 | |
---|
135 | tst_test_sparseInterpolation(Br, La, lpr, 0, 0); |
---|
136 | tst_status(1);$ |
---|