source: git/Tst/Short/ffmodstd_s.tst @ fdda546

spielwiese
Last change on this file since fdda546 was 1adfacf, checked in by Andreas Steenpass <steenpass@…>, 6 years ago
chg: update ffmodstd.lib and tests for ffmodstd
  • Property mode set to 100644
File size: 5.1 KB
Line 
1//
2LIB "tst.lib";
3LIB "ffmodstd.lib";
4tst_init();
5
6proc tst_test_ffmodstd(ideal I)
7{
8   ideal Jtst = ffmodStd(I);
9   Jtst;
10}
11ring R = (0,t(1..4)),(x(1..6)),dp;
12poly 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);
14poly 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);
16poly f3 = (10*t(2)^3)/(33*t(1)^3)*x(1)^3
17          +(5*t(2))/(41*t(3))*x(1);
18poly 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;
23poly 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;
25poly 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;
32poly 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);
34ideal I = f1,f2,f3,f4,f5,f6,f7;
35
36tst_test_ffmodstd(I);
37kill R;
38ring 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;
40tst_test_ffmodstd(I);
41kill R;
42ring R=(0,a,b),(x,y,z),dp;
43ideal 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;
47tst_test_ffmodstd(I);
48kill R;
49proc tst_test_polyInterpolation(list l, list m, list #)
50{
51   def F = polyInterpolation(l,m,#);
52   F;
53}
54
55ring R = 0,x,dp;
56list l, m;
57int i,j;
58j=5;
59poly g = x12+6x10+15x8+21x6+20x4+18x2+9;
60g = g**3 + g**2;
61for(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}
67list G = m,l;
68tst_test_polyInterpolation(G[1],G[2]);
69kill R;
70
71proc tst_test_fareypoly(poly g, poly f)
72{
73   def F = fareypoly(g,f);
74   F;
75}
76
77ring R = 0,x,dp;
78poly g = x+2;
79poly f = x+5;
80poly f1 = g**2*(2*g+1);
81poly f2 = f**3*(5*f+3);
82poly g1 = f1**2*(2*f1+1);
83poly g2 = f2**3*(5*f2+3);
84
85poly V = (x+1)**40;
86poly B = extgcd(g2,V)[2];
87poly D = B*g1;
88D = reduce(D, std(V));
89tst_test_fareypoly(D, V);
90kill R;
91
92proc tst_test_modrationalInterpolation(list D, list E, int vr)
93{
94   def F = modrationalInterpolation(D,E,vr);
95   F;
96}
97
98ring R = 0,x,dp;
99poly r = 16/3125*x^9+312/3125*x^8+108/125*x^7+13614/3125*x^6+44092/3125*x^5+95153/3125*x^4
100         +136872/3125*x^3+126584/3125*x^2+13664/625*x+656/125;
101poly t = x^16+412/5*x^15+79554/25*x^14+9556508/125*x^13+799356506/625*x^12
102         +1974684999/125*x^11   +93143851156/625*x^10+3422950835956/3125*x^9
103         +3961758888729/625*x^8+3622442847166/125*x^7+2607940162054/25*x^6
104         +1462807349256/5*x^5+626672547956*x^4+991121483395*x^3+1091504397900*x^2
105         +747836138000*x+240141160000;
106list D, E;
107int k1,  k2;
108k2 = 5;
109for(k1 = 1; k1 <= deg(r) + deg(t) +3; k1++)
110{
111     k2 = random(k2 +1, k2+5);
112     D[k1] = k2;
113}
114for (k1 = 1; k1 <= size(D); k1++)
115{
116    E[k1] = number(subst(r, x, D[k1]))/number(subst(t, x, D[k1]));
117}
118tst_test_modrationalInterpolation(D, E, 1);
119kill R;
120
121proc tst_test_BerlekampMassey(list L, int i, list #)
122{
123   def F = BerlekampMassey(L,i, #);
124   F;
125}
126
127proc tst_test_modberlekampMassey(list L)
128{
129   def F = modberlekampMassey(L);
130   F;
131}
132
133proc tst_test_sparseInterpolation(poly Br, list La, list lpr, int n, list #)
134{
135   def F = sparseInterpolation(Br, La, lpr, n, #);
136   F;
137}
138
139ring R = 0, (x,y,z), dp;
140poly f = xy + yz + x3 + xz + y2 + z2;
141f = f*(5*f+3);
142list lpr = 3,5,7;
143list La;
144int i;
145int sz = size(f);
146for(i=0;i<=2*sz;i++)
147{
148   La[i+1] = number(subst(f,x,bigint(lpr[1])^i,y,bigint(lpr[2])^i, z, bigint(lpr[3])^i));
149}
150
151tst_test_BerlekampMassey(La,1);
152tst_test_modberlekampMassey(La);
153
154
155poly Br = x24-15302x23+108153538x22-469822785006x21+1407508896239640x20-3091943125563504810x19
156          +5168112767194393020422x18-6729723784556809568734354x17+6931464551637490752291339929x16
157          -5699848400675330822165442096828x15+3760033336187084132321077964447220x14
158          -1991661667180376045309477779945538700x13+844842071446573758035869063546129683000x12
159          -285178513120947332205887203363460453332500x11
160          +75811568321033868929115724018317018412987500x10
161          -15635458692849224898228692620395578209262062500x9
162          +2451053560315230678380665790179304182681733671875x8
163          -284379998009191272424401092954106259377042386718750x7
164          +23641079761297766943853576941070123797406993066406250x6
165          -1360130446827557647250743113079186076430133454589843750x5
166          +52556801545000906318441420070679293954946411621093750000x4
167          -1321635241786467719242433527312853738727799653625488281250x3
168          +20572945477752454884036085702463299663396845817565917968750x2
169          -178934876180957551616320723528162371797337555885314941406250x
170          +661370587133842412643287880417356305385582149028778076171875;
171
172tst_test_sparseInterpolation(Br, La, lpr, 0, 0);
173tst_status(1);$
Note: See TracBrowser for help on using the repository browser.