File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -471,11 +471,12 @@ end
471471"""
472472 find_intersections(x, y)
473473
474- Returns a `Vector{Vector{Int}}` where the value at index `i` gives the indices to all
475- intervals in `y` that intersect with `x[i]`. Calls collect on the arguments if they
476- aren't already arrays.
474+ Find the intervals in `y` that intersect with intervals in `x`. Returns a vector, `z`, where
475+ each element `z[i]` is a vector of all indices in `y` that intersect with `x[i]`. The values
476+ `x` and `y` should be iterables of intervals.
477477"""
478478find_intersections (x, y) = find_intersections_ (collect (x), collect (y))
479+ find_intersections (x:: AbstractVector , y:: Abstractvector ) = find_intersections_ (x, y)
479480function find_intersections_ (x:: AbstractVector , y:: AbstractVector )
480481 (isempty (x) || isempty (y)) && return Vector{Int}[]
481482 tracking = endpoint_tracking (x, y)
Original file line number Diff line number Diff line change 5454 @test isempty (find_intersections ([], []))
5555 @test_throws MethodError find_intersections ([1 ], [2 ])
5656 @test isempty (find_intersections (Interval[], Interval[]))
57- @test isempty (find_intersections ([1 .. 3 ], Interval []))
58- @test isempty (find_intersections (Interval [], [1 .. 3 ]))
57+ @test isempty (find_intersections ([1 .. 3 ], []))
58+ @test isempty (find_intersections ([], [1 .. 3 ]))
5959
6060 function testsets (a, b)
6161 @test area (a ∪ b) ≤ area (myunion (a)) + area (myunion (b))
You can’t perform that action at this time.
0 commit comments