FLINT3.7.0-dev

fmpz_mod_mat_inv

Synopsis#include <flint/fmpz_mod_mat.h>
int fmpz_mod_mat_inv(fmpz_mod_mat_t B, const fmpz_mod_mat_t A, const fmpz_mod_ctx_t ctx)source

Sets B = A^{-1} and returns 1 if the square matrix A is invertible; otherwise returns 0 and leaves B undefined. A and B must have the same dimensions. The inverse is computed by solving AB = I with fmpz_mod_mat_solve; a 1 \times 1 matrix is inverted with fmpz_mod_inv, which throws an exception for a nonzero non-unit.

Guides#

Cite this page

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