Skip to content

Commit

Permalink
adds CITATION.bib; moves callback calls from push! to push_neighborho…
Browse files Browse the repository at this point in the history
…od! (internal function)
  • Loading branch information
sadit committed Jun 29, 2021
1 parent 5f93416 commit 0e3a440
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SimilaritySearch"
uuid = "053f045d-5466-53fd-b400-a066f88fe02a"
authors = ["Eric S. Tellez <donsadit@gmail.com>"]
version = "0.5.3"
version = "0.5.4"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
19 changes: 10 additions & 9 deletions src/graph/graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,7 @@ function push_neighborhood!(index::SearchGraph, item, L::Vector{Int32})
end

push!(index.links, L)
end

"""
push!(index::SearchGraph, item)
Appends `item` into the index.
"""
function push!(index::SearchGraph, item)
neighbors = find_neighborhood(index, item)
push_neighborhood!(index, item, neighbors)
n = length(index.db)

if n >= index.callback_starting
Expand All @@ -190,6 +181,16 @@ function push!(index::SearchGraph, item)
println(stderr, "added n=$(length(index.db)), neighborhood=$(length(neighbors)), $(string(index.search_algo)), $(typeof(index.neighborhood_algo)), $(now())")
end

end

"""
push!(index::SearchGraph, item)
Appends `item` into the index.
"""
function push!(index::SearchGraph, item)
neighbors = find_neighborhood(index, item)
push_neighborhood!(index, item, neighbors)
neighbors
end

Expand Down

0 comments on commit 0e3a440

Please sign in to comment.