util.hh: add a copySparseBlock function.