FLINT3.7.0-dev

gr_mat_randpermdiag

Synopsis#include <flint/gr_mat.h>
int gr_mat_randpermdiag(int * parity, gr_mat_t mat, flint_rand_t state, gr_ptr diag, slong n, gr_ctx_t ctx)source

Sets mat to a random row and column permutation of the diagonal matrix whose first nn diagonal entries are given by the vector diag, writing the parity (0 or 1) of the permutation to parity. Returns GR_DOMAIN if the diagonal of mat is shorter than nn.

Cite this page

The FLINT team, “gr_mat_randpermdiag (gr_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_mat/gr_mat_randpermdiag.html (generated 2026-11-02).