Update matrix block inplace from a sparse array

I’ve been looking for this as well, and it looks like there’s some related work and interest from others. There is a related feature SparseArrays.sparse! (not exported) which allows you to get halfway there by specifying some pre-allocated arrays for the construction of sparse matrices.

I haven’t found a good solution for full in-place updates, however. As far as I can tell, it’s possible to do fully in-place sparse matrix updates by directly modifying rowptr,colptr,nzval, but more complicated when accounting for general sparse matrix functionality like combining repeated entries and sorted/unsorted representations.

1 Like