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

Fix #17675 (concatenations involving special matrices) and #17738 (concatenations involving sparse vectors) #17685

Merged
merged 2 commits into from
Aug 7, 2016

Conversation

Sacha0
Copy link
Member

@Sacha0 Sacha0 commented Jul 28, 2016

This pull request's first commit addresses JuliaLang/LinearAlgebra.jl#349 by making hcat, vcat, hvcat, and cat 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.)

@kshyatt kshyatt added the linear algebra Linear algebra label Jul 28, 2016
symtridiagmat = SymTridiagonal(ones(N), ones(N-1))
specialmats = (diagmat, bidiagmat, tridiagmat, symtridiagmat)
for specialmata in specialmats, specialmatb in specialmats
@test issparse(hcat(specialmata, specialmatb))
Copy link
Contributor

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?

Copy link
Member Author

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!

@Sacha0 Sacha0 force-pushed the specialcat branch 2 times, most recently from dc82d11 to b2523ae Compare July 29, 2016 23:24
@Sacha0
Copy link
Member Author

Sacha0 commented Jul 29, 2016

With #17690 merged, I rebased and extended this PR to fix cat too. Also corrected a few typos. Thanks!

@Sacha0 Sacha0 changed the title partial fix for #17675 (concatenation of special matrices) Fix #17675 (concatenation involving special matrices) and #17738 (concatenations involving sparse vectors) Aug 1, 2016
@Sacha0
Copy link
Member Author

Sacha0 commented Aug 1, 2016

Now addresses #17738 as well. Best!

Sacha0 added 2 commits August 6, 2016 10:39
…pecial matrices, sparse matrices, or dense matrices/vectors yield sparse arrays.
…ious matrix and vector types consistently yield sparse arrays.
@Sacha0 Sacha0 changed the title Fix #17675 (concatenation involving special matrices) and #17738 (concatenations involving sparse vectors) Fix #17675 (concatenations involving special matrices) and #17738 (concatenations involving sparse vectors) Aug 6, 2016
@Sacha0
Copy link
Member Author

Sacha0 commented Aug 6, 2016

Rebased for 0.6. Best!

@tkelman tkelman merged commit 42c1b95 into JuliaLang:master Aug 7, 2016
@Sacha0
Copy link
Member Author

Sacha0 commented Aug 7, 2016

Thanks!

@Sacha0 Sacha0 deleted the specialcat branch August 7, 2016 15:33
@tkelman
Copy link
Contributor

tkelman commented Aug 7, 2016

This is a behavior change and probably not a candidate for backporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants