mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-19 22:39:09 +00:00
correct stride in matrix example and test
This also matches the Eigen example for the row-major case. This also enhances one of the tests to trigger a failure (and fixes it in the PR). (This isn't really a flaw in pybind itself, but rather fixes wrong code in the test code and docs).
This commit is contained in:
committed by
Jason Rhinelander
parent
d2757d0440
commit
a22dd2d1df
@@ -107,7 +107,7 @@ TEST_SUBMODULE(buffers, m) {
|
||||
return py::buffer_info(
|
||||
m.data(), /* Pointer to buffer */
|
||||
{ m.rows(), m.cols() }, /* Buffer dimensions */
|
||||
{ sizeof(float) * size_t(m.rows()), /* Strides (in bytes) for each index */
|
||||
{ sizeof(float) * size_t(m.cols()), /* Strides (in bytes) for each index */
|
||||
sizeof(float) }
|
||||
);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user