FLINT3.7.0-dev

nmod_mat_struct, nmod_mat_t

Synopsis#include <flint/nmod_mat.h>
nmod_mat_struct
nmod_mat_t

An 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#

Cite this page

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).