Skip to content

Commit

Permalink
Support more vcat with Fill (#59)
Browse files Browse the repository at this point in the history
* Support more vcat with Fill

* add tests

* Update runtests.jl
  • Loading branch information
dlfivefifty authored Feb 3, 2021
1 parent 1fea087 commit 667656f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "InfiniteArrays"
uuid = "4858937d-0d70-526a-a4dd-2d5cb5dd786c"
version = "0.9.1"
version = "0.9.2"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
6 changes: 4 additions & 2 deletions src/InfiniteArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ for Typ in (:Number, :AbstractVector)
end
end

vcat(a::AbstractMatrix, b::AbstractFill{<:Any,2,<:Tuple{OneToInf,OneTo}}) =
Vcat(a, b)
vcat(a::AbstractVector, b::AbstractVector, c::AbstractFill{<:Any,1,<:Tuple{OneToInf}}) = Vcat(vcat(a,b), c)
vcat(a::AbstractVector, b::AbstractVector, c::AbstractVector, d::AbstractFill{<:Any,1,<:Tuple{OneToInf}}) = Vcat(vcat(a,b,c), d)

vcat(a::AbstractMatrix, b::AbstractFill{<:Any,2,<:Tuple{OneToInf,OneTo}}) = Vcat(a, b)

cat_similar(A, T, shape::Tuple{Infinity}) = zeros(T,∞)
cat_similar(A::AbstractArray, T, shape::Tuple{Infinity}) =
Expand Down
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,11 @@ end
@test [1; 2; 3; zeros(Int,∞)] isa CachedArray
@test [[1,2]; 3; zeros(Int,∞)] isa CachedArray
@test [2; [1,2]; 3; zeros(Int,∞)] isa CachedArray

@test [[1,2]; [3,4]; Zeros(∞)] isa Vcat{<:Any,1,<:Tuple{Array,Zeros}}
@test [[1,2]; [3,4]; [5,6]; Zeros(∞)] isa Vcat{<:Any,1,<:Tuple{Array,Zeros}}

@test [randn(2,2); Zeros(∞,2)] isa Vcat{<:Any,2,<:Tuple{Array,Zeros}}
end

@testset "sparse print" begin
Expand Down

2 comments on commit 667656f

@dlfivefifty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/29267

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.2 -m "<description of version>" 667656f1bdd75f3b2d72c0b2d185879d60ab2a90
git push origin v0.9.2

Please sign in to comment.