Skip to content

Commit 8dc8b0b

Browse files
committed
fix indexorder for negative strides
1 parent cf0a5b9 commit 8dc8b0b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Strided"
22
uuid = "5e0ebb24-38b0-5f93-81fe-25c709ecae67"
33
authors = ["Lukas Devos <[email protected]>", "Maarten Van Damme <[email protected]>", "Jutho Haegeman <[email protected]>"]
4-
version = "2.1.0"
4+
version = "2.1.1"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/mapreduce.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,11 @@ function indexorder(strides::NTuple{N,Int}) where {N}
428428
# returns order such that strides[i] is the order[i]th smallest element of strides, not
429429
# counting zero strides zero strides have order 1
430430
return ntuple(Val(N)) do i
431-
si = strides[i]
431+
si = abs(strides[i])
432432
si == 0 && return 1
433433
k = 1
434434
for s in strides
435-
if s != 0 && s < si
435+
if s != 0 && abs(s) < si
436436
k += 1
437437
end
438438
end

0 commit comments

Comments
 (0)