Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct stride in matrix example and test #1103

Merged
merged 2 commits into from Sep 21, 2017

Conversation

aburch
Copy link
Contributor

@aburch aburch commented Sep 20, 2017

This also matches the Eigen example for the row-major case.

This also matches the Eigen example for the row-major case.
@aburch
Copy link
Contributor Author

aburch commented Sep 20, 2017

I'm slightly tired, but for an array of dimensions { rows, cols }, shoudn't the stride be either { Zcols, Z } or { Z, Zrows } depending on the storage format, but never { Z*rows, Z } (with Z = sizeof(...))?

@jagerman
Copy link
Member

Good catch; you're quite right about the strides, and the solution looks good. I've pushed a commit to your branch that adds a couple tests that fail due to this under current master. (Once the CI tests on that pass, this is good to merge).

Add tests with failures under current master due to the invalid strides
set in the test code buffer protocol.
@jagerman jagerman force-pushed the correct-stride-in-matrix-example branch from 4ad8e7d to ebc8abe Compare September 21, 2017 18:51
@jagerman jagerman merged commit a22dd2d into pybind:master Sep 21, 2017
@jagerman
Copy link
Member

Merged! Thanks for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants