gr_poly_roots, gr_poly_roots_other
#include <flint/gr_poly.h>int gr_poly_roots(gr_vec_t roots, fmpz_vec_t mult, const gr_poly_t poly, int flags, gr_ctx_t ctx)sourceint gr_poly_roots_other(gr_vec_t roots, fmpz_vec_t mult, const gr_poly_t poly, gr_ctx_t poly_ctx, int flags, gr_ctx_t ctx)sourceFind the roots of f in the ring ctx, writing them without repetition to roots (a vector over ctx) and their multiplicities to mult. gr_poly_roots_other takes a polynomial over another ring poly_ctx, for example to find the qqbar or acb roots of an integer polynomial. The roots of the zero polynomial are undefined, and GR_DOMAIN is returned for it.
Unless the ring is an algebraically closed field, the multiplicities may add up to less than the degree: over fmpz only integer roots are found. The order of the roots depends on the ring. Both functions are ring methods (GR_METHOD_POLY_ROOTS, GR_METHOD_POLY_ROOTS_OTHER): the default finds roots over finite fields with gr_poly_roots_finite_field (Roots of polynomials over finite fields) and returns GR_UNABLE otherwise; fmpz, fmpq, qqbar, ca, arb, acb and the modular rings provide their own.
Guides#
- Using qqbar (
qqbar)
The FLINT team, “gr_poly_roots, gr_poly_roots_other (gr_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_poly/gr_poly_roots.html (generated 2026-10-20).
@misc{flint-doc-gr-poly-gr-poly-roots,
author = {{The FLINT team}},
title = {{gr\_poly\_roots, gr\_poly\_roots\_other (gr\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/gr_poly/gr_poly_roots.html},
note = {Generated 2026-10-20}
}