Sha256: 0d748c07b6d1fcdf90fc045ead04f6658536799be864af626b41b8038a2bfc43
Contents?: true
Size: 382 Bytes
Versions: 6
Compression:
Stored size: 382 Bytes
Contents
#!/usr/bin/env ruby require("gsl") N = 10 pp = GSL::Permutation.alloc(N) GSL::Rng::env_setup() r = GSL::Rng.alloc("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");
Version data entries
6 entries across 6 versions & 2 rubygems