Skip to content

Commit 6101da2

Browse files
committed
map linear indices to linear parent indices
1 parent c97446f commit 6101da2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wrappers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function index_to_parentindex(a::AbstractArray{<:Any,N}, I::Vararg{Int,N}) where
2525
end
2626
# Handle linear indexing.
2727
function index_to_parentindex(a::AbstractArray, I::Int)
28-
return index_to_parentindex(a, CartesianIndices(a)[I])
28+
return LinearIndices(parent(a))[index_to_parentindex(a, CartesianIndices(a)[I])]
2929
end
3030

3131
function cartesianindex_reverse(I::CartesianIndex)

0 commit comments

Comments
 (0)