BioJulia / IntervalTrees.jl

A data structure for efficient manipulation of sets of intervals
MIT License
44 stars 17 forks source link

Intersection behaviour for points #56

Open mschauer opened 3 years ago

mschauer commented 3 years ago

I am a bit confused about the following:

julia> collect(intersect(xs, 1))
IntervalValue{Int64, String}[]

julia> collect(intersect(xs, (1,1)))
1-element Vector{IntervalValue{Int64, String}}:
 IntervalValue{Int64, String}
(1,100) => Low

Shouldn't the result be the same?

Wikunia commented 1 year ago

There is no function for this inside this package so it results in calling some generic Base.intersect call

Base.intersect(t::IntervalBTree{K, V, B}, query0, filter::F=true_cmp) where {F, K, V, B} = Base.intersect(t, (query0, query0), filter)

should work as an addition to the package.