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 matrix annotation types yield dense matrices #17684

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

concatenations involving matrix annotation types yield dense matrices #17684

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

Comments

@Sacha0
Copy link
Member

Sacha0 commented Jul 28, 2016

Ref. #17660. Concatenations involving matrix annotation types (<:AbstractTriangular, Symmetric, Hermitian) yield dense matrices, e.g.

julia> hcat(LowerTriangular(spdiagm(1:4)), LowerTriangular(spdiagm(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(spdiagm(1:4), LowerTriangular(spdiagm(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(LowerTriangular(spdiagm(1:4)), spdiagm(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

whereas they should yield sparse matrices when: (1) a non-annotated matrix/vector argument to the concatenation function is sparse or special; (2) an annotated matrix argument is a sparse or special matrix; or (3) both (1) and (2). Cross reference #15172 and #16722. Best!

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

No branches or pull requests

2 participants