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

SubArray indexing with (integer valued) floats is broken #3148

Closed
toivoh opened this issue May 19, 2013 · 0 comments
Closed

SubArray indexing with (integer valued) floats is broken #3148

toivoh opened this issue May 19, 2013 · 0 comments

Comments

@toivoh
Copy link
Contributor

toivoh commented May 19, 2013

Some examples:

julia> sub(eye(4),1:2,1:2)[1.0,1.0]
ERROR: indexing not defined for Range1{Int64}
 in error at error.jl:22
 in getindex at abstractarray.jl:475
 in translate_indexes at subarray.jl:210
 in getindex at subarray.jl:248

julia> sub(eye(4),1:2,1:2)[1.0]
ERROR: no method ind2sub((Int64,Int64),Float64)
 in translate_linear_indexes at subarray.jl:228
 in translate_indexes at subarray.jl:208
 in getindex at subarray.jl:248

julia> sub(eye(4),1:2:4,1:2:4)[1.0,1.0]
ERROR: reshape: invalid dimensions
 in reshape at array.jl:140
 in getindex at subarray.jl:255

julia> sub(eye(4),1:2:4,1:2:4)[1.0]
ERROR: reshape: invalid dimensions
 in reshape at array.jl:140
 in getindex at subarray.jl:255

The same examples with 1 as index instead of 1.0 work as expected.

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