When rearranging the order of rows, the row barycenters are calculated and arranged in monotonically increasing order (however, in the case of equal barycenters, the initial order is preserved).
The order of rows is fixed, and when rearranging the order of columns, the column barycenters are calculated and arranged in monotonically increasing order.