Skip to content

Support Vcat(1,2:∞) in sortedunion #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "InfiniteLinearAlgebra"
uuid = "cde9dba0-b1de-11e9-2c62-0bab9446c55c"
version = "0.6.3"
version = "0.6.4"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
8 changes: 4 additions & 4 deletions src/blockbanded/blockbanded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ function BlockArrays.sortedunion(b, ::AbstractVector{<:PosInfinity})
end
BlockArrays.sortedunion(a::OneToInfCumsum, ::OneToInfCumsum) = a
BlockArrays.sortedunion(a::OneToCumsum, ::OneToCumsum) = a
function BlockArrays.sortedunion(a::RangeCumsum{<:Any,<:InfStepRange}, b::RangeCumsum{<:Any,<:InfStepRange})
function BlockArrays.sortedunion(a::RangeCumsum{<:Any,<:AbstractRange}, b::RangeCumsum{<:Any,<:AbstractRange})
@assert a == b
a
end


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

Expand Down
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ include("test_infbanded.jl")
@test BlockArrays.sortedunion(a,a) ≡ a
@test BlockArrays.sortedunion([∞],a) ≡ BlockArrays.sortedunion(a,[∞]) ≡ a
@test BlockArrays.sortedunion([∞],[∞]) == [∞]

b = Vcat([1,2],3:∞)
c = Vcat(1,3:∞)
@test BlockArrays.sortedunion(b,b) ≡ b
@test BlockArrays.sortedunion(c,c) ≡ c
end
end

Expand Down