26 #include <strstream.h>
61 2, 3, 5, 7, 11, 13, 17, 19,
62 23, 29, 31, 37, 41, 43, 47, 53,
63 59, 61, 67, 71, 73, 79, 83, 89,
64 97, 101, 103, 107, 109, 113, 127, 131,
65 137, 139, 149, 151, 157, 163, 167, 173,
66 179, 181, 191, 193, 197, 199, 211, 223,
67 227, 229, 233, 239, 241, 251
79 if (F.
getFirst().factor().inCoeffDomain())
97 while ( e <= q && !
prod.isOne() ) {
130 cerr <<
"."; cerr.flush();
133 cerr <<
"*"; cerr.flush();
146 else if ( n == d || n == 0 ) {
149 for (
i = 1;
i <
p;
i++ )
154 for (
i = 0;
i <
p;
i++ )
202 fname <<
"gftables/" << q <<
'\0';
203 char * fn = fname.str();
205 outfile.open( fn, ios::out );
206 STICKYASSERT1( outfile,
"can not open GF(q) table %s for writing", fn );
209 cerr <<
"mipo = " <<
mipo <<
": ";
210 cerr <<
"generating multiplicative group ... ";
218 for (
i = 1;
i < q;
i++ )
221 cerr <<
"generating addition table ... ";
228 for (
i = 0;
i < q;
i++ ) {
231 while (
j < q &&
T[
j] !=
f )
j++;
235 cerr <<
"writing table ... ";
238 outfile <<
"@@ factory GF(q) table @@" << endl;
239 outfile <<
p <<
" " << d <<
" " <<
mipo <<
"; ";
248 outfile <<
" " << MiPo.
coeff();
255 char * outstr =
new char[30*
m+1];
260 char * sptr = outstr;
261 while (
i < q &&
k < 30 ) {
271 outfile << outstr << endl;
296 int ntmp,ptmp,pos1,pos2,ii;
298 string LineSe,coef,PC;
300 ifstream in(
"./ConwayList.txt");
304 while((flag) && (err != LineSe))
310 pos1 = LineSe.find(
",", 0 );
311 pos2 = LineSe.find(
",", pos1 + 1);
312 ps = LineSe.substr(0, pos1);
313 ns = LineSe.substr(pos1 + 1,pos2 - pos1);
314 ptmp = atoi(ps.c_str());
315 ntmp = atoi(ns.c_str());
317 if((ntmp==n)&&(ptmp==
p)){flag=0;}
329 pos2 = LineSe.find(
",", pos1 + 1);
330 conway = atoi(LineSe.substr(pos1, pos2 - pos1).c_str());
332 pos2 = LineSe.find(
",", pos1 + 1);
334 for(ii = 2; ii <= n; ii++)
336 coef = LineSe.substr(pos1 + 1,pos2 - pos1 - 1);
339 conway = conway + atoi(coef.c_str()) *
power(
x, ii - 1) ;
342 pos2 = LineSe.find(
",", pos1+1);
345 pos2 = LineSe.find(
",END", pos1 + 1);
346 coef = LineSe.substr(pos1 + 1,pos2 - pos1 - 1);
347 conway = conway + atoi(coef.c_str()) *
power(
x, ii - 1) ;
367 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
int gf_tab_numdigits62(int q)
const int maxtable
constants.
int exponent(const CanonicalForm &f, int q)
int exponent ( const CanonicalForm & f, 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)