Group the elements of the matrix into smaller matrices. Transpose the location of the smaller matrices, and then transpose the elements of those matrices themselves.
This method has the advantage of being recursive, so we only need to know how to transpose certain shapes. The base-cases for the recursion is simple: single numbers and 2x2s. The transpose of a single number is the number itself because you can treat it as a one-by-one matrix and thus the number itself is on the diagonal and does not move under transposition, and the transpose of a 2-by-2 is trivial.
Additionally, this implementing this method automatically implements the fact that if the matrix is block-diagonal, you can simply transpose the blocks.
If it isn't too much trouble, could you walk me through the 2 by 2 transpose? I don't quite find it trivial. Though the block diagonalizing idea is interesting - will need to spend some more time on it.
ReplyDelete