#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "misc/auxiliary.h"
#include "reporter/reporter.h"
#include "polys/templates/p_Procs_Dynamic.h"
#include "polys/templates/p_Procs_Impl.h"
Go to the source code of this file.
|
int | IsKernelProc (p_Proc proc, p_Field field, p_Length length, p_Ord ord) |
|
int | AlreadyHaveProc (p_Proc proc, p_Field field, p_Length length, p_Ord ord) |
|
void | AddProc (const char *s_what, p_Proc proc, p_Field field, p_Length length, p_Ord ord) |
|
void | GenerateProc (const char *s_what, p_Proc proc, p_Field field, p_Length length, p_Ord ord) |
|
int | main () |
|
|
int | FieldGeneralProcs = 0 |
|
int | FieldIndepProcs = 0 |
|
int | FieldZpProcs = 0 |
|
int | FieldQProcs = 0 |
|
int | RingGeneralProcs = 0 |
|
int | KernelProcs = 0 |
|
int | UnknownProcs = 0 |
|
char *** | generated_p_procs |
|
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} |
|
const char * | macros_length [] |
|
const char * | macros_length_ord [] = {"p_MemCmp", NULL} |
|
int | DummyProcs = 0 |
|
int | NumberOfHaveProcs = 0 |
|
◆ DoSetProc
Definition at line 64 of file p_Procs_Generate.cc.
64#define DoSetProc(what, field, length, ord) \
65 GenerateProc(#what, what##_Proc, field, length, ord)
◆ AddProc()
Definition at line 84 of file p_Procs_Generate.cc.
85{
92
94
96
98#ifndef p_Procs_Static
100 {
102 printf(
"#ifdef p_Procs_Kernel\n");
103 }
104 else
105 {
106 const char* module = p_ProcField_2_Module(proc, field);
115 else
119
121 }
122#endif
124 {
125 printf(
"#define HAVE_RINGS\n");
126 printf(
"#define HAVE_ZERODIVISORS\n");
127 }
128 else
129 {
130 printf(
"#undef HAVE_RINGS\n");
131 printf(
"#undef HAVE_ZERODIVISORS\n");
132 }
135 {
136 printf(
"#undef %s__T\n#define %s__T\t%s_%s\n",
139 }
142 {
143 printf(
"#undef %s__T\n#define %s__T\t%s_%s\n",
146 }
149 {
150 printf(
"#undef %s__T\n#define %s__T\t%s_%s_%s\n",
153 }
154
155
156 printf(
"#undef DECLARE_LENGTH\n");
157 printf(
"#undef p_MemAddAdjust__T\n");
159 {
160 printf(
"#define DECLARE_LENGTH(what) do {} while (0)\n");
161 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
162 }
163 else
164 {
165 printf(
"#define DECLARE_LENGTH(what) what\n");
167 printf(
"#define p_MemAddAdjust__T(p, r) p_MemAdd_NegWeightAdjust(p, r)\n");
168 else
169 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
170 }
171
172
173 printf(
"#undef DECLARE_ORDSGN\n");
175 printf(
"#define DECLARE_ORDSGN(what) do {} while (0)\n");
176 else
177 printf(
"#define DECLARE_ORDSGN(what) what\n");
178
180 {
181 printf(
"#undef DECLARE_LENGTH_2\n");
182 printf(
"#undef p_MemCmp_Bitmask_2\n");
184 {
185 printf(
"#define DECLARE_LENGTH_2(what) do {} while (0)\n");
188 else
189 printf(
"#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthZero\n");
190 }
191 else
192 {
193 printf(
"#define DECLARE_LENGTH_2(what) what \n");
194 printf(
"#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthGeneral\n");
195 }
196 printf(
"#undef p_MemAddAdjust__T\n");
197 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
198 }
199
201 printf(
"#include \"polys/templates/%s__T.cc\"\n",
s_what);
204 {
205 printf(
"#undef HAVE_RINGS\n");
206 printf(
"#undef HAVE_ZERODIVISORS\n");
207 }
208#ifndef p_Procs_Static
209 printf(
"#endif // p_Procs_[Kernel|Field*]\n");
210#endif
211}
unsigned char * proc[NUM_PROC]
static BOOLEAN length(leftv result, leftv arg)
const char * macros_length_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
static int index(p_Length length, p_Ord ord)
@ pp_Mult_Coeff_mm_DivSelectMult_Proc
static const char * p_FieldEnum_2_String(p_Field field)
static const char * p_OrdEnum_2_String(p_Ord ord)
static const char * p_LengthEnum_2_String(p_Length length)
◆ AlreadyHaveProc()
◆ GenerateProc()
Definition at line 213 of file p_Procs_Generate.cc.
214{
217}
void AddProc(const char *s_what, p_Proc proc, p_Field field, p_Length length, p_Ord ord)
int AlreadyHaveProc(p_Proc proc, p_Field field, p_Length length, p_Ord ord)
◆ IsKernelProc()
Definition at line 41 of file p_Procs_Generate.cc.
42{
43
45 return 1;
46
48 return 1;
49
50
52
55
57 return 1;
58
59 return 0;
60}
static int p_ProcDependsOn_Ord(p_Proc proc)
static int p_ProcDependsOn_Length(p_Proc proc)
◆ main()
Definition at line 219 of file p_Procs_Generate.cc.
220{
225
226
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");
234 "p_Procs_Static"
235#else
236 "p_Procs_Dynamic"
238 );
239 printf(
" * See the end for a summary.\n");
240 printf(
" *******************************************************************/\n");
241
242
245 {
248 }
249
250
252 {
254 {
256 {
259 }
260 }
261 }
262
263
264#ifdef p_Procs_Static
267 "/***************************************************************\n"
268 "Names of procs for RDEBUG */\n"
269 "#ifdef RDEBUG\n");
270
272 {
275 {
278 {
280 }
281 else
283
284 }
286 }
287 printf(
"\n #endif // RDEBUG\n\n"
288 "/***************************************************************/\n"
289 "/* Tables for lookup of procedures: */\n");
290
292 {
295 {
298 {
300 }
301 else
303 }
305 }
306#endif
307
308 printf(
"\n/***************************************************************");
317
318#ifndef p_Procs_Static
327#endif
328
330 printf(
"*******************************************************************/\n");
331}
const CanonicalForm int s
#define HAVE_FAST_P_PROCS
#define HAVE_FAST_ZERO_ORD
#define SetProcs(field, length, ord)
static const char * p_ProcEnum_2_String(p_Proc proc)
static int IsValidSpec(p_Field field, p_Length length, p_Ord ord)
◆ DummyProcs
◆ FieldGeneralProcs
int FieldGeneralProcs = 0 |
◆ FieldIndepProcs
◆ FieldQProcs
◆ FieldZpProcs
◆ generated_p_procs
char*** generated_p_procs |
◆ KernelProcs
◆ macros_field
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} |
Definition at line 74 of file p_Procs_Generate.cc.
74{
"n_Copy",
"n_Delete",
"n_Mult",
"n_Add",
"n_Sub",
"n_IsZero",
"n_Equal" ,
"n_Neg",
"n_InpMult",
"n_InpAdd",
NULL};
◆ macros_length
Initial value:=
{
"p_MemCopy",
"p_MemAdd",
"p_MemSum",
"p_MemDiff",
NULL}
Definition at line 76 of file p_Procs_Generate.cc.
77{
"p_MemCopy",
"p_MemAdd",
"p_MemSum",
"p_MemDiff",
NULL};
◆ macros_length_ord
◆ NumberOfHaveProcs
int NumberOfHaveProcs = 0 |
◆ RingGeneralProcs
◆ UnknownProcs