nmod_mat_reduce_row
#include <flint/nmod_mat.h>P has one entry per column: P[i] is the index of the row whose pivot (leading entry, which must be 1) is in column i, or -1 if there is none. Row m is reduced from left to right by subtracting multiples of these rows. At the first column i where it has a nonzero entry and P[i] is -1, the row is divided by that entry, P[i] is set to m and i is returned. If the row becomes zero, -1 is returned. L[j] is the number of leading columns of row j that may be nonzero; entries beyond it are taken to be zero, which saves work when the rows get longer towards the bottom. Setting every entry of L to the number of columns is always valid. The pivot rows may be any rows of M, but at most m of them; the updates are accumulated without reduction in up to three words. This is the elimination step of nmod_mat_minpoly.
The FLINT team, “nmod_mat_reduce_row (nmod_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_mat/nmod_mat_reduce_row.html (generated 2026-10-20).
@misc{flint-doc-nmod-mat-nmod-mat-reduce-row,
author = {{The FLINT team}},
title = {{nmod\_mat\_reduce\_row (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_reduce_row.html},
note = {Generated 2026-10-20}
}