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 0e3a440 commit 601a4aa
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/graph/graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ function find_neighborhood(index::SearchGraph, item)::Vector{Int32}
end

"""
push_neighborhood!(index::SearchGraph, item, L::AbstractVector{Int32})
push_neighborhood!(index::SearchGraph, item, L::AbstractVector{Int32}; apply_callbacks=true)
Inserts the object `item` into the index, i.e., creates an edge from items listed in L and the
vertex created for ìtem` (internal function)
"""
function push_neighborhood!(index::SearchGraph, item, L::Vector{Int32})
function push_neighborhood!(index::SearchGraph, item, L::Vector{Int32}; apply_callbacks=true)
push!(index.db, item)
n = length(index.db)

Expand All @@ -164,15 +164,17 @@ function push_neighborhood!(index::SearchGraph, item, L::Vector{Int32})

push!(index.links, L)

n = length(index.db)

if n >= index.callback_starting
k = ceil(Int, log(index.callback_logbase, 1+n))
k1 = ceil(Int, log(index.callback_logbase, 2+n))
if k != k1
for (name, callback_object) in index.callback_list
index.verbose && println(stderr, "calling callback ", name, "; n=$n")
callback(callback_object, index)
if apply_callbacks
n = length(index.db)

if n >= index.callback_starting
k = ceil(Int, log(index.callback_logbase, 1+n))
k1 = ceil(Int, log(index.callback_logbase, 2+n))
if k != k1
for (name, callback_object) in index.callback_list
index.verbose && println(stderr, "calling callback ", name, "; n=$n")
callback(callback_object, index)
end
end
end
end
Expand Down

2 comments on commit 601a4aa

@sadit
Copy link
Owner Author

@sadit sadit commented on 601a4aa Jun 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/39894

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.4 -m "<description of version>" 601a4aada02d01e6f6e4f962863f3a46f907567e
git push origin v0.5.4

Please sign in to comment.