From 2754613072dda176f0b466babf4db539244da41c Mon Sep 17 00:00:00 2001 From: Ellon Mendes Date: Thu, 3 Dec 2015 13:04:47 +0100 Subject: [PATCH] Add support for int64 and uint64 as it was done in Schweizer-Messer See https://github.com/ethz-asl/Schweizer-Messer --- .../include/numpy_eigen/type_traits.hpp | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gtsam/3rdparty/numpy_eigen/include/numpy_eigen/type_traits.hpp b/gtsam/3rdparty/numpy_eigen/include/numpy_eigen/type_traits.hpp index 3b75c6b99..36fae1a03 100755 --- a/gtsam/3rdparty/numpy_eigen/include/numpy_eigen/type_traits.hpp +++ b/gtsam/3rdparty/numpy_eigen/include/numpy_eigen/type_traits.hpp @@ -28,6 +28,31 @@ template<> struct TypeToNumPy } }; +template<> struct TypeToNumPy +{ + enum { NpyType = NPY_LONG }; + static const char * npyString() { return "NPY_LONG"; } + static const char * typeString() { return "long"; } + static bool canConvert(int type) + { + return type == NPY_INT || type == NPY_LONG; + } +}; + +template<> struct TypeToNumPy +{ + enum { NpyType = NPY_UINT64 }; + static const char * npyString() { return "NPY_UINT64"; } + static const char * typeString() { return "uint64"; } + static bool canConvert(int type) + { + return type == NPY_UINT8 || type == NPY_USHORT || + type == NPY_UINT16 || type == NPY_UINT32 || + type == NPY_ULONG || type == NPY_ULONGLONG || + type == NPY_UINT64; + } +}; + template<> struct TypeToNumPy { enum { NpyType = NPY_UBYTE };