Hi,

I have to sort some matrix by different option. It is not about the method really but something with uncommon options. I explain :
I have N matrix of the same size. I want to sort the i-th column of the k-th matrix and duplicate the rearrangement to each other columns and matrix.
Example :

00 20 05 10 07 06 03 04 10 12
03 40 08 02 23 | 50 17 01 10 15
06 30 14 19 33 | 00 18 02 21 34
39 15 00 11 08 16 07 04 22 40

should be sort on reference of the 0th matrix with the 3th column which give :

39 15 00 11 08 16 07 04 22 40
00 20 05 10 07 | 06 03 04 10 12
03 40 08 02 23 | 50 17 01 10 15
06 30 14 19 33 00 18 02 21 34


What type of algorithm already exist which can do that? And How?