FLINT3.7.0-dev

_flint_mpn_hgcd2, _flint_mpn_hgcd_mul_matrix1_vector, _flint_mpn_hgcd_mul_matrix1_inverse_vector, _flint_mpn_gcd_22

Synopsis#include <flint/mpn_extras.h>
int _flint_mpn_hgcd2(mp_limb_t ah, mp_limb_t al, mp_limb_t bh, mp_limb_t bl, flint_mpn_hgcd_matrix1_struct * M)source
mp_size_t _flint_mpn_hgcd_mul_matrix1_vector(const flint_mpn_hgcd_matrix1_struct * M, mp_ptr rp, mp_srcptr ap, mp_ptr bp, mp_size_t n)source
mp_size_t _flint_mpn_hgcd_mul_matrix1_inverse_vector(const flint_mpn_hgcd_matrix1_struct * M, mp_ptr rp, mp_srcptr ap, mp_ptr bp, mp_size_t n)source
void _flint_mpn_gcd_22(mp_ptr g, mp_limb_t u1, mp_limb_t u0, mp_limb_t v1, mp_limb_t v0)source

The word-level half-GCD of the two-limb numbers (ah,al)(a_h, a_l) and (bh,bl)(b_h, b_l), returning 0 if no reduction is possible; the products (r,b)←(a,b)M(r, b) \gets (a, b) M and (r,b)←M−1(a,b)(r, b) \gets M^{-1} (a, b) by such a matrix; and the GCD of two odd two-limb numbers (GMP's mpn_gcd_22 if available, otherwise a port of GMP's C version). These are ports of the GMP functions of the same names, except that the two products form both outputs in a single pass, and allow rp to be equal to ap.

Cite this page

The FLINT team, “_flint_mpn_hgcd2, _flint_mpn_hgcd_mul_matrix1_vector, _flint_mpn_hgcd_mul_matrix1_inverse_vector, _flint_mpn_gcd_22 (mpn_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_extras/_flint_mpn_hgcd2.html (generated 2026-11-02).