Given a vector v of length N^2 that holds the entries of a NxN matrix M, what is the fastest way to compute the transpose of M in the same vector representation using NumPy?
I know this can be done by
v.reshape(N, N).T.flatten()
but is this the fastest way?
I am not interested in the intermediate explicit form of M.