diff --git a/Project.toml b/Project.toml index 10ac9c8..5445373 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Strided" uuid = "5e0ebb24-38b0-5f93-81fe-25c709ecae67" authors = ["Lukas Devos ", "Maarten Van Damme ", "Jutho Haegeman "] -version = "2.1.0" +version = "2.1.1" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/mapreduce.jl b/src/mapreduce.jl index 7eb6d1e..6b33274 100644 --- a/src/mapreduce.jl +++ b/src/mapreduce.jl @@ -428,11 +428,11 @@ function indexorder(strides::NTuple{N,Int}) where {N} # returns order such that strides[i] is the order[i]th smallest element of strides, not # counting zero strides zero strides have order 1 return ntuple(Val(N)) do i - si = strides[i] + si = abs(strides[i]) si == 0 && return 1 k = 1 for s in strides - if s != 0 && s < si + if s != 0 && abs(s) < si k += 1 end end