Skip to content

Commit 808d4a8

Browse files
authored
Support Vcat(1,2:∞) in sortedunion (#97)
* Support Vcat(1,2:∞) in sortedunion * Update runtests.jl * allow any range in sortedunion special cases
1 parent eca72e7 commit 808d4a8

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "InfiniteLinearAlgebra"
22
uuid = "cde9dba0-b1de-11e9-2c62-0bab9446c55c"
3-
version = "0.6.3"
3+
version = "0.6.4"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/blockbanded/blockbanded.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ 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{<:AbstractVector{Int},InfStepRange{Int,Int}}},
23-
b::Vcat{Int,1,<:Tuple{<:AbstractVector{Int},InfStepRange{Int,Int}}})
24-
@assert a == b
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}})
24+
@assert a == b # TODO: generailse? Not sure how to do so in a type stable fashion
2525
a
2626
end
2727

test/runtests.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ include("test_infbanded.jl")
186186
@test BlockArrays.sortedunion(a,a) a
187187
@test BlockArrays.sortedunion([∞],a) BlockArrays.sortedunion(a,[∞]) a
188188
@test BlockArrays.sortedunion([∞],[∞]) == [∞]
189+
190+
b = Vcat([1,2],3:∞)
191+
c = Vcat(1,3:∞)
192+
@test BlockArrays.sortedunion(b,b) b
193+
@test BlockArrays.sortedunion(c,c) c
189194
end
190195
end
191196

0 commit comments

Comments
 (0)