Skip to content

Commit b409c63

Browse files
committed
conversion: add asmatrix converter
1 parent f1f2bc4 commit b409c63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/eigenpy/details.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ namespace eigenpy
7373
bp::object m;
7474
if(PyType_IsSubtype(reinterpret_cast<PyTypeObject*>(CurrentNumpyType.ptr()),NumpyMatrixType))
7575
m = NumpyMatrixObject(bp::object(bp::handle<>(pyObj)), bp::object(), copy);
76+
// m = NumpyAsMatrixObject(bp::object(bp::handle<>(pyObj)));
7677
else if(PyType_IsSubtype(reinterpret_cast<PyTypeObject*>(CurrentNumpyType.ptr()),NumpyArrayType))
7778
m = bp::object(bp::handle<>(pyObj)); // nothing to do here
7879

@@ -106,6 +107,8 @@ namespace eigenpy
106107

107108
NumpyMatrixObject = pyModule.attr("matrix");
108109
NumpyMatrixType = reinterpret_cast<PyTypeObject*>(NumpyMatrixObject.ptr());
110+
NumpyAsMatrixObject = pyModule.attr("asmatrix");
111+
NumpyAsMatrixType = reinterpret_cast<PyTypeObject*>(NumpyAsMatrixObject.ptr());
109112
NumpyArrayObject = pyModule.attr("ndarray");
110113
NumpyArrayType = reinterpret_cast<PyTypeObject*>(NumpyArrayObject.ptr());
111114

@@ -117,6 +120,7 @@ namespace eigenpy
117120

118121
// Numpy types
119122
bp::object NumpyMatrixObject; PyTypeObject * NumpyMatrixType;
123+
bp::object NumpyAsMatrixObject; PyTypeObject * NumpyAsMatrixType;
120124
bp::object NumpyArrayObject; PyTypeObject * NumpyArrayType;
121125
};
122126

0 commit comments

Comments
 (0)