nmod_mat_struct, nmod_mat_t
#include <flint/nmod_mat.h>nmod_mat_structnmod_mat_tAn nmod_mat_struct has the fields entries (a pointer to the entry in row 0, column 0), r and c (the numbers of rows and columns), stride (the distance in words between the starts of consecutive rows) and mod (the modulus as an nmod_t). An nmod_mat_t is an array of one nmod_mat_struct, so that it is passed by reference.
Entry (i, j) is entries[i * stride + j]. A matrix created by nmod_mat_init owns a block of rc words with stride equal to c; a window created by nmod_mat_window_init points into another matrix and has that matrix's stride. All functions except nmod_mat_clear and nmod_mat_swap accept windows, so code that accesses entries must always use the stride to find a row. There is no array of row pointers: rows are swapped by swapping their entries.
Guides#
The FLINT team, “nmod_mat_struct, nmod_mat_t (nmod_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_mat/nmod_mat_struct.html (generated 2026-10-20).
@misc{flint-doc-nmod-mat-nmod-mat-struct,
author = {{The FLINT team}},
title = {{nmod\_mat\_struct, nmod\_mat\_t (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_struct.html},
note = {Generated 2026-10-20}
}