fmpz_mod_mat_randrank
Synopsis
#include <flint/fmpz_mod_mat.h>void fmpz_mod_mat_randrank(fmpz_mod_mat_t mat, flint_rand_t state, slong rank, const fmpz_mod_ctx_t ctx)sourceSets mat to a random sparse matrix of the given rank: rank random nonzero residues placed in distinct rows and columns, the other entries zero. For prime n the rank is exactly rank. Throws an exception if rank is negative or exceeds a dimension. fmpz_mod_mat_randops turns the result into a dense matrix of the same rank.
Cite this page
The FLINT team, “fmpz_mod_mat_randrank (fmpz_mod_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz_mod_mat/fmpz_mod_mat_randrank.html (generated 2026-10-20).
@misc{flint-doc-fmpz-mod-mat-fmpz-mod-mat-randrank,
author = {{The FLINT team}},
title = {{fmpz\_mod\_mat\_randrank (fmpz\_mod\_mat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpz_mod_mat/fmpz_mod_mat_randrank.html},
note = {Generated 2026-10-20}
}