Macaulay2 Engine
Loading...
Searching...
No Matches

◆ main()

int main ( int argc,
char ** argv )

Definition at line 149 of file GivaroTest.cpp.

150{
151 // modulo 13 over 16 bits
152 Modular<int16_t> C13(13);
153 TestField(C13);
154 // modulo 13 over 32 bits
155 Modular<int32_t> Z13(13);
156 TestField(Z13);
157 // modulo 13 over unsigned 32 bits
158 Modular<uint32_t> U13(13);
159 TestField(U13);
160#ifdef __USE_Givaro_SIXTYFOUR__
161 // modulo 13 over 64 bits
162 Modular<int64_t> LL13(13U);
163 TestField(LL13);
164#endif
165 // modulo 13 fully tabulated
166 Modular<Log16> L13(13);
167 TestField(L13);
168 // modulo 13 over 32 bits with Montgomery reduction
169 Montgomery<int32_t> M13(13);
170 TestField(M13);
171 Montgomery<int32_t> M3(39989);
172 TestField(M3);
173 // modulo 13 with primitive root representation
174 GFqDom<int> GF13(13);
175 TestField(GF13);
176 // modulo 13 over arbitrary size
177 Modular<Integer> IntZ13(13);
178 TestField(IntZ13);
179 // Zech log finite field with 5^4 elements
180 GFqDom<int> GF625(5, 4);
181 TestField(GF625);
182#if 0 // Possibly related: https://github.com/cr-marcstevens/m4gb/issues/8
183 // Zech log finite field with 256 elements
184 // and prescribed irreducible polynomial
185 std::vector<GFqDom<unsigned long long>::Residu_t> Irred(9);
186 Irred[0] = 1;
187 Irred[1] = 1;
188 Irred[2] = 0;
189 Irred[3] = 1;
190 Irred[4] = 1;
191 Irred[5] = 0;
192 Irred[6] = 0;
193 Irred[7] = 0;
194 Irred[8] = 1;
195 GFqDom<unsigned long long> F256(2, 8, Irred);
196 TestField(F256);
197#endif
198 // Zech log finite field with 3^4 elements
199 // Using the Q-adic Transform
200 GFqExt<int32_t> GF81(3, 4);
201 TestField(GF81);
202 // Zech log finite field with 2Mb tables
203 struct rusage tmp1;
204 getrusage(RUSAGE_SELF, &tmp1);
205 // user time
206 double tim = (double)tmp1.ru_utime.tv_sec +
207 ((double)tmp1.ru_utime.tv_usec) / (1000000.0);
208 ;
209 getrusage(RUSAGE_SELF, &tmp1);
210 tim = (double)tmp1.ru_utime.tv_sec +
211 ((double)tmp1.ru_utime.tv_usec) / (1000000.0) - tim;
212 std::cerr << "Initialization took " << tim
213 << " cpu seconds and : " << std::endl;
214 std::cerr << tmp1.ru_maxrss << " maximum resident set size" << std::endl
215 << tmp1.ru_ixrss << " integral shared memory size" << std::endl
216 << tmp1.ru_idrss << " integral unshared data size" << std::endl
217 << tmp1.ru_isrss << " integral unshared stack size" << std::endl
218 << tmp1.ru_minflt << " page reclaims" << std::endl
219 << tmp1.ru_majflt << " page faults" << std::endl
220 << tmp1.ru_nswap << " swaps" << std::endl
221 << tmp1.ru_inblock << " block input operations" << std::endl
222 << tmp1.ru_oublock << " block output operations" << std::endl;
223 return 0;
224}
void TestField(const Field &F)

References TestField().