nmod_mat_randtril, nmod_mat_randtriu
Synopsis
#include <flint/nmod_mat.h>void nmod_mat_randtril(nmod_mat_t mat, flint_rand_t state, int unit)sourcevoid nmod_mat_randtriu(nmod_mat_t mat, flint_rand_t state, int unit)sourceSets mat to a random lower, respectively upper, triangular matrix. The entries strictly below (above) the diagonal are random, the diagonal entries are 1 if unit is nonzero and random nonzero values otherwise. mat need not be square.
A diagonal entry that comes out as 0 is replaced by 1. For composite n the diagonal entries need not be invertible.
Cite this page
The FLINT team, “nmod_mat_randtril, nmod_mat_randtriu (nmod_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_mat/nmod_mat_randtril.html (generated 2026-10-20).
@misc{flint-doc-nmod-mat-nmod-mat-randtril,
author = {{The FLINT team}},
title = {{nmod\_mat\_randtril, nmod\_mat\_randtriu (nmod\_mat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/nmod_mat/nmod_mat_randtril.html},
note = {Generated 2026-10-20}
}