_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 , , and elementwise, for a vector and a scalar .
Multiplication by a fixed 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 , used for ) and the matrix method (the residues precomputed, used for larger ), from 4 elements on. For two limbs, Shoup's method is used from 4 elements on (6 if the top bit of 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-11-02).
@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-11-02}
}