#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#ifdef HAVE_RINGS
126 printf(
"#define HAVE_RINGS\n");
127 printf(
"#define HAVE_ZERODIVISORS\n");
128#else
130#endif
131 }
132 else
133 {
134 printf(
"#undef HAVE_RINGS\n");
135 printf(
"#undef HAVE_ZERODIVISORS\n");
136 }
139 {
140 printf(
"#undef %s__T\n#define %s__T\t%s_%s\n",
143 }
146 {
147 printf(
"#undef %s__T\n#define %s__T\t%s_%s\n",
150 }
153 {
154 printf(
"#undef %s__T\n#define %s__T\t%s_%s_%s\n",
157 }
158
159
160 printf(
"#undef DECLARE_LENGTH\n");
161 printf(
"#undef p_MemAddAdjust__T\n");
163 {
164 printf(
"#define DECLARE_LENGTH(what) do {} while (0)\n");
165 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
166 }
167 else
168 {
169 printf(
"#define DECLARE_LENGTH(what) what\n");
171 printf(
"#define p_MemAddAdjust__T(p, r) p_MemAdd_NegWeightAdjust(p, r)\n");
172 else
173 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
174 }
175
176
177 printf(
"#undef DECLARE_ORDSGN\n");
179 printf(
"#define DECLARE_ORDSGN(what) do {} while (0)\n");
180 else
181 printf(
"#define DECLARE_ORDSGN(what) what\n");
182
184 {
185 printf(
"#undef DECLARE_LENGTH_2\n");
186 printf(
"#undef p_MemCmp_Bitmask_2\n");
188 {
189 printf(
"#define DECLARE_LENGTH_2(what) do {} while (0)\n");
192 else
193 printf(
"#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthZero\n");
194 }
195 else
196 {
197 printf(
"#define DECLARE_LENGTH_2(what) what \n");
198 printf(
"#define p_MemCmp_Bitmask_2 p_MemCmp_Bitmask_LengthGeneral\n");
199 }
200 printf(
"#undef p_MemAddAdjust__T\n");
201 printf(
"#define p_MemAddAdjust__T(p, r) do {} while (0)\n");
202 }
203
205 printf(
"#include \"polys/templates/%s__T.cc\"\n",
s_what);
208 {
209#ifdef HAVE_RINGS
210 printf(
"#undef HAVE_RINGS\n");
211 printf(
"#undef HAVE_ZERODIVISORS\n");
212#else
214#endif
215 }
216#ifndef p_Procs_Static
217 printf(
"#endif // p_Procs_[Kernel|Field*]\n");
218#endif
219}
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 221 of file p_Procs_Generate.cc.
222{
225}
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 227 of file p_Procs_Generate.cc.
228{
233
234
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");
242 "p_Procs_Static"
243#else
244 "p_Procs_Dynamic"
246 );
247 printf(
" * See the end for a summary.\n");
248 printf(
" *******************************************************************/\n");
249
250
253 {
256 }
257
258
260 {
262 {
264 {
267 }
268 }
269 }
270
271
272#ifdef p_Procs_Static
275 "/***************************************************************\n"
276 "Names of procs for RDEBUG */\n"
277 "#ifdef RDEBUG\n");
278
280 {
283 {
286 {
288 }
289 else
291
292 }
294 }
295 printf(
"\n #endif // RDEBUG\n\n"
296 "/***************************************************************/\n"
297 "/* Tables for lookup of procedures: */\n");
298
300 {
303 {
306 {
308 }
309 else
311 }
313 }
314#endif
315
316 printf(
"\n/***************************************************************");
325
326#ifndef p_Procs_Static
335#endif
336
338 printf(
"*******************************************************************/\n");
339}
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