64#define DoSetProc(what, field, length, ord) \
65 GenerateProc(#what, what##_Proc, field, length, ord)
74const char*
macros_field[] = {
"n_Copy",
"n_Delete",
"n_Mult",
"n_Add",
"n_Sub",
"n_IsZero",
"n_Equal" ,
"n_Neg",
"n_InpMult",
"n_InpAdd",
NULL};
77{
"p_MemCopy",
"p_MemAdd",
"p_MemSum",
"p_MemDiff",
NULL};
91 char* s_full_proc_name = (
char*)
malloc(200);
93 sprintf(s_full_proc_name,
"%s__%s_%s_%s", s_what, s_field, s_length, s_ord);
97 printf(
"\n// definition of %s\n", s_full_proc_name);
102 printf(
"#ifdef p_Procs_Kernel\n");
107 if (strcmp(module,
"FieldGeneral") == 0)
109 else if (strcmp(module,
"FieldIndep") == 0)
111 else if (strcmp(module,
"FieldZp") == 0)
113 else if (strcmp(module,
"FieldQ") == 0)
120 printf(
"#ifdef p_Procs_%s\n", module);
123 if (strcmp(s_field,
"RingGeneral") == 0)
125 printf(
"#define HAVE_RINGS\n");
126 printf(
"#define HAVE_ZERODIVISORS\n");
130 printf(
"#undef HAVE_RINGS\n");
131 printf(
"#undef HAVE_ZERODIVISORS\n");
136 printf(
"#undef %s__T\n#define %s__T\t%s_%s\n",
143 printf(
"#undef %s__T\n#define %s__T\t%s_%s\n",
150 printf(
"#undef %s__T\n#define %s__T\t%s_%s_%s\n",
156 printf(
"#undef DECLARE_LENGTH\n");
157 printf(
"#undef p_MemAddAdjust__T\n");
160 printf(
"#define DECLARE_LENGTH(what) do {} while (0)\n");
161 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
165 printf(
"#define DECLARE_LENGTH(what) what\n");
167 printf(
"#define p_MemAddAdjust__T(p, r) p_MemAdd_NegWeightAdjust(p, r)\n");
169 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
173 printf(
"#undef DECLARE_ORDSGN\n");
175 printf(
"#define DECLARE_ORDSGN(what) do {} while (0)\n");
177 printf(
"#define DECLARE_ORDSGN(what) what\n");
181 printf(
"#undef DECLARE_LENGTH_2\n");
182 printf(
"#undef p_MemCmp_Bitmask_2\n");
185 printf(
"#define DECLARE_LENGTH_2(what) do {} while (0)\n");
189 printf(
"#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthZero\n");
193 printf(
"#define DECLARE_LENGTH_2(what) what \n");
194 printf(
"#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthGeneral\n");
196 printf(
"#undef p_MemAddAdjust__T\n");
197 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
200 printf(
"#undef %s__T\n#define %s__T %s\n", s_what, s_what, s_full_proc_name);
201 printf(
"#include \"polys/templates/%s__T.cc\"\n", s_what);
202 printf(
"#undef %s\n", s_what);
203 if (strcmp(s_field,
"RingGeneral") == 0)
205 printf(
"#undef HAVE_RINGS\n");
206 printf(
"#undef HAVE_ZERODIVISORS\n");
208#ifndef p_Procs_Static
209 printf(
"#endif // p_Procs_[Kernel|Field*]\n");
227 printf(
"/* -*-c++-*- */\n");
228 printf(
"/***************************************************************\n");
229 printf(
" * This file was generated automatically by p_ProcsGenerate.cc: DO NOT EDIT\n");
231 printf(
" * This file provides the needed implementation of p_Procs for\n");
239 printf(
" * See the end for a summary.\n");
240 printf(
" *******************************************************************/\n");
267 "/***************************************************************\n"
268 "Names of procs for RDEBUG */\n"
279 printf(
"\n\"%s\",",
s);
287 printf(
"\n #endif // RDEBUG\n\n"
288 "/***************************************************************/\n"
289 "/* Tables for lookup of procedures: */\n");
308 printf(
"\n/***************************************************************");
309 printf(
"* Summary:\n");
318#ifndef p_Procs_Static
325 printf(
"* RingGeneralProcs = %d (in FieldGeneral module)\n",
RingGeneralProcs);
330 printf(
"*******************************************************************/\n");
unsigned char * proc[NUM_PROC]
const CanonicalForm int s
static BOOLEAN length(leftv result, leftv arg)
#define HAVE_FAST_P_PROCS
#define HAVE_FAST_ZERO_ORD
void GenerateProc(const char *s_what, p_Proc proc, p_Field field, p_Length length, p_Ord ord)
const char * macros_length_ord[]
void AddProc(const char *s_what, p_Proc proc, p_Field field, p_Length length, p_Ord ord)
int IsKernelProc(p_Proc proc, p_Field field, p_Length length, p_Ord ord)
const char * macros_length[]
const char * macros_field[]
char *** generated_p_procs
int AlreadyHaveProc(p_Proc proc, p_Field field, p_Length length, p_Ord ord)
static int p_ProcDependsOn_Ord(p_Proc proc)
static int index(p_Length length, p_Ord ord)
static const char * p_ProcField_2_Module(p_Proc proc, p_Field field)
static int p_ProcDependsOn_Length(p_Proc proc)
@ pp_Mult_Coeff_mm_DivSelectMult_Proc
static const char * p_FieldEnum_2_String(p_Field field)
#define SetProcs(field, length, ord)
static const char * p_OrdEnum_2_String(p_Ord ord)
static const char * p_LengthEnum_2_String(p_Length length)
static const char * p_ProcEnum_2_String(p_Proc proc)
static int IsValidSpec(p_Field field, p_Length length, p_Ord ord)