FLINT3.7.0-dev

fmpz_mat_randpermdiag

Synopsis#include <flint/fmpz_mat.h>
int fmpz_mat_randpermdiag(fmpz_mat_t mat, flint_rand_t state, const fmpz * diag, slong n)source

Sets mat to a random permutation of the rows and of the columns of the diagonal matrix whose first n diagonal entries are diag (and whose other entries are zero). Returns the parity of the permutation, 0 if it is even and 1 if it is odd. Requires n \le \min(r, c). Wrapper of gr_mat_randpermdiag.

Cite this page

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