FLINT3.7.0-dev

fmpz_mat_find_good_prime_and_invert

Synopsis#include <flint/fmpz_mat.h>
ulong fmpz_mat_find_good_prime_and_invert(nmod_mat_t Ainv, const fmpz_mat_t A, const fmpz_t det_bound)source

Searches primes p above 2^{59} for one modulo which the square matrix A is nonsingular, sets Ainv to A^{-1} \bmod p and returns p. Returns 0 if A is proven singular, by an exact kernel vector or by the product of the primes tested exceeding det_bound, an upper bound for |\det(A)|.

Cite this page

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