permute package:hmatrix-gsl-stats

apply the permutation to a vector
apply the inverse permutation to a vector
generate a random permutation