Make use of Data.Vector.backpermute in matrix.