Skip to content

Commit 06d8361

Browse files
authored
Changed explicit 0s to zero(eltype(m)) to be compatible with Unitful (#229)
1 parent 47dcb61 commit 06d8361

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/generic.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function _pairwise!(r::AbstractMatrix, metric::SemiMetric, a)
200200
r[i, j] = if i > j
201201
metric(ai, aj)
202202
elseif i == j
203-
0
203+
zero(eltype(r))
204204
else
205205
r[j, i]
206206
end
@@ -216,7 +216,7 @@ function _pairwise!(r::AbstractMatrix, metric::SemiMetric, a::AbstractMatrix)
216216
for i = 1:(j - 1)
217217
r[i, j] = r[j, i] # leveraging the symmetry of SemiMetric
218218
end
219-
r[j, j] = 0
219+
r[j, j] = zero(eltype(r))
220220
aj = view(a, :, j)
221221
for i = (j + 1):n
222222
r[i, j] = metric(view(a, :, i), aj)

0 commit comments

Comments
 (0)