Skip to content

Commit

Permalink
Set supertype of PermutedCartesianIndices
Browse files Browse the repository at this point in the history
This makes `PermutedCartesianIndices` a subtype of
`AbstractArray{CartesianIndex{N},N}`, to be consistent with the
defintion of `CartesianIndices`.
  • Loading branch information
jipolanco committed May 9, 2020
1 parent acb39d2 commit 5a99360
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/PencilArrays/cartesian_indices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ end

# We make CartesianIndices(::PencilArray) return a PermutedCartesianIndices,
# which loops faster (in memory order) when there are index permutations.
struct PermutedCartesianIndices{N, C <: CartesianIndices{N}, Iperm,
Offsets}
struct PermutedCartesianIndices{
N, C <: CartesianIndices{N}, Iperm,
Offsets} <: AbstractArray{CartesianIndex{N}, N}
data :: C # indices in permuted order
iperm :: Iperm # inverse permutation
offsets :: Offsets
Expand Down

0 comments on commit 5a99360

Please sign in to comment.