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

hcat between sparse matrix and sparse vector #16661

Closed
blegat opened this issue May 30, 2016 · 4 comments
Closed

hcat between sparse matrix and sparse vector #16661

blegat opened this issue May 30, 2016 · 4 comments
Labels
sparse Sparse arrays

Comments

@blegat
Copy link
Contributor

blegat commented May 30, 2016

I would have imagined that concatenating a sparse matrix and a sparse vector would yield a sparse matrix but apparently this is not the case

Version 0.5.0-dev+4154 (2016-05-18 11:17 UTC)
Commit 778740e (11 days old master)
julia> [spzeros(2,2) spzeros(2)]
2×3 Array{Float64,2}:
 0.0  0.0  0.0
 0.0  0.0  0.0
julia> methods(hcat)
hcat(X::SparseMatrixCSC...) at sparse/sparsematrix.jl:2857
hcat{Tv,Ti}(X::AbstractSparseArray{Tv,Ti,1}...) at sparse/sparsevector.jl:704

It seems that there is no specific method so the general hcat is called. Is that on purpose or is there a definition missing ?

@tkelman tkelman added the sparse Sparse arrays label May 30, 2016
@tkelman
Copy link
Contributor

tkelman commented May 30, 2016

The latter I think. A missed case from #15172.

@blegat
Copy link
Contributor Author

blegat commented May 30, 2016

Note that #15172 was closed 10 days ago and that nightly ubuntu's build are 11 days old, can you reproduce it on master ?

@zhmz90
Copy link
Contributor

zhmz90 commented May 30, 2016

It still exists on master.

julia> [spzeros(2,2) spzeros(2)]
2×3 Array{Float64,2}:
 0.0  0.0  0.0
 0.0  0.0  0.0

julia> versioninfo()
Julia Version 0.5.0-dev+4393
Commit 15626c3* (2016-05-29 22:12 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

@pkofod
Copy link
Contributor

pkofod commented Jun 1, 2016

Hm, as far as I remember, it was kind of on purpose. When I started working on the pr, I don't think sparse vec cat worked at all, I think it's in the discussion somewhere. I can make a pr to fix it.

edit found my comment #15172 (comment)

"I havn't done anything about the fact that [spvector spmatrix] doesn't exist, as it should probably be a different PR."

I'm on it.

edit2 I have a fix, but My computer is offline, and my phones internet sharing is broken. Will make a pr asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sparse Sparse arrays
Projects
None yet
Development

No branches or pull requests

4 participants