Add support for int64 and uint64 as it was done in Schweizer-Messer
See https://github.com/ethz-asl/Schweizer-Messerrelease/4.3a0
parent
46178731c6
commit
2754613072
|
|
@ -28,6 +28,31 @@ template<> struct TypeToNumPy<int>
|
|||
}
|
||||
};
|
||||
|
||||
template<> struct TypeToNumPy<boost::int64_t>
|
||||
{
|
||||
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<boost::uint64_t>
|
||||
{
|
||||
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<unsigned char>
|
||||
{
|
||||
enum { NpyType = NPY_UBYTE };
|
||||
|
|
|
|||
Loading…
Reference in New Issue