Alfredo Braunstein
Alfredo Braunstein
Note that * the output `1xN` `SparseMatrixCSC` would not be really sparse (i.e. requires still O(N) storage even if it's completely zero) * empty columns in the input `MxN` `SparseMatrixCSC`...
> > The dims=2 could maybe benefit some, but not sure how this "really really sparse" case is relevant. > > If it helps to illustrate my concrete use case...
Just to simplify the example, your slice looks very similar to `s=sprand(10^7,150,10^-7,i->rand(1:10,i))`. It is a bit extreme, with only ~ 150 nonzeros in 1.5*10^9 entries. The fastest way to sum...
> I totally agree with your remarks; i had in mind to open an issue about at least documenting the requirements on the `rfn` parameter, which is too confusing as...
this is not unexpected IMO: operations that need access to non-stored zero values (e.g. linear operations or broadcast) on a sparse array can only be reasonably implemented for value types...
You're right. Digging a bit, the problem seems to be that arrays are first converted to sparse in broadcast (`_sparsifystructured` in `SparseArrays/src/higherorderfns.jl`)
However, note that the result is a `SparseVector{Vector{Int}}`, so in principle `zero` could still be needed (e.g. to show the matrix on some displays). So I'm still not sure if...
> Sounds like a very interesting idea. It would require to have the non-zero struture depend on the values (i.e. test each produced value for nullity), so I wonder whether...