Skip to content
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

vcat on SparseVector's of different eltype returns a SparseMatrixCSC on v0.6-rc2 #22225

Closed
blegat opened this issue Jun 5, 2017 · 2 comments
Closed
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version sparse Sparse arrays
Milestone

Comments

@blegat
Copy link
Contributor

blegat commented Jun 5, 2017

I would expect the concatenation of sparse vectors to be a sparse vector but it is not the case when their eltype is different

julia> versioninfo()
Julia Version 0.6.0-rc2.0
Commit 68e911b (2017-05-18 02:31 UTC)

julia> vcat(spzeros(2), spzeros(3)) # Same eltype
5-element SparseVector{Float64,Int64} with 0 stored entries

julia> vcat(spzeros(Int, 2), spzeros(3)) # Different eltype
5×1 SparseMatrixCSC{Float64,Int64} with 0 stored entries

This is not a regression since the bug is present in Julia v0.5 too

julia> versioninfo()
Julia Version 0.5.2
Commit f4c6c9d4bb* (2017-05-06 16:34 UTC)

julia> vcat(spzeros(Int, 2), spzeros(Float64, 3))
5×1 sparse matrix with 0 Float64 nonzero entries

EDIT: The following bug is however a regression:

julia> versioninfo()
Julia Version 0.6.0-rc2.0
Commit 68e911b (2017-05-18 02:31 UTC)

julia> vcat(Float64[], spzeros(1))
1×1 SparseMatrixCSC{Float64,Int64} with 0 stored entries
julia> versioninfo()
Julia Version 0.5.2
Commit f4c6c9d4bb* (2017-05-06 16:34 UTC)

julia> vcat(Float64[], spzeros(1))
Sparse vector of length 1 with 0 Float64 nonzero entries:
@ararslan
Copy link
Member

Fixed by #22299 and #22301.

@blegat
Copy link
Contributor Author

blegat commented Jun 11, 2017

Thank you @Sacha0 !

tkelman pushed a commit that referenced this issue Jun 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version sparse Sparse arrays
Projects
None yet
Development

No branches or pull requests

5 participants