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).
diff --git a/tests/test_buffers.cpp b/tests/test_buffers.cpp
index 5be7177..5199cf6 100644
--- a/tests/test_buffers.cpp
+++ b/tests/test_buffers.cpp
@@ -107,7 +107,7 @@
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) }
);
})