Verified Commit 53b74958 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: add helper to check if the current Scalar is a Numpy native type

parent 3cf24b0d
......@@ -30,9 +30,17 @@ namespace eigenpy
template <> struct NumpyEquivalentType<long> { enum { type_code = NPY_LONG };};
template<typename Scalar>
PyTypeObject getPyType()
bool isNumpyNativeType()
{
if(NumpyEquivalentType<Scalar>::type_code == NPY_OBJECT)
return false;
return true;
}
template<typename Scalar>
PyTypeObject * getPyType()
{
if(!isNumpyNativeType<Scalar>())
{
const PyTypeObject * const_py_type_ptr = bp::converter::registered_pytype<Scalar>::get_pytype();
if(const_py_type_ptr == NULL)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment