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

concatenations involving special matrices yield dense matrices #17675

Closed
Sacha0 opened this issue Jul 28, 2016 · 0 comments
Closed

concatenations involving special matrices yield dense matrices #17675

Sacha0 opened this issue Jul 28, 2016 · 0 comments
Labels
linear algebra Linear algebra types and dispatch Types, subtyping and method dispatch

Comments

@Sacha0
Copy link
Member

Sacha0 commented Jul 28, 2016

Ref. #17660. Concatenations involving special matrices yield dense matrices, e.g.

julia> hcat(Diagonal(1:4), Diagonal(1:4))
4×8 Array{Int64,2}:
 1  0  0  0  1  0  0  0
 0  2  0  0  0  2  0  0
 0  0  3  0  0  0  3  0
 0  0  0  4  0  0  0  4

julia> hcat(sprand(4, 4, 0.5), Diagonal(1:4))
4×8 Array{Float64,2}:
 0.638976  0.0  0.0       0.46798   1.0  0.0  0.0  0.0
 0.0       0.0  0.0       0.0       0.0  2.0  0.0  0.0
 0.0       0.0  0.906125  0.172851  0.0  0.0  3.0  0.0
 0.0       0.0  0.508749  0.484722  0.0  0.0  0.0  4.0

whereas they should yield sparse matrices. Best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

2 participants