Hello,

A few days ago, I discovered in this discussion that there is seemingly no way of inverting structured sparse matrices in Julia. We say that a matrix A is **morally block diagonal** if there are permutation matrices P,Q such that PAQ is block diagonal. Such matrices have sparse inverses and commonly occur in PDEs, particularly in the area of H-matrix preconditioners, etc…

Manually tracking the block structure (which may be “encrypted” by permutations P and Q) is tedious and error-prone, and unnecessary, since the usual sparse solvers can be adapted to invert such matrices efficiently. This is what module SparseSparse does. The name is because it’s a Sparse system with a Sparse right-hand-side.

I was surprised to see that my implementation is fairly efficient. On the problem A\b with a dense vector b, converting b to a sparse vector and then using completely sparse algorithms is about half the speed of the builtin solver for a dense vector b.

I’m not sure my code has the same quality as whatever is builtin to Julia but maybe it can be an inspiration and encouragement to have builtin inverses and solvers for sparse right-hand-sides?

Here is an example:

```
julia> using SparseSparse, SparseArrays
A = sparse([2 3 0 0
4 5 0 0
0 0 6 7
0 0 8 9.0])
inv(A)
4×4 SparseMatrixCSC{Float64, Int64} with 8 stored entries:
-2.5 1.5 ⋅ ⋅
2.0 -1.0 ⋅ ⋅
⋅ ⋅ -4.5 3.5
⋅ ⋅ 4.0 -3.0
```

Hopefully this is helpful to someone.