Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
eigenpy
Commits
5c8eb86b
Verified
Commit
5c8eb86b
authored
Jul 15, 2020
by
Justin Carpentier
Browse files
core: fix argument according to the Numpy version
parent
2dd52b63
Changes
1
Show whitespace changes
Inline
Side-by-side
include/eigenpy/ufunc.hpp
View file @
5c8eb86b
...
@@ -12,9 +12,15 @@ namespace eigenpy
...
@@ -12,9 +12,15 @@ namespace eigenpy
namespace
internal
namespace
internal
{
{
#ifdef NPY_1_19_API_VERSION
#define EIGENPY_NPY_CONST_UFUNC_ARG const
#else
#define EIGENPY_NPY_CONST_UFUNC_ARG
#endif
#define EIGENPY_REGISTER_BINARY_OPERATOR(name,op) \
#define EIGENPY_REGISTER_BINARY_OPERATOR(name,op) \
template<typename T1, typename T2, typename R> \
template<typename T1, typename T2, typename R> \
void binary_op_##name(char** args,
const npy_intp * dimensions, const
npy_intp * steps, void *
/*data*/
) \
void binary_op_##name(char** args,
EIGENPY_NPY_CONST_UFUNC_ARG npy_intp * dimensions, EIGENPY_NPY_CONST_UFUNC_ARG
npy_intp * steps, void *
/*data*/
) \
{ \
{ \
npy_intp is0 = steps[0], is1 = steps[1], \
npy_intp is0 = steps[0], is1 = steps[1], \
os = steps[2], n = *dimensions; \
os = steps[2], n = *dimensions; \
...
@@ -31,7 +37,7 @@ namespace eigenpy
...
@@ -31,7 +37,7 @@ namespace eigenpy
} \
} \
\
\
template<typename T> \
template<typename T> \
void binary_op_##name(char** args,
const npy_intp * dimensions, const
npy_intp * steps, void * data) \
void binary_op_##name(char** args,
EIGENPY_NPY_CONST_UFUNC_ARG npy_intp * dimensions, EIGENPY_NPY_CONST_UFUNC_ARG
npy_intp * steps, void * data) \
{ \
{ \
binary_op_##name<T,T,T>(args,dimensions,steps,data); \
binary_op_##name<T,T,T>(args,dimensions,steps,data); \
}
}
...
@@ -49,7 +55,7 @@ namespace eigenpy
...
@@ -49,7 +55,7 @@ namespace eigenpy
#define EIGENPY_REGISTER_UNARY_OPERATOR(name,op) \
#define EIGENPY_REGISTER_UNARY_OPERATOR(name,op) \
template<typename T, typename R> \
template<typename T, typename R> \
void unary_op_##name(char** args,
const npy_intp * dimensions, const
npy_intp * steps, void *
/*data*/
) \
void unary_op_##name(char** args,
EIGENPY_NPY_CONST_UFUNC_ARG npy_intp * dimensions, EIGENPY_NPY_CONST_UFUNC_ARG
npy_intp * steps, void *
/*data*/
) \
{ \
{ \
npy_intp is = steps[0], \
npy_intp is = steps[0], \
os = steps[1], n = *dimensions; \
os = steps[1], n = *dimensions; \
...
@@ -65,7 +71,7 @@ namespace eigenpy
...
@@ -65,7 +71,7 @@ namespace eigenpy
} \
} \
\
\
template<typename T> \
template<typename T> \
void unary_op_##name(char** args,
const npy_intp * dimensions, const
npy_intp * steps, void * data) \
void unary_op_##name(char** args,
EIGENPY_NPY_CONST_UFUNC_ARG npy_intp * dimensions, EIGENPY_NPY_CONST_UFUNC_ARG
npy_intp * steps, void * data) \
{ \
{ \
unary_op_##name<T,T>(args,dimensions,steps,data); \
unary_op_##name<T,T>(args,dimensions,steps,data); \
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment