31 #ifndef p_Procs_Static 63 #define DoSetProc(what, field, length, ord) \ 64 GenerateProc(#what, what##_Proc, field, length, ord) 73 const char*
macros_field[] = {
"n_Copy",
"n_Delete",
"n_Mult",
"n_Add",
"n_Sub",
"n_IsZero",
"n_Equal" ,
"n_Neg",
"n_InpMult",
"n_InpAdd",
NULL};
76 {
"p_MemCopy",
"p_MemAdd",
"p_MemSum",
"p_MemDiff",
NULL};
90 char* s_full_proc_name = (
char*)
malloc(200);
92 sprintf(s_full_proc_name,
"%s__%s_%s_%s", s_what, s_field, s_length, s_ord);
96 printf(
"\n// definition of %s\n", s_full_proc_name);
97 #ifndef p_Procs_Static 101 printf(
"#ifdef p_Procs_Kernel\n");
106 if (strcmp(module,
"FieldGeneral") == 0)
108 else if (strcmp(module,
"FieldIndep") == 0)
110 else if (strcmp(module,
"FieldZp") == 0)
112 else if (strcmp(module,
"FieldQ") == 0)
115 else if (strcmp(module,
"RingGeneral") == 0)
121 printf(
"#ifdef p_Procs_%s\n", module);
125 if (strcmp(s_field,
"RingGeneral") == 0)
126 printf(
"#define HAVE_ZERODIVISORS\n");
131 printf(
"#undef %s__T\n#define %s__T\t%s_%s\n",
138 printf(
"#undef %s__T\n#define %s__T\t%s_%s\n",
145 printf(
"#undef %s__T\n#define %s__T\t%s_%s_%s\n",
151 printf(
"#undef DECLARE_LENGTH\n");
152 printf(
"#undef p_MemAddAdjust__T\n");
155 printf(
"#define DECLARE_LENGTH(what) do {} while (0)\n");
156 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
160 printf(
"#define DECLARE_LENGTH(what) what\n");
162 printf(
"#define p_MemAddAdjust__T(p, r) p_MemAdd_NegWeightAdjust(p, r)\n");
164 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
168 printf(
"#undef DECLARE_ORDSGN\n");
170 printf(
"#define DECLARE_ORDSGN(what) do {} while (0)\n");
172 printf(
"#define DECLARE_ORDSGN(what) what\n");
176 printf(
"#undef DECLARE_LENGTH_2\n");
177 printf(
"#undef p_MemCmp_Bitmask_2\n");
180 printf(
"#define DECLARE_LENGTH_2(what) do {} while (0)\n");
184 printf(
"#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthZero\n");
188 printf(
"#define DECLARE_LENGTH_2(what) what \n");
189 printf(
"#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthGeneral\n");
193 printf(
"#undef p_MemAddAdjust__T\n");
194 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
197 printf(
"#undef %s__T\n#define %s__T %s\n", s_what, s_what, s_full_proc_name);
198 printf(
"#include \"polys/templates/%s__T.cc\"\n", s_what);
199 printf(
"#undef %s\n", s_what);
201 if (strcmp(s_field,
"RingGeneral") == 0)
202 printf(
"#undef HAVE_ZERODIVISORS\n");
204 #ifndef p_Procs_Static 205 printf(
"#endif // p_Procs_[Kernel|Field*]\n");
212 AddProc(s_what, proc, field, length, ord);
223 printf(
"/* -*-c++-*- */\n");
224 printf(
"/***************************************************************\n");
225 printf(
" * This file was generated automatically by p_ProcsGenerate.cc: DO NOT EDIT\n");
227 printf(
" * This file provides the needed implementation of p_Procs for\n");
235 printf(
" * See the end for a summary.\n");
236 printf(
" *******************************************************************/\n");
260 #ifdef p_Procs_Static 263 "/***************************************************************\n" 264 "Names of procs for RDEBUG */\n" 275 printf(
"\n\"%s\",", s);
283 printf(
"\n #endif // RDEBUG\n\n" 284 "/***************************************************************/\n" 285 "/* Tables for lookup of procedures: */\n");
304 printf(
"\n/***************************************************************");
305 printf(
"* Summary:\n");
314 #ifndef p_Procs_Static 325 printf(
"*******************************************************************/\n");
int IsKernelProc(p_Proc proc, p_Field field, p_Length length, p_Ord ord)
const CanonicalForm int s
int AlreadyHaveProc(p_Proc proc, p_Field field, p_Length length, p_Ord ord)
const char * macros_length_ord[]
#define SetProcs(field, length, ord)
void AddProc(const char *s_what, p_Proc proc, p_Field field, p_Length length, p_Ord ord)
static const char * p_OrdEnum_2_String(p_Ord ord)
void * malloc(size_t size)
char *** generated_p_procs
static int IsValidSpec(p_Field field, p_Length length, p_Ord ord)
static int index(p_Length length, p_Ord ord)
static int p_ProcDependsOn_Ord(p_Proc proc)
static const char * p_LengthEnum_2_String(p_Length length)
#define HAVE_FAST_ZERO_ORD
static const char * p_ProcEnum_2_String(p_Proc proc)
static const char * p_ProcField_2_Module(p_Proc proc, p_Field field)
const char * macros_field[]
const char * macros_length[]
void GenerateProc(const char *s_what, p_Proc proc, p_Field field, p_Length length, p_Ord ord)
static int p_ProcDependsOn_Length(p_Proc proc)
static const char * p_FieldEnum_2_String(p_Field field)
#define HAVE_FAST_P_PROCS