I have a matrix that I am building up block-wise, like so:
parts = Matrix{SparseMatrixCSC{Float64}}(undef, r, r)
for i in 1:r
for k in 1:r
parts[i, k] = make_part(i, k)
end
end
Now I'd like to concatenate all these parts into a larger matrix, with each block in its place. Is there a way to do this using the concatenation functions in Base? I can't figure out how to use cat to do it. For example, reduce((a, acc) -> cat(acc, a, dims=(1, 2), parts) will create a block-diagonal matrix with r^2 blocks on the diagonal.