_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)sourcevoid fmpz_mod_mat_charpoly(fmpz_mod_poly_t p, const fmpz_mod_mat_t M, const fmpz_mod_ctx_t ctx)sourceSet 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).
@misc{flint-doc-fmpz-mod-mat-fmpz-mod-mat-charpoly,
author = {{The FLINT team}},
title = {{\_fmpz\_mod\_mat\_charpoly, fmpz\_mod\_mat\_charpoly (fmpz\_mod\_mat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpz_mod_mat/_fmpz_mod_mat_charpoly.html},
note = {Generated 2026-10-20}
}