FLINT3.7.0-dev

nmod_mat_print_pretty, nmod_mat_fprint_pretty

Synopsis#include <flint/nmod_mat.h>
void nmod_mat_print_pretty(const nmod_mat_t mat)source
int nmod_mat_fprint_pretty(FILE * file, const nmod_mat_t mat)source

Prints a header line with the dimensions and modulus, then one line per row, with the entries in brackets and right-aligned to the number of decimal digits of n. nmod_mat_fprint_pretty returns a positive value on success and a nonpositive value on a write error. Functions with a FILE argument are declared only if <stdio.h> is included before nmod_mat.h.

For example, a 2 \times 3 matrix modulo 2903 is printed as

<2 x 3 integer matrix mod 2903>
[   0    0 2607]
[ 622    0    0]

For a matrix with no rows or no columns only the header line is printed.

Guides#

Cite this page

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