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:
Ansgar Burchardt
2017-09-21 23:07:48 +02:00
committed by Jason Rhinelander
parent d2757d0440
commit a22dd2d1df
3 changed files with 13 additions and 9 deletions

View File

@@ -41,7 +41,7 @@ completely avoid copy operations with Python expressions like
py::format_descriptor<float>::format(), /* Python struct-style format descriptor */
2, /* Number of dimensions */
{ m.rows(), m.cols() }, /* Buffer dimensions */
{ sizeof(float) * m.rows(), /* Strides (in bytes) for each index */
{ sizeof(float) * m.cols(), /* Strides (in bytes) for each index */
sizeof(float) }
);
});