FLINT3.7.0-dev

_perm_randtest

Synopsis#include <flint/perm.h>
int _perm_randtest(slong * vec, slong n, flint_rand_t state)source

Sets vec to a uniformly random permutation of length n, generated by the Fisher–Yates shuffle [Dur1964; Knu1997, §3.4.2], and returns its parity.

References#

  • [Dur1964] R. Durstenfeld. Algorithm 235: Random permutation. Communications of the ACM 7(7), 420, 1964.
  • [Knu1997] Knuth, D. E. The Art of Computer Programming, volume 2: Seminumerical algorithms, 1997
Cite this page

The FLINT team, “_perm_randtest (perm.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/perm/_perm_randtest.html (generated 2026-10-20).