In the following, we assume that the "N"×"M" matrix is stored in row-major order with zero-based indices. This means that the ("n","m") element, for "n" = 0...,"N"−1 and "m" = 0...,"M"−1, is stored at an address "a" = "Mn" + "m" (plus some offset in memory, which we ignore). In the transposed "M"×"N" matrix, the corresponding ("m","n") element is stored at the address "a' " = "Nm" + "n", again in row-major order. We define the "transposition permutation" to be the function "a' " = "P"("a") such that: