blocks function

Decompose a matrix or edits into independent blocks