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
95 sprintf( buffer,
"gftables/%d", q);
99 strcat(gffilename,buffer);
100 inputfile = fopen( gffilename,
"r" );
104 sprintf( buffer,
"gftables/%d", q );
107 inputfile = fopen( buffer,
"r" );
109 inputfile =
feFopen( buffer,
"r" );
114 fprintf(stderr,
"can not open GF(q) addition table: %s\n",gffilename);
123 STICKYASSERT( strcmp( buffer,
"@@ factory GF(q) table @@\n" ) == 0,
"illegal table" );
127 STICKYASSERT( success,
"illegal table (reading p and n)" );
128 sscanf( buffer,
"%d %d", &pFile, &nFile );
132 bufptr = (
char *)strchr( buffer,
';' ) + 2;
135 sscanf( bufptr,
"%d", &
degree );
136 bufptr = (
char *)strchr( bufptr,
' ' ) + 1;
140 sscanf( bufptr,
"%d",
mipo +
i );
141 bufptr = (
char *)strchr( bufptr,
' ' ) + 1;
155 STICKYASSERT( strlen( buffer ) - 1 == (
size_t)digs * 30,
"illegal table" );
158 while (
i <
gf_q &&
k < 30 )
175 (void)fclose( inputfile );
189 while ( a < gf_maxtable && i > 0 )
#define STICKYASSERT(expression, message)
#define ASSERT(expression, message)
int ipower(int b, int m)
int ipower ( int b, int m )
factory's class for variables
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
int convertback62(char *p, int n)
int gf_tab_numdigits62(int q)
utility functions to access GF Tables
void gf_setcharacteristic(int p, int n, char name)
STATIC_VAR char * gftable_dir
VAR unsigned short * gf_table
static CanonicalForm intVec2CF(int degree, int *coeffs, int level)
STATIC_VAR unsigned short gf_primes[]
static bool gf_valid_combination(int p, int n)
void set_gftable_dir(char *d)
static void gf_get_table(int p, int n)
INST_VAR CanonicalForm gf_mipo
Operations in GF, where GF is a finite field of size less than 2^16 represented by a root of Conway p...
int gf_power(int a, int n)
The main handler for Singular numbers which are suitable for Singular polynomials.
void * malloc(size_t size)
helper functions for conversion to and from Singular
char name(const Variable &v)