_mpn_mod_mat_charpoly
Synopsis
#include <flint/mpn_mod.h>Sets the m + 1 coefficients at res to the characteristic polynomial of the m \times m matrix mat, with the Berkowitz algorithm for m \le 11 and Danilevsky's algorithm (_gr_mat_charpoly_danilevsky) for larger m. Danilevsky's algorithm divides by pivots, so for a composite modulus it can fail; the function then falls back to the division-free Berkowitz algorithm, and always succeeds. This is the method behind gr_mat_charpoly.
Cite this page
The FLINT team, “_mpn_mod_mat_charpoly (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_charpoly.html (generated 2026-10-20).
@misc{flint-doc-mpn-mod-mpn-mod-mat-charpoly,
author = {{The FLINT team}},
title = {{\_mpn\_mod\_mat\_charpoly (mpn\_mod.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mpn_mod/_mpn_mod_mat_charpoly.html},
note = {Generated 2026-10-20}
}