Skip to content
Snippets Groups Projects
Commit 211ab1b2 authored by Nicolas Mansard's avatar Nicolas Mansard Committed by nmansard
Browse files

Added a conversion to matrix type.

parent 5c5b8cc3
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,15 @@ namespace eigenpy ...@@ -60,7 +60,15 @@ namespace eigenpy
MapNumpy<EquivalentEigenType>::map(pyArray) = mat; MapNumpy<EquivalentEigenType>::map(pyArray) = mat;
return (PyObject*)pyArray;
boost::python::object pyModule = boost::python::import("numpy");
boost::python::object pyMatrixType = pyModule.attr("matrix");
boost::python::object m
= pyMatrixType( boost::python::object(boost::python::handle<>((PyObject*)pyArray)),
boost::python::object(), true );
Py_INCREF(m.ptr());
return m.ptr();
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment