Skip to content

Commit 1e20f7b

Browse files
Moelfgraeme-a-stewart
authored andcommitted
format
1 parent ea7ed5c commit 1e20f7b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/Utils.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ array.
133133
- `dij_min`: The minimum value in the first `n` elements of the `dij` array.
134134
- `best`: The index of the minimum value in the `dij` array.
135135
"""
136-
function fast_findmin(dij::DenseVector{T}, n) where T
136+
function fast_findmin(dij::DenseVector{T}, n) where {T}
137137
laneIndices = SIMD.Vec{8, Int}((1, 2, 3, 4, 5, 6, 7, 8))
138138
minvals = SIMD.Vec{8, T}(Inf)
139139
min_indices = SIMD.Vec{8, Int}(0)
@@ -152,15 +152,18 @@ function fast_findmin(dij::DenseVector{T}, n) where T
152152
end
153153

154154
min_value = SIMD.minimum(minvals)
155-
min_index = @inbounds min_value == minvals[1] ? min_indices[1] : min_value == minvals[2] ? min_indices[2] :
156-
min_value == minvals[3] ? min_indices[3] : min_value == minvals[4] ? min_indices[4] :
157-
min_value == minvals[5] ? min_indices[5] : min_value == minvals[6] ? min_indices[6] :
158-
min_value == minvals[7] ? min_indices[7] : min_indices[8]
155+
min_index = @inbounds min_value == minvals[1] ? min_indices[1] :
156+
min_value == minvals[2] ? min_indices[2] :
157+
min_value == minvals[3] ? min_indices[3] :
158+
min_value == minvals[4] ? min_indices[4] :
159+
min_value == minvals[5] ? min_indices[5] :
160+
min_value == minvals[6] ? min_indices[6] :
161+
min_value == minvals[7] ? min_indices[7] : min_indices[8]
159162

160163
@inbounds @fastmath for _ in 1:remainder
161164
xi = dij[i]
162165
pred = dij[i] < min_value
163-
min_value= ifelse(pred, xi, min_value)
166+
min_value = ifelse(pred, xi, min_value)
164167
min_index = ifelse(pred, i, min_index)
165168
i += 1
166169
end

0 commit comments

Comments
 (0)