FLINT3.7.0-dev

_flint_mpn_dot_rev_generic, _flint_mpn_dot_rev_generic_sdiff, _flint_mpn_dot_rev_generic_signed, _flint_mpn_dot_rev_generic_signmag

Synopsis#include <flint/mpn_extras.h>
void _flint_mpn_dot_rev_generic(nn_ptr res, nn_srcptr a, slong n1, nn_srcptr b, slong n2, slong len, slong s, nn_ptr scratch)source
void _flint_mpn_dot_rev_generic_sdiff(nn_ptr res, nn_srcptr a, slong n1, nn_srcptr b, slong n2, slong len, int sdiff, nn_ptr t)source
void _flint_mpn_dot_rev_generic_signed(nn_ptr res, nn_srcptr a, slong n1, nn_srcptr b, slong n2, slong len, slong s, nn_ptr scratch)source
void _flint_mpn_dot_rev_generic_signmag(nn_ptr res, nn_srcptr a, slong n1, nn_srcptr b, slong n2, slong len, slong s, nn_ptr t)source

Reversed dot products for any n_1 \ge n_2 \ge 1, \mathit{len} \ge 1 and s \in \{n_1 + n_2 - 1, n_1 + n_2, n_1 + n_2 + 1\}, using flint_mpn_mul and mpn_add_n. The scratch space must have n_1 + n_2 limbs. The sdiff version takes s - (n_1 + n_2 - 1), which should be a compile-time constant. The signed version handles the signs with branches and is competitive only when they are predictable. In the sign-magnitude version each coefficient is a sign limb (0 or 1) followed by the magnitude, so that the strides are n_1 + 1 and n_2 + 1; the output is in two's complement, and the scratch space must have n_1 + n_2 + 2s limbs.

Cite this page

The FLINT team, “_flint_mpn_dot_rev_generic, _flint_mpn_dot_rev_generic_sdiff, _flint_mpn_dot_rev_generic_signed, _flint_mpn_dot_rev_generic_signmag (mpn_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_extras/_flint_mpn_dot_rev_generic.html (generated 2026-10-20).