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

array[::-1] size reported as 0 #77

Open
nbecker opened this issue Jun 15, 2017 · 1 comment
Open

array[::-1] size reported as 0 #77

nbecker opened this issue Jun 15, 2017 · 1 comment

Comments

@nbecker
Copy link
Contributor

nbecker commented Jun 15, 2017

I have a function which accepts nd::Array<complex,1,0> const&. I get the size from
boost::size()

I just noticed that when I pass it a python array
x[::-1]

then boost::size(x) -> 0!

Is this expected? I find it hard to believe that I've been using ndarray for years and never saw this, since I have lots of code that works this way (accepts nd::Array<T,1,0> and uses boost::size)

@TallJimbo
Copy link
Member

I don't think there are any tests for negative strides in ndarray, so I wouldn't be surprised if there is code somewhere that assumes that strides are positive.

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

2 participants