FLINT3.7.0-dev

_gr_mat_companion, gr_mat_companion

Synopsis#include <flint/gr_mat.h>
int _gr_mat_companion(gr_mat_t res, gr_srcptr poly, gr_ctx_t ctx)source
int gr_mat_companion(gr_mat_t res, const gr_poly_t poly, gr_ctx_t ctx)source

Sets the n \times n matrix res to the companion matrix of a polynomial of degree n, whose characteristic polynomial is the monic associate of the polynomial. The leading coefficient must be invertible (not checked). The underscore version reads n + 1 coefficients.

Cite this page

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