Skip to content

Commit

Permalink
Fix type instability in make_knn_heaps
Browse files Browse the repository at this point in the history
  • Loading branch information
dillondaudert committed Jul 25, 2019
1 parent 97c93b3 commit d66457b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ function make_knn_heaps(data::Vector{V},
M <: SemiMetric}
np = length(data)
D = result_type(metric, data[1], data[1])
knn_heaps = [BinaryMaxHeap{NNTuple{Int, D}}() for _ in 1:np]
HeapType = BinaryMaxHeap{NNTuple{Int, D}}
knn_heaps = HeapType[HeapType() for _ in 1:np]
for i in 1:np
k_idxs = sample_neighbors(np, n_neighbors, exclude=[i])
for j in k_idxs
Expand Down

0 comments on commit d66457b

Please sign in to comment.