From 0e3a4402e69f0fb45049ff72ae70d951bd17b1be Mon Sep 17 00:00:00 2001 From: "Eric S. Tellez" Date: Tue, 29 Jun 2021 12:05:11 -0500 Subject: [PATCH] adds CITATION.bib; moves callback calls from push! to push_neighborhood! (internal function) --- Project.toml | 2 +- src/graph/graph.jl | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Project.toml b/Project.toml index de6434a..eef3b0b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SimilaritySearch" uuid = "053f045d-5466-53fd-b400-a066f88fe02a" authors = ["Eric S. Tellez "] -version = "0.5.3" +version = "0.5.4" [deps] DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" diff --git a/src/graph/graph.jl b/src/graph/graph.jl index f6282b6..5baa628 100644 --- a/src/graph/graph.jl +++ b/src/graph/graph.jl @@ -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 @@ -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