From b5c1691345749d1dfd51d09609c90c9817d8778c Mon Sep 17 00:00:00 2001 From: Justin Carpentier <justin.carpentier@inria.fr> Date: Fri, 21 Feb 2020 09:57:35 +0100 Subject: [PATCH] core: move NumpyEquivalentType to the dedicated file --- include/eigenpy/numpy-type.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/eigenpy/numpy-type.hpp b/include/eigenpy/numpy-type.hpp index 557276b7..2037e0f2 100644 --- a/include/eigenpy/numpy-type.hpp +++ b/include/eigenpy/numpy-type.hpp @@ -13,6 +13,17 @@ namespace eigenpy { namespace bp = boost::python; + + template <typename SCALAR> struct NumpyEquivalentType {}; + + template <> struct NumpyEquivalentType<float> { enum { type_code = NPY_FLOAT };}; + template <> struct NumpyEquivalentType< std::complex<float> > { enum { type_code = NPY_CFLOAT };}; + template <> struct NumpyEquivalentType<double> { enum { type_code = NPY_DOUBLE };}; + template <> struct NumpyEquivalentType< std::complex<double> > { enum { type_code = NPY_CDOUBLE };}; + template <> struct NumpyEquivalentType<long double> { enum { type_code = NPY_LONGDOUBLE };}; + template <> struct NumpyEquivalentType< std::complex<long double> > { enum { type_code = NPY_CLONGDOUBLE };}; + template <> struct NumpyEquivalentType<int> { enum { type_code = NPY_INT };}; + template <> struct NumpyEquivalentType<long> { enum { type_code = NPY_LONG };}; enum NP_TYPE { -- GitLab