I find the documentation of
eachindex a bit confusing when is says that:
If the arrays have different sizes and/or dimensionalities,
eachindexwill return an iterable that spans the largest range along each dimension.
But my undestanding of the implementation of
multidimensional.jl is that all array arguments must have the same length (for linear indexing) or the same axes (for Cartesian indexing) otherwise
eachindex throws a
To me, this means that it is always safe to use
@inbounds for a loop like:
for i in eachindex(A, B, C, D) A[i] = B[i]*C[i] + D[i] end
B etc. are all (abstract) arrays.