Priority Queue

Types

SeqSpace.PointCloud.PriorityQueue.RankedQueueType
struct RankedQueue{T <: Real, S <: Any}
    rank :: Array{T, 1}
    data :: Array{S, 1}
end

Maintains a priority queue of data. Each datum has a rank that determines it's priority in the queue. rank and data are sorted in ascending order.

Functions

Base.insert!Method
insert!(q::RankedQueue{T}, data::S, rank::T) where {T <: Real, S <: Any}

Push a new element data with priority rank onto the ranked queue q. Rotates the queue until priority is sorted in ascending order.

Base.take!Method
take!(q::RankedQueue)

Pop off the element with element with lowest rank/highest priority.

SeqSpace.PointCloud.PriorityQueue.update!Method
update!(q::RankedQueue{T, S}, data::S, new::T) where {T <: Real, S <: Any}

Change the priority of element data to rank new. Will panic if data is not contained in queue q.