FLINT3.7.0-dev

fmpz_mat_randdet

Synopsis#include <flint/fmpz_mat.h>
void fmpz_mat_randdet(fmpz_mat_t mat, flint_rand_t state, const fmpz_t det)source

Sets the square matrix mat to a random sparse matrix with determinant det and as few nonzero entries as possible: det is factored and its prime factors are distributed over n entries in distinct rows and columns. The matrix is zero if det is zero. fmpz_mat_randops turns it into a dense matrix with the same determinant.

Cite this page

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