@@ -23,11 +23,11 @@ A linear indexing style uses one integer index to describe the position in the a
2323(even if it's a multidimensional array) and column-major
2424ordering is used to efficiently access the elements. This means that
2525requesting [`eachindex`](@ref) from an array that is `IndexLinear` will return
26- a simple one-dimensional range, even if it is multidimensional.
26+ a simple one-dimensional range, even if it is multidimensional.
2727
2828A custom array that reports its `IndexStyle` as `IndexLinear` only needs
2929to implement indexing (and indexed assignment) with a single `Int` index;
30- all other indexing expressions — including multidimensional accesses — will
30+ all other indexing expressions — including multidimensional accesses — will
3131be recomputed to the linear index. For example, if `A` were a `2×3` custom
3232matrix with linear indexing, and we referenced `A[1, 3]`, this would be
3333recomputed to the equivalent linear index and call `A[5]` since `2*1 + 3 = 5`.
@@ -50,13 +50,13 @@ a range of [`CartesianIndices`](@ref).
5050
5151A `N`-dimensional custom array that reports its `IndexStyle` as `IndexCartesian` needs
5252to implement indexing (and indexed assignment) with exactly `N` `Int` indices;
53- all other indexing expressions — including linear indexing — will
53+ all other indexing expressions — including linear indexing — will
5454be recomputed to the equivalent Cartesian location. For example, if `A` were a `2×3` custom
5555matrix with cartesian indexing, and we referenced `A[5]`, this would be
5656recomputed to the equivalent Cartesian index and call `A[1, 3]` since `5 = 2*1 + 3`.
5757
5858It is significantly more expensive to compute Cartesian indices from a linear index than it is
59- to go the other way. The former operation requires division — a very costly operation — whereas
59+ to go the other way. The former operation requires division — a very costly operation — whereas
6060the latter only uses multiplication and addition and is essentially free. This asymmetry means it
6161is far more costly to use linear indexing with an `IndexCartesian` array than it is to use
6262Cartesian indexing with an `IndexLinear` array.
0 commit comments