The following functions can be used to exchange the rows and columns of a matrix.
This function exchanges the i-th and j-th rows of the matrix m in-place.
This function exchanges the i-th and j-th columns of the matrix m in-place.
This function exchanges the i-th row and j-th column of the matrix m in-place. The matrix must be square for this operation to be possible.
This function makes the matrix dest the transpose of the matrix src by copying the elements of src into dest. This function works for all matrices provided that the dimensions of the matrix dest match the transposed dimensions of the matrix src.