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

[BUG] incorrect matrix type casting in concatenation #45498

Closed
GiggleLiu opened this issue May 29, 2022 · 2 comments
Closed

[BUG] incorrect matrix type casting in concatenation #45498

GiggleLiu opened this issue May 29, 2022 · 2 comments

Comments

@GiggleLiu
Copy link
Contributor

This is a bug in nightly, which breaks multiple tests.

julia> using SparseArrays

julia> ds = rand(ComplexF64, 4, 4);

julia> sp = sprand(ComplexF64, 4, 4, 0.5);

julia> vs = [sp, ds];

julia> typeof.(vs)
2-element Vector{DataType}:
 Matrix{ComplexF64} (alias for Array{Complex{Float64}, 2})
 Matrix{ComplexF64} (alias for Array{Complex{Float64}, 2})

In Julia1.7, it does not cast a sparse matrix to a dense matrix.

@fredrikekre fredrikekre changed the title [BUG] incorrect matrix type casting in list comprehension [BUG] incorrect matrix type casting in concatenation May 29, 2022
@fredrikekre
Copy link
Member

See #44096 and in particular discussion in #44096 (comment). See also #43127, which is mentioned in NEWS for release 1.8. Maybe want to use the sparse_cat functions.

@fredrikekre
Copy link
Member

Duplicate of #44821.

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

No branches or pull requests

2 participants