SparseArrays.jl
SparseArrays.jl copied to clipboard
Inconsistent addition between sparse and dense
julia> spzeros(2) + [1.4, 3]
2-element SparseVector{Float64, Int64} with 2 stored entries:
⋮
[2] = 3.0
julia> spzeros(2,2) +
[1.4 3
0 2]
2×2 Matrix{Float64}:
1.4 3.0
0.0 2.0
The matrix behavior seems to be the most sensible, assuming that adding a dense and a sparse will yield something sparse seems very risky
Agree. Having a dense result is the sensible- since one of the inputs was already dense.