The definitions here and here cause
julia> VERSION
v"0.6.0-dev.1092"
julia> broadcast((x,y) -> sin(x) + cos(y), speye(5), speye(5))
5脳5 sparse matrix with 5 Float64 nonzero entries:
[1, 1] = 1.38177
[2, 2] = 1.38177
[3, 3] = 1.38177
[4, 4] = 1.38177
[5, 5] = 1.38177
julia> broadcast((x,y) -> sin(x) + cos(y), Array(speye(5)), Array(speye(5)))
5脳5 Array{Float64,2}:
1.38177 1.0 1.0 1.0 1.0
1.0 1.38177 1.0 1.0 1.0
1.0 1.0 1.38177 1.0 1.0
1.0 1.0 1.0 1.38177 1.0
1.0 1.0 1.0 1.0 1.38177
Best!
Ouch. Yet another reason that all the sparse broadcast methods should be replaced with a unified approach that (a) assumes purity, (b) checks f(0...), and (c) always returns a SparseMatrixCSC even if the output is dense, as we've discussed in #18590.
Ouch. Yet another reason that all the sparse broadcast methods should be replaced with a unified approach that (a) assumes purity, (b) checks f(0...), and (c) always returns a SparseMatrixCSC even if the output is dense, as we've discussed in #18590.
Agreed. Discovered this bug while experimenting with an implementation; look for more from me shortly :). Best!
I believe this one is already fixed. Right?
I believe this one is already fixed. Right?
Yes, happily fixed :).
Most helpful comment
Agreed. Discovered this bug while experimenting with an implementation; look for more from me shortly :). Best!