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

Change xindexview to take multiple xarrays instead of vector of xindex #517

Open
wolfv opened this issue Nov 2, 2017 · 0 comments
Open

Comments

@wolfv
Copy link
Member

wolfv commented Nov 2, 2017

We could change xindexview to work with vectors of indices instead of a vector of xindex, as numpy does. I.e. instead of taking std::vector<xindex>, we could take a number of xt::xarray<size_t> vectors, one per dimension.

Then, when resolving to the index, we just have to multiply with the corresponding stride, which should be fast in e.g. the assignment loop.
We could also store the offsets instead of the vectors, and calculate a shape and reuse the xstridedview to also resolve cases where the number of supplied vectors is lower than the dimension.
However, it feels that this would come at a cost for the case where scalar elements are selected.

@wolfv wolfv modified the milestone: 0.16.0 Apr 20, 2018
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

No branches or pull requests

1 participant