#!/usr/bin/env ruby
require("gsl")

N = 10
pp = Permutation.new(N)
GSL::Rng::env_setup()
r = Rng.new("gsl_rng_default")

puts("initial permutation:")
pp.init
pp.fprintf(STDOUT, " %u")
printf("\n")

puts(" random permutation:");  
r.shuffle(pp)
pp.fprintf(STDOUT, " %u")
printf("\n");

puts("inverse permutation:");  
q = pp.inverse
q.fprintf(STDOUT, " %u")
printf ("\n");
