_mpn_mod_vec_mul_scalar, _mpn_mod_scalar_mul_vec, _mpn_mod_vec_addmul_scalar, _mpn_mod_vec_submul_scalar
#include <flint/mpn_mod.h>Set res to x y, y x, res + x y and res - x y elementwise, for a vector x and a scalar y.
Multiplication by a fixed y is preconditioned when the vector is long enough to amortise the precomputation: flint_mpn_mulmod_want_precond chooses between no precomputation, Shoup's method (a quotient precomputed for y, used for \ell \le 10) and the matrix method (the residues y 2^{\nu} B^i \bmod n 2^{\nu} precomputed, used for larger \ell), from 4 elements on. For two limbs, Shoup's method is used from 4 elements on (6 if the top bit of n is set), with inlined code; see A fixed multiplier.
The FLINT team, “_mpn_mod_vec_mul_scalar, _mpn_mod_scalar_mul_vec, _mpn_mod_vec_addmul_scalar, _mpn_mod_vec_submul_scalar (mpn_mod.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_mod/_mpn_mod_vec_mul_scalar.html (generated 2026-10-20).
@misc{flint-doc-mpn-mod-mpn-mod-vec-mul-scalar,
author = {{The FLINT team}},
title = {{\_mpn\_mod\_vec\_mul\_scalar, \_mpn\_mod\_scalar\_mul\_vec, \_mpn\_mod\_vec\_addmul\_scalar, \_mpn\_mod\_vec\_submul\_scalar (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_vec_mul_scalar.html},
note = {Generated 2026-10-20}
}