12#include "factory/factory.h"
32#define WARN_MSG "Singular will work properly, but much slower."
36#define LINKAGE extern "C"
39#include "templates/p_Procs.inc"
48#define MAX_PROCNAME_LEN 200
60 sprintf(
name,
"p_Procs_%s", module);
70 if (strcmp(module,
"FieldIndep") == 0)
72 else if (strcmp(module,
"FieldZp") == 0)
74 else if (strcmp(module,
"FieldQ") == 0)
76 else if (strcmp(module,
"FieldGeneral") == 0)
91 return cast_A_to_vptr(p_Copy__FieldGeneral_LengthGeneral_OrdGeneral);
93 return cast_A_to_vptr(p_Delete__FieldGeneral_LengthGeneral_OrdGeneral);
95 return cast_A_to_vptr(p_ShallowCopyDelete__FieldGeneral_LengthGeneral_OrdGeneral);
97 return cast_A_to_vptr(p_Add_q__FieldGeneral_LengthGeneral_OrdGeneral);
99 return cast_A_to_vptr(p_Neg__FieldGeneral_LengthGeneral_OrdGeneral);
101 return cast_A_to_vptr(p_Merge_q__FieldGeneral_LengthGeneral_OrdGeneral);
103 return cast_A_to_vptr(p_kBucketSetLm__FieldGeneral_LengthGeneral_OrdGeneral);
106 return cast_A_to_vptr(p_Mult_nn__RingGeneral_LengthGeneral_OrdGeneral);
108 return cast_A_to_vptr(pp_Mult_nn__RingGeneral_LengthGeneral_OrdGeneral);
110 return cast_A_to_vptr(pp_Mult_mm__RingGeneral_LengthGeneral_OrdGeneral);
112 return cast_A_to_vptr(pp_Mult_mm_Noether__RingGeneral_LengthGeneral_OrdGeneral);
114 return cast_A_to_vptr(p_Mult_mm__RingGeneral_LengthGeneral_OrdGeneral);
116 return cast_A_to_vptr(p_Minus_mm_Mult_qq__RingGeneral_LengthGeneral_OrdGeneral);
118 return cast_A_to_vptr(pp_Mult_Coeff_mm_DivSelect__RingGeneral_LengthGeneral_OrdGeneral);
120 return cast_A_to_vptr(pp_Mult_Coeff_mm_DivSelectMult__RingGeneral_LengthGeneral_OrdGeneral);
123 return cast_A_to_vptr(p_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral);
125 return cast_A_to_vptr(pp_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral);
127 return cast_A_to_vptr(pp_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral);
129 return cast_A_to_vptr(pp_Mult_mm_Noether__FieldGeneral_LengthGeneral_OrdGeneral);
131 return cast_A_to_vptr(p_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral);
133 return cast_A_to_vptr(p_Minus_mm_Mult_qq__FieldGeneral_LengthGeneral_OrdGeneral);
135 return cast_A_to_vptr(pp_Mult_Coeff_mm_DivSelect__FieldGeneral_LengthGeneral_OrdGeneral);
137 return cast_A_to_vptr(pp_Mult_Coeff_mm_DivSelectMult__FieldGeneral_LengthGeneral_OrdGeneral);
152 return "p_Copy__FieldGeneral_LengthGeneral_OrdGeneral";
154 return "p_Delete__FieldGeneral_LengthGeneral_OrdGeneral";
156 return "p_ShallowCopyDelete__FieldGeneral_LengthGeneral_OrdGeneral";
158 return "p_Add_q__FieldGeneral_LengthGeneral_OrdGeneral";
160 return "p_Neg__FieldGeneral_LengthGeneral_OrdGeneral";
162 return "p_Merge_q__FieldGeneral_LengthGeneral_OrdGeneral";
164 return "p_kBucketSetLm__FieldGeneral_LengthGeneral_OrdGeneral";
169 return "p_Mult_nn__RingGeneral_LengthGeneral_OrdGeneral";
171 return "pp_Mult_nn__RingGeneral_LengthGeneral_OrdGeneral";
173 return "pp_Mult_mm__RingGeneral_LengthGeneral_OrdGeneral";
175 return "pp_Mult_mm_Noether__RingGeneral_LengthGeneral_OrdGeneral";
177 return "p_Mult_mm__RingGeneral_LengthGeneral_OrdGeneral";
179 return "p_Minus_mm_Mult_qq__RingGeneral_LengthGeneral_OrdGeneral";
181 return "pp_Mult_Coeff_mm_DivSelect__RingGeneral_LengthGeneral_OrdGeneral";
183 return "pp_Mult_Coeff_mm_DivSelectMult__RingGeneral_LengthGeneral_OrdGeneral";
186 return "p_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral";
188 return "pp_Mult_nn__FieldGeneral_LengthGeneral_OrdGeneral";
190 return "pp_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral";
192 return "pp_Mult_mm_Noether__FieldGeneral_LengthGeneral_OrdGeneral";
194 return "p_Mult_mm__FieldGeneral_LengthGeneral_OrdGeneral";
196 return "p_Minus_mm_Mult_qq__FieldGeneral_LengthGeneral_OrdGeneral";
198 return "pp_Mult_Coeff_mm_DivSelect__FieldGeneral_LengthGeneral_OrdGeneral";
200 return "pp_Mult_Coeff_mm_DivSelectMult__FieldGeneral_LengthGeneral_OrdGeneral";
203 return "p_Unknown_Proc";
215 void* proc_ptr =
NULL;
217 sprintf(proc_name,
"%s__%s_%s_%s", proc_s,
224 if (proc_ptr ==
NULL)
228 if (proc_ptr ==
NULL)
240#if (!defined(SING_NDEBUG)) && (!defined(OM_NDEBUG))
250#define DoReallySetProc(what, field, length, ord) \
251 _p_procs->what = cast_vptr_to_A<what##_Proc_Ptr>( \
252 GetDynamicProc(#what, what##_Proc, field, length, ord))
255#define DoSetProc(what, field, length, ord) \
259 _p_procs->what = cast_vptr_to_A<what##_Proc_Ptr>( \
260 GetDynamicProc(#what, what##_Proc, field, length, ord, 1)); \
262 DoReallySetProc(what, field, length, ord); \
266#define DoSetProc DoReallySetProc
void * cast_A_to_vptr(A a)
unsigned char * proc[NUM_PROC]
static BOOLEAN length(leftv result, leftv arg)
void * dynl_open_binary_warn(const char *binary_name, const char *msg)
void * dynl_sym_warn(void *handle, const char *proc, const char *msg)
void * dynl_sym(void *handle, const char *symbol)
#define DYNL_KERNEL_HANDLE
static const char * GetGeneralProcName(p_Proc proc)
static void * GetGeneralProc(p_Proc proc)
static void * p_ProcGetHandle(p_Proc proc, p_Field field)
void * p_procs_handle_FieldZp
void * p_procs_handle_FieldQ
static void * p_ProcInitHandle(void **handle, const char *module)
void * p_procs_handle_FieldGeneral
void * p_procs_handle_FieldIndep
const BOOLEAN p_procs_dynamic
static void * GetDynamicProc(const char *proc_s, p_Proc proc, p_Field field, p_Length length, p_Ord ord, int get_name=0)
static const char * p_ProcField_2_Module(p_Proc proc, p_Field field)
@ p_ShallowCopyDelete_Proc
@ pp_Mult_Coeff_mm_DivSelect_Proc
@ pp_Mult_Coeff_mm_DivSelectMult_Proc
@ p_Minus_mm_Mult_qq_Proc
@ pp_Mult_mm_Noether_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)
int name
New type name for int.
#define omMarkAsStaticAddr(A)