FLINT3.7.0-dev

fmpz_mat_read, fmpz_mat_fread

Synopsis#include <flint/fmpz_mat.h>
int fmpz_mat_read(fmpz_mat_t mat)source
int fmpz_mat_fread(FILE * file, fmpz_mat_t mat)source

Reads a matrix in the format written by fmpz_mat_fprint from stdin, respectively file. Returns 1 on success and 0 if reading failed.

If mat is 0 \times 0, it is cleared and reinitialised with the dimensions read. Otherwise its dimensions must equal the ones read, and an exception is thrown if they do not, or if a dimension does not fit in an slong. Because mat may be reinitialised, it must not be a window.

Cite this page

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