Some Eigen objects, such as those returned by matrix.diagonal() and matrix.block() have non-standard stride values because they are basically just maps onto the underlying matrix without copying it (for example, the primary diagonal of a 3x3 matrix is a vector-like object with .src equal to the full matrix data, but with stride 4). Returning such an object from a pybind11 method breaks, however, because pybind11 assumes vectors have stride 1, and that matrices have strides equal to the number of rows/columns or 1 (depending on whether the matrix is stored column-major or row-major). This commit fixes the issue by making pybind11 use Eigen's stride methods when copying the data.
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| CMakeLists.txt | Loading commit data... | |
| eigen.cpp | Loading commit data... | |
| eigen.py | Loading commit data... | |
| eigen.ref | Loading commit data... | |
| example-arg-keywords-and-defaults.cpp | Loading commit data... | |
| example-arg-keywords-and-defaults.py | Loading commit data... | |
| example-arg-keywords-and-defaults.ref | Loading commit data... | |
| example-buffers.cpp | Loading commit data... | |
| example-buffers.py | Loading commit data... | |
| example-buffers.ref | Loading commit data... | |
| example-callbacks.cpp | Loading commit data... | |
| example-callbacks.py | Loading commit data... | |
| example-callbacks.ref | Loading commit data... | |
| example-constants-and-functions.cpp | Loading commit data... | |
| example-constants-and-functions.py | Loading commit data... | |
| example-constants-and-functions.ref | Loading commit data... | |
| example-custom-exceptions.cpp | Loading commit data... | |
| example-custom-exceptions.py | Loading commit data... | |
| example-custom-exceptions.ref | Loading commit data... | |
| example-eval.cpp | Loading commit data... | |
| example-eval.py | Loading commit data... | |
| example-eval.ref | Loading commit data... | |
| example-eval_call.py | Loading commit data... | |
| example-inheritance.cpp | Loading commit data... | |
| example-inheritance.py | Loading commit data... | |
| example-inheritance.ref | Loading commit data... | |
| example-keep-alive.cpp | Loading commit data... | |
| example-keep-alive.py | Loading commit data... | |
| example-keep-alive.ref | Loading commit data... | |
| example-methods-and-attributes.cpp | Loading commit data... | |
| example-methods-and-attributes.py | Loading commit data... | |
| example-methods-and-attributes.ref | Loading commit data... | |
| example-modules.cpp | Loading commit data... | |
| example-modules.py | Loading commit data... | |
| example-modules.ref | Loading commit data... | |
| example-numpy-vectorize.cpp | Loading commit data... | |
| example-numpy-vectorize.py | Loading commit data... | |
| example-numpy-vectorize.ref | Loading commit data... | |
| example-opaque-types.cpp | Loading commit data... | |
| example-opaque-types.py | Loading commit data... | |
| example-opaque-types.ref | Loading commit data... | |
| example-operator-overloading.cpp | Loading commit data... | |
| example-operator-overloading.py | Loading commit data... | |
| example-operator-overloading.ref | Loading commit data... | |
| example-pickling.cpp | Loading commit data... | |
| example-pickling.py | Loading commit data... | |
| example-pickling.ref | Loading commit data... | |
| example-python-types.cpp | Loading commit data... | |
| example-python-types.py | Loading commit data... | |
| example-python-types.ref | Loading commit data... | |
| example-sequences-and-iterators.cpp | Loading commit data... | |
| example-sequences-and-iterators.py | Loading commit data... | |
| example-sequences-and-iterators.ref | Loading commit data... | |
| example-smart-ptr.cpp | Loading commit data... | |
| example-smart-ptr.py | Loading commit data... | |
| example-smart-ptr.ref | Loading commit data... | |
| example-stl-binder-vector.cpp | Loading commit data... | |
| example-stl-binder-vector.py | Loading commit data... | |
| example-stl-binder-vector.ref | Loading commit data... | |
| example-virtual-functions.cpp | Loading commit data... | |
| example-virtual-functions.py | Loading commit data... | |
| example-virtual-functions.ref | Loading commit data... | |
| example.cpp | Loading commit data... | |
| example.h | Loading commit data... | |
| issues.cpp | Loading commit data... | |
| issues.py | Loading commit data... | |
| issues.ref | Loading commit data... | |
| object.h | Loading commit data... | |
| run_test.py | Loading commit data... |