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

conversion: add asmatrix converter

parent f1f2bc44
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,7 @@ namespace eigenpy
bp::object m;
if(PyType_IsSubtype(reinterpret_cast<PyTypeObject*>(CurrentNumpyType.ptr()),NumpyMatrixType))
m = NumpyMatrixObject(bp::object(bp::handle<>(pyObj)), bp::object(), copy);
// m = NumpyAsMatrixObject(bp::object(bp::handle<>(pyObj)));
else if(PyType_IsSubtype(reinterpret_cast<PyTypeObject*>(CurrentNumpyType.ptr()),NumpyArrayType))
m = bp::object(bp::handle<>(pyObj)); // nothing to do here
......@@ -106,6 +107,8 @@ namespace eigenpy
NumpyMatrixObject = pyModule.attr("matrix");
NumpyMatrixType = reinterpret_cast<PyTypeObject*>(NumpyMatrixObject.ptr());
NumpyAsMatrixObject = pyModule.attr("asmatrix");
NumpyAsMatrixType = reinterpret_cast<PyTypeObject*>(NumpyAsMatrixObject.ptr());
NumpyArrayObject = pyModule.attr("ndarray");
NumpyArrayType = reinterpret_cast<PyTypeObject*>(NumpyArrayObject.ptr());
......@@ -117,6 +120,7 @@ namespace eigenpy
// Numpy types
bp::object NumpyMatrixObject; PyTypeObject * NumpyMatrixType;
bp::object NumpyAsMatrixObject; PyTypeObject * NumpyAsMatrixType;
bp::object NumpyArrayObject; PyTypeObject * NumpyArrayType;
};
......
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