-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix #17675 (concatenations involving special matrices) and #17738 (concatenations involving sparse vectors) #17685
Conversation
symtridiagmat = SymTridiagonal(ones(N), ones(N-1)) | ||
specialmats = (diagmat, bidiagmat, tridiagmat, symtridiagmat) | ||
for specialmata in specialmats, specialmatb in specialmats | ||
@test issparse(hcat(specialmata, specialmatb)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why typeof
everywhere but here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Derp during fixup is why. Fixed. Thanks!
dc82d11
to
b2523ae
Compare
With #17690 merged, I rebased and extended this PR to fix |
Now addresses #17738 as well. Best! |
…pecial matrices, sparse matrices, or dense matrices/vectors yield sparse arrays.
…ious matrix and vector types consistently yield sparse arrays.
Rebased for 0.6. Best! |
Thanks! |
This is a behavior change and probably not a candidate for backporting. |
This pull request's first commit addresses JuliaLang/LinearAlgebra.jl#349 by making
hcat
,vcat
,hvcat
, andcat
yield sparse arrays when operating on combinations of special matrices with special matrices, sparse matrices, or dense matrices/vectors.This pull request's second commit addresses #17738 by making concatenations involving sparse matrices more consistently yield sparse arrays, concatenations involving both sparse vectors and special matrices included.
This pull request does not fix the behavior of combinations involving annotation/wrapper/view types such as
<:AbstractTriangular
(see JuliaLang/LinearAlgebra.jl#350).Ref. #17660. Best! (Edits: Rewritten for PR scope expansion.)