aggregate_pieces_byname function

Aggregate a matrix by pieces of row and/or column names