Currently, the code for sparse_mul! contains a small error. Whenever there are multiple entries contributing to a single output, the beta parameter will in fact be used that many times.
MWE
using SparseArraysBase: SparseArrayDOK
a = SparseArrayDOK{Float64}(2, 2)
for I in eachindex(a)
a[I] = 1
end
julia> a
2×2 SparseMatrixDOK{Float64, typeof(SparseArraysBase.default_getunstoredindex)}:
1.0 1.0
1.0 1.0
julia> a * a
2×2 SparseMatrixDOK{Float64, typeof(SparseArraysBase.default_getunstoredindex)}:
1.0 1.0
1.0 1.0
julia> Array(a) * Array(a)
2×2 Matrix{Float64}:
2.0 2.0
2.0 2.0
Currently, the code for
sparse_mul!contains a small error. Whenever there are multiple entries contributing to a single output, thebetaparameter will in fact be used that many times.SparseArraysBase.jl/src/abstractsparsearrayinterface.jl
Line 352 in aceca8c
MWE