FLINT3.7.0-dev

fq_nmod_mat_randpermdiag

Synopsis#include <flint/fq_nmod_mat.h>
int fq_nmod_mat_randpermdiag(fq_nmod_mat_t mat, flint_rand_t state, fq_nmod_struct * diag, slong n, const fq_nmod_ctx_t ctx)

Sets mat to a random row and column permutation of the diagonal matrix whose first n diagonal entries are diag and whose other entries are zero; n must not exceed the number of rows or columns. Returns the parity of the permutation (0 for even, 1 for odd).

Generated from the same template as fq_mat_randpermdiag, whose documentation has the details.

Cite this page

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