62 2, 3, 5, 7, 11, 13, 17, 19,
63 23, 29, 31, 37, 41, 43, 47, 53,
64 59, 61, 67, 71, 73, 79, 83, 89,
65 97, 101, 103, 107, 109, 113, 127, 131,
66 137, 139, 149, 151, 157, 163, 167, 173,
67 179, 181, 191, 193, 197, 199, 211, 223,
68 227, 229, 233, 239, 241, 251
80 if (F.
getFirst().factor().inCoeffDomain())
98 while ( e <= q && !
prod.isOne() ) {
131 cerr <<
"."; cerr.flush();
134 cerr <<
"*"; cerr.flush();
147 else if ( n == d || n == 0 ) {
150 for (
i = 1;
i <
p;
i++ )
155 for (
i = 0;
i <
p;
i++ )
203 fname <<
"gftables/" << q <<
'\0';
204 char * fn = fname.str();
206 outfile.open( fn, ios::out );
207 STICKYASSERT1( outfile,
"can not open GF(q) table %s for writing", fn );
210 cerr <<
"mipo = " <<
mipo <<
": ";
211 cerr <<
"generating multiplicative group ... ";
219 for (
i = 1;
i < q;
i++ )
222 cerr <<
"generating addition table ... ";
229 for (
i = 0;
i < q;
i++ ) {
232 while (
j < q &&
T[
j] !=
f )
j++;
236 cerr <<
"writing table ... ";
239 outfile <<
"@@ factory GF(q) table @@" << endl;
240 outfile <<
p <<
" " << d <<
" " <<
mipo <<
"; ";
249 outfile <<
" " << MiPo.
coeff();
256 char * outstr =
new char[30*
m+1];
261 char * sptr = outstr;
262 while (
i < q &&
k < 30 ) {
272 outfile << outstr << endl;
297 int ntmp,ptmp,pos1,pos2,ii;
299 string LineSe,coef,PC;
301 ifstream in(
"./ConwayList.txt");
305 while((flag) && (err != LineSe))
311 pos1 = LineSe.find(
",", 0 );
312 pos2 = LineSe.find(
",", pos1 + 1);
313 ps = LineSe.substr(0, pos1);
314 ns = LineSe.substr(pos1 + 1,pos2 - pos1);
315 ptmp = atoi(ps.c_str());
316 ntmp = atoi(ns.c_str());
318 if((ntmp==n)&&(ptmp==
p)){flag=0;}
330 pos2 = LineSe.find(
",", pos1 + 1);
331 conway = atoi(LineSe.substr(pos1, pos2 - pos1).c_str());
333 pos2 = LineSe.find(
",", pos1 + 1);
335 for(ii = 2; ii <= n; ii++)
337 coef = LineSe.substr(pos1 + 1,pos2 - pos1 - 1);
340 conway = conway + atoi(coef.c_str()) *
power(
x, ii - 1) ;
343 pos2 = LineSe.find(
",", pos1+1);
346 pos2 = LineSe.find(
",END", pos1 + 1);
347 coef = LineSe.substr(pos1 + 1,pos2 - pos1 - 1);
348 conway = conway + atoi(coef.c_str()) *
power(
x, ii - 1) ;
368 ASSERT(
f != 0,
"no generator found" );
declarations of higher level algorithms.
CFFList FACTORY_PUBLIC factorize(const CanonicalForm &f, bool issqrfree=false)
factorization over or
#define STICKYASSERT1(expression, message, parameter1)
#define ASSERT(expression, message)
Iterators for CanonicalForm's.
class to iterate through CanonicalForm's
CF_NO_INLINE int exp() const
get the current exponent
CF_NO_INLINE CanonicalForm coeff() const
get the current coefficient
CF_NO_INLINE int hasTerms() const
check if iterator has reached the end of CanonicalForm
factory's class for variables
const int maxtable
constants.
int gf_tab_numdigits62(int q)
bool isIrreducible(const CanonicalForm &f)
bool isIrreducible ( const CanonicalForm & f )
CanonicalForm findGen(int d, int q)
CanonicalForm findGen ( int d, int q )
bool findGenRec(int d, int n, int q, const CanonicalForm &m, const Variable &x, CanonicalForm &result)
bool findGenRec ( int d, int n, int q, const CanonicalForm & m, const Variable & x,...
void printTable(int d, int q, CanonicalForm mipo)
void printTable ( int d, int q, CanonicalForm mipo )
STATIC_VAR unsigned short primes[]
primes, primes_len: used to step through possible extensions
const int primes_len
primes, primes_len: used to step through possible extensions
static CanonicalForm findGenNew(int n, int q)
The new function for getting the minimal polynomials.
void convert62(int i, int n, char *p)
utility functions to access GF Tables
gmp_float exp(const gmp_float &a)