|
|
|
|
|
|
| #include <numpy/arrayobject.h>
|
| #include <numpy/ufuncobject.h>
|
|
|
|
|
|
|
|
|
|
|
| #if NPY_API_VERSION >= 0x0000000e
|
| #define __PYX_PYUFUNCGENERICFUNCTION_CAST(x) x
|
| #else
|
| #define __PYX_PYUFUNCGENERICFUNCTION_CAST(x) (PyUFuncGenericFunction)x
|
| #endif
|
|
|
|
|
|
|
|
|
| static PyUFuncGenericFunction* {{ufunc_funcs_name}}(void);
|
| static char* {{ufunc_types_name}}(void);
|
| static void* {{ufunc_data_name}}[] = {NULL};
|
|
|
|
|
|
|
| static PyUFuncGenericFunction* {{ufunc_funcs_name}}(void) {
|
| static PyUFuncGenericFunction arr[] = {
|
| {{for loop, cname in looper(func_cnames)}}
|
| __PYX_PYUFUNCGENERICFUNCTION_CAST(&{{cname}}){{if not loop.last}},{{endif}}
|
| {{endfor}}
|
| };
|
| return arr;
|
| }
|
|
|
| static char* {{ufunc_types_name}}(void) {
|
| static char arr[] = {
|
| {{for loop, tp in looper(type_constants)}}
|
| {{tp}}{{if not loop.last}},{{endif}}
|
| {{endfor}}
|
| };
|
| return arr;
|
| }
|
|
|