Commit a4678029 authored by Justin Carpentier's avatar Justin Carpentier

core: add getNumpy{Matrix,Array}Type + is{Matrix,Array} methods

parent 77b2063e
......@@ -119,6 +119,28 @@ namespace eigenpy
{
return getInstance().CurrentNumpyType;
}
static const PyTypeObject * getNumpyMatrixType()
{
return getInstance().NumpyMatrixType;
}
static const PyTypeObject * getNumpyArrayType()
{
return getInstance().NumpyArrayType;
}
static bool isMatrix()
{
return PyType_IsSubtype(reinterpret_cast<PyTypeObject*>(getInstance().CurrentNumpyType.ptr()),
getInstance().NumpyMatrixType);
}
static bool isArray()
{
return PyType_IsSubtype(reinterpret_cast<PyTypeObject*>(getInstance().CurrentNumpyType.ptr()),
getInstance().NumpyArrayType);
}
protected:
NumpyType()
......
Markdown is supported
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