_fmpz_mod_poly_xgcd, fmpz_mod_poly_xgcd
Synopsis
#include <flint/fmpz_mod_poly.h>slong _fmpz_mod_poly_xgcd(fmpz * G, fmpz * S, fmpz * T, const fmpz * A, slong lenA, const fmpz * B, slong lenB, const fmpz_t invB, const fmpz_mod_ctx_t ctx)sourcevoid fmpz_mod_poly_xgcd(fmpz_mod_poly_t G, fmpz_mod_poly_t S, fmpz_mod_poly_t T, const fmpz_mod_poly_t A, const fmpz_mod_poly_t B, const fmpz_mod_ctx_t ctx)sourceCompute the GCD of and and cofactors with . The non-underscore version makes monic, with and (if or is nonzero; if both are zero, all outputs are zero). The underscore version requires with , does not make monic, needs space for , and coefficients in , , , returns the length of , and does not allow aliasing (invB is not used). The modulus must be prime.
The Euclidean algorithm is used for , and the half-GCD algorithm above that (_gr_poly_xgcd_euclidean, _gr_poly_xgcd_hgcd).
Cite this page
The FLINT team, “_fmpz_mod_poly_xgcd, fmpz_mod_poly_xgcd (fmpz_mod_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz_mod_poly/_fmpz_mod_poly_xgcd.html (generated 2026-11-02).
@misc{flint-doc-fmpz-mod-poly-fmpz-mod-poly-xgcd,
author = {{The FLINT team}},
title = {{\_fmpz\_mod\_poly\_xgcd, fmpz\_mod\_poly\_xgcd (fmpz\_mod\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpz_mod_poly/_fmpz_mod_poly_xgcd.html},
note = {Generated 2026-11-02}
}