perm.h – permutations¶
Memory management¶
Assignment¶
Composition¶
Parity¶
Randomisation¶
-
int _perm_randtest(slong *vec, slong n, flint_rand_t state)¶
Generates a random permutation vector of length \(n\) and returns its parity, 0 or 1.
This function uses the Knuth shuffle algorithm to generate a uniformly random permutation without retries.