FLINT3.7.0-dev

mpn_mod_mat_det

Synopsis#include <flint/mpn_mod.h>
int mpn_mod_mat_det(nn_ptr res, const gr_mat_t A, gr_ctx_t ctx)source

Sets res to the determinant of the square matrix A, using cofactor expansion up to 4 \times 4, the division-free Berkowitz algorithm for 5 \times 5, and LU decomposition otherwise. If the LU decomposition meets a non-invertible pivot (for a composite modulus), the determinant is computed with the Berkowitz algorithm instead, so the function works for every modulus. Returns GR_DOMAIN if A is not square.

Guides#

Cite this page

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