Closed tlnagy closed 5 years ago
Thoughts @mbauman?
Good catch!
That example should be changed to for iter in CartesianRange(indices(B))
. eachindex
is deliberately not guaranteed to return a CartesianIndex
.
The original eachindex
code had the following comment: # traverses in storage order for cache efficiency
is that true for the CartesianRange
code as well?
Yes, at least for anything that's not a PermutedDimsArray
.
The last example in the readme:
doesn't work under Julia 0.6. It gives a bounds error:
I believe this is due to
eachindex
returning a single value instead of a tuple. This is likely because it is using fast linear indexing instead of Cartesian indexing. What would the updated version of this code look like? @timholy