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)
126 printf(
"#define HAVE_RINGS\n");
127 printf(
"#define HAVE_ZERODIVISORS\n");
134 printf(
"#undef HAVE_RINGS\n");
135 printf(
"#undef HAVE_ZERODIVISORS\n");
140 printf(
"#undef %s__T\n#define %s__T\t%s_%s\n",
147 printf(
"#undef %s__T\n#define %s__T\t%s_%s\n",
154 printf(
"#undef %s__T\n#define %s__T\t%s_%s_%s\n",
160 printf(
"#undef DECLARE_LENGTH\n");
161 printf(
"#undef p_MemAddAdjust__T\n");
164 printf(
"#define DECLARE_LENGTH(what) do {} while (0)\n");
165 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
169 printf(
"#define DECLARE_LENGTH(what) what\n");
171 printf(
"#define p_MemAddAdjust__T(p, r) p_MemAdd_NegWeightAdjust(p, r)\n");
173 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
177 printf(
"#undef DECLARE_ORDSGN\n");
179 printf(
"#define DECLARE_ORDSGN(what) do {} while (0)\n");
181 printf(
"#define DECLARE_ORDSGN(what) what\n");
185 printf(
"#undef DECLARE_LENGTH_2\n");
186 printf(
"#undef p_MemCmp_Bitmask_2\n");
189 printf(
"#define DECLARE_LENGTH_2(what) do {} while (0)\n");
193 printf(
"#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthZero\n");
197 printf(
"#define DECLARE_LENGTH_2(what) what \n");
198 printf(
"#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthGeneral\n");
200 printf(
"#undef p_MemAddAdjust__T\n");
201 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
204 printf(
"#undef %s__T\n#define %s__T %s\n", s_what, s_what, s_full_proc_name);
205 printf(
"#include \"polys/templates/%s__T.cc\"\n", s_what);
206 printf(
"#undef %s\n", s_what);
207 if (strcmp(s_field,
"RingGeneral") == 0)
210 printf(
"#undef HAVE_RINGS\n");
211 printf(
"#undef HAVE_ZERODIVISORS\n");
216#ifndef p_Procs_Static
217 printf(
"#endif // p_Procs_[Kernel|Field*]\n");
235 printf(
"/* -*-c++-*- */\n");
236 printf(
"/***************************************************************\n");
237 printf(
" * This file was generated automatically by p_ProcsGenerate.cc: DO NOT EDIT\n");
239 printf(
" * This file provides the needed implementation of p_Procs for\n");
247 printf(
" * See the end for a summary.\n");
248 printf(
" *******************************************************************/\n");
275 "/***************************************************************\n"
276 "Names of procs for RDEBUG */\n"
287 printf(
"\n\"%s\",",
s);
295 printf(
"\n #endif // RDEBUG\n\n"
296 "/***************************************************************/\n"
297 "/* Tables for lookup of procedures: */\n");
316 printf(
"\n/***************************************************************");
317 printf(
"* Summary:\n");
326#ifndef p_Procs_Static
333 printf(
"* RingGeneralProcs = %d (in FieldGeneral module)\n",
RingGeneralProcs);
338 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)