I am trying to find a way to check the membership of a user defined type object in a heap. This is the code I have written:
type HeapEntry
k::Int
dist::Float64
end
isless(e1::HeapEntry, e2::HeapEntry) = e1.dist < e2.dist
heap1 = []
Collection.heappush!(heap1, HeapEntry(1, 10.0))
But HeapEntry(1, 10.0) is returning false. Can anyone explain how to do it
correctly?
