Skip to content
Snippets Groups Projects
Verified Commit a4678029 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

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

parent 77b2063e
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment