FLINT3.7.0-dev

_fmpz_mod_mat_charpoly, fmpz_mod_mat_charpoly

Synopsis#include <flint/fmpz_mod_mat.h>
void _fmpz_mod_mat_charpoly(fmpz * p, const fmpz_mod_mat_t M, const fmpz_mod_ctx_t ctx)source
void fmpz_mod_mat_charpoly(fmpz_mod_poly_t p, const fmpz_mod_mat_t M, const fmpz_mod_ctx_t ctx)source

Set p to the characteristic polynomial \det(xI - M) of the square matrix M; the underscore version writes its m + 1 coefficients for an m \times m matrix. fmpz_mod_mat_charpoly throws an exception if M is not square. These work for every modulus: the generic fmpz_mod ring uses Danilevsky's algorithm for m \ge 16 and falls back to the division-free Berkowitz algorithm when it fails, and uses Berkowitz for smaller m.

Guides#

Cite this page

The FLINT team, “_fmpz_mod_mat_charpoly, fmpz_mod_mat_charpoly (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_charpoly.html (generated 2026-10-20).