Open asadchev opened 5 years ago
If I understand correctly, you'll want to use pybind11/eigen.h
's ability to do pass-by-reference:
https://pybind11.readthedocs.io/en/stable/advanced/cast/eigen.html#pass-by-reference
Then you can do stuff like what's in the unittests: https://github.com/pybind/pybind11/blob/e2b884c33bcde70b2ea562ffa52dd7ebee276d50/tests/test_eigen.cpp#L128 https://github.com/pybind/pybind11/blob/e2b884c33bcde70b2ea562ffa52dd7ebee276d50/tests/test_eigen.py#L489
If you're not looking to expose type_caster
s for Eigen::Map<>
-based types, can I ask what you are looking to do?
What is correct way to give Eigen matrix buffer protocol?
Doing this
will cause segfault if
pybind11/eigen.h
is included as indef_buffer
null pointer is returned