Initialises the permutation for use.
Clears the permutation.
Sets the permutation res to the same as the permutation vec.
Sets the permutation to the identity permutation.
Sets res to the inverse permutation of vec.
Allows aliasing of res and vec.
Forms the composition \(\pi_1 \circ \pi_2\) of two permutations
\(\pi_1\) and \(\pi_2\). Here, \(\pi_2\) is applied first, that is,
\((\pi_1 \circ \pi_2)(i) = \pi_1(\pi_2(i))\).
Allows aliasing of res, vec1 and vec2.
Returns the parity of vec, 0 if the permutation is even and 1 if
the permutation is odd.
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.
Prints the permutation vector of length \(n\) to stdout.
Integers mod n : detailed table of contents
qfb.h – binary quadratic forms