Skip to content

Commit 2fb8700

Browse files
committed
allow any range in sortedunion special cases
1 parent 812e221 commit 2fb8700

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/blockbanded/blockbanded.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ function BlockArrays.sortedunion(b, ::AbstractVector{<:PosInfinity})
1313
end
1414
BlockArrays.sortedunion(a::OneToInfCumsum, ::OneToInfCumsum) = a
1515
BlockArrays.sortedunion(a::OneToCumsum, ::OneToCumsum) = a
16-
function BlockArrays.sortedunion(a::RangeCumsum{<:Any,<:InfStepRange}, b::RangeCumsum{<:Any,<:InfStepRange})
16+
function BlockArrays.sortedunion(a::RangeCumsum{<:Any,<:AbstractRange}, b::RangeCumsum{<:Any,<:AbstractRange})
1717
@assert a == b
1818
a
1919
end
2020

2121

22-
function BlockArrays.sortedunion(a::Vcat{Int,1,<:Tuple{Union{Int,AbstractVector{Int}},InfStepRange{Int,Int}}},
23-
b::Vcat{Int,1,<:Tuple{Union{Int,AbstractVector{Int}},InfStepRange{Int,Int}}})
22+
function BlockArrays.sortedunion(a::Vcat{Int,1,<:Tuple{Union{Int,AbstractVector{Int}},<:AbstractRange}},
23+
b::Vcat{Int,1,<:Tuple{Union{Int,AbstractVector{Int}},<:AbstractRange}})
2424
@assert a == b # TODO: generailse? Not sure how to do so in a type stable fashion
2525
a
2626
end

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ include("test_infbanded.jl")
188188
@test BlockArrays.sortedunion([∞],[∞]) == [∞]
189189

190190
b = Vcat([1,2],3:∞)
191+
c = Vcat(1,3:∞)
191192
@test BlockArrays.sortedunion(b,b) b
193+
@test BlockArrays.sortedunion(c,c) c
192194
end
193195
end
194196

0 commit comments

Comments
 (0)