37 2, 3, 5, 7, 11, 13, 17, 19,
38 23, 29, 31, 37, 41, 43, 47, 53,
39 59, 61, 67, 71, 73, 79, 83, 89,
40 97, 101, 103, 107, 109, 113, 127, 131,
41 137, 139, 149, 151, 157, 163, 167, 173,
42 179, 181, 191, 193, 197, 199, 223, 211,
43 227, 229, 233, 239, 241, 251
62 for ( i = 0; i <=
degree; i++ )
110 sprintf( buffer,
"gftables/%d", q);
114 strcat(gffilename,buffer);
115 inputfile = fopen( gffilename,
"r" );
120 sprintf( buffer,
"gftables/%d", q );
122 inputfile = fopen( buffer,
"r" );
124 sprintf( buffer,
"gftables/%d", q );
126 inputfile =
feFopen( buffer,
"r" );
131 fprintf(stderr,
"can not open GF(q) addition table: %s\n",gffilename);
140 STICKYASSERT( strcmp( buffer,
"@@ factory GF(q) table @@\n" ) == 0,
"illegal table" );
144 STICKYASSERT( success,
"illegal table (reading p and n)" );
145 sscanf( buffer,
"%d %d", &pFile, &nFile );
146 STICKYASSERT( p == pFile && n == nFile,
"illegal table" );
149 bufptr = (
char *)strchr( buffer,
';' ) + 2;
152 sscanf( bufptr,
"%d", °ree );
153 bufptr = (
char *)strchr( bufptr,
' ' ) + 1;
154 int *
mipo =
new int[degree + 1];
155 for ( i = 0; i <=
degree; i++ )
157 sscanf( bufptr,
"%d", mipo + i );
158 bufptr = (
char *)strchr( bufptr,
' ' ) + 1;
172 STICKYASSERT( strlen( buffer ) - 1 == (
size_t)digs * 30,
"illegal table" );
175 while ( i <
gf_q && k < 30 )
192 (void)fclose( inputfile );
206 while ( a < gf_maxtable && i > 0 )
unsigned short * gf_table
void set_gftable_dir(char *d)
void gf_setcharacteristic(int p, int n, char name)
factory's class for variables
static bool gf_valid_combination(int p, int n)
utility functions to access GF Tables
static void gf_get_table(int p, int n)
static CanonicalForm intVec2CF(int degree, int *coeffs, int level)
helper functions for conversion to and from Singular
Operations in GF, where GF is a finite field of size less than 2^16 represented by a root of Conway p...
int gf_tab_numdigits62(int q)
The main handler for Singular numbers which are suitable for Singular polynomials.
void * malloc(size_t size)
static unsigned short gf_primes[]
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
char name(const Variable &v)
#define STICKYASSERT(expression, message)
int ipower(int b, int m)
int ipower ( int b, int m )
#define ASSERT(expression, message)
int convertback62(char *p, int n)
static char * gftable_dir
int gf_power(int a, int n)