From b409c63d06580174df14445890080ad2918f3db0 Mon Sep 17 00:00:00 2001 From: Justin Carpentier <justin.carpentier@inria.fr> Date: Fri, 19 Oct 2018 10:28:44 +0200 Subject: [PATCH] conversion: add asmatrix converter --- include/eigenpy/details.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/eigenpy/details.hpp b/include/eigenpy/details.hpp index 1ca6578b..03ec4e9d 100644 --- a/include/eigenpy/details.hpp +++ b/include/eigenpy/details.hpp @@ -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; }; -- GitLab