You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Base.intersect can accept multiple arguments, but Intervals.intersect only accepts two.
This is limiting if one wants to compute the intersection of multiple intervals at the same time.
MWE
julia>intersect(1..10, 1..3, 1..6)
ERROR: MethodError: no method matching length(::Interval{Int64, Closed, Closed})
Closest candidates are:length(::Union{Base.KeySet, Base.ValueIterator}) at abstractdict.jl:58length(::Union{LinearAlgebra.Adjoint{T, S}, LinearAlgebra.Transpose{T, S}}where {T, S}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/adjtrans.jl:195length(::Union{DataStructures.OrderedRobinDict, DataStructures.RobinDict}) at /Users/glenn/.julia/packages/DataStructures/ixwFs/src/ordered_robin_dict.jl:86...
Stacktrace:
[1] union!(s::Set{Int64}, itr::Interval{Int64, Closed, Closed})
@ Base ./abstractset.jl:89
[2] Set{Int64}(itr::Interval{Int64, Closed, Closed})
@ Base ./set.jl:10
[3] _Set(itr::Interval{Int64, Closed, Closed}, #unused#::Base.HasEltype)
@ Base ./set.jl:23
[4] Set(itr::Interval{Int64, Closed, Closed})
@ Base ./set.jl:21
[5] _shrink(shrinker!::Function, itr::Interval{Int64, Closed, Closed}, itrs::Tuple{Interval{Int64, Closed, Closed}, Interval{Int64, Closed, Closed}})
@ Base ./array.jl:2607
[6] intersect(::Interval{Int64, Closed, Closed}, ::Interval{Int64, Closed, Closed}, ::Interval{Int64, Closed, Closed})
@ Base ./array.jl:2611
[7] top-level scope
@ REPL[128]:1
Compared to Base.intersect
julia>intersect(1:10, 1:3, 1:6)
1:3
The text was updated successfully, but these errors were encountered:
Base.intersect
can accept multiple arguments, butIntervals.intersect
only accepts two.This is limiting if one wants to compute the intersection of multiple intervals at the same time.
MWE
Compared to
Base.intersect
The text was updated successfully, but these errors were encountered: