File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ buffer objects (e.g. a NumPy matrix).
8181 constexpr bool rowMajor = Matrix::Flags & Eigen::RowMajorBit;
8282
8383 py::class_<Matrix>(m, "Matrix", py::buffer_protocol())
84- .def("__init__", [](Matrix &m, py::buffer b) {
84+ .def("__init__", [](py::buffer b) {
8585 typedef Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic> Strides;
8686
8787 /* Request a buffer descriptor from Python */
@@ -101,7 +101,7 @@ buffer objects (e.g. a NumPy matrix).
101101 auto map = Eigen::Map<Matrix, 0, Strides>(
102102 static_cast<Scalar *>(info.ptr), info.shape[0], info.shape[1], strides);
103103
104- new (&m) Matrix(map );
104+ return Matrix(m );
105105 });
106106
107107 For reference, the ``def_buffer() `` call for this Eigen data type should look
You can’t perform that action at this time.
0 commit comments