Hashed Matrix Transposition

Using hash function (Ki%N) 
where:
     K = number of columns
     i = current element
     N = (number of elements) - 1
for an MN 1D array to do an in-place transposition from column major to row major.

i.e. an array holding values (a1,a2,a3...an,b1,b2,b3...bn,c1,c2,c3...cn)
will be transposed in-place into form
(a1,b1,c1,a2,b2,c2,a3,b3,c3...an,bn,cn)