FLINT3.7.0-dev

padic_radix_dot_strided, padic_radix_dot_strided_naive, padic_radix_dot_strided_delayed

Synopsis#include <flint/padic_radix.h>
int padic_radix_dot_strided(padic_radix_t res, const padic_radix_t initial, int subtract, const padic_radix_struct * vec1, slong stride1, const padic_radix_struct * vec2, slong stride2, slong len, gr_ctx_t ctx)source
int padic_radix_dot_strided_naive(padic_radix_t res, const padic_radix_t initial, int subtract, const padic_radix_struct * vec1, slong stride1, const padic_radix_struct * vec2, slong stride2, slong len, gr_ctx_t ctx)source
int padic_radix_dot_strided_delayed(padic_radix_t res, const padic_radix_t initial, int subtract, const padic_radix_struct * vec1, slong stride1, const padic_radix_struct * vec2, slong stride2, slong len, gr_ctx_t ctx)source

Set res to s±∑i<lenaibis \pm \sum_{i < len} a_i b_i with aia_i = vec1[i * stride1], bib_i = vec2[i * stride2], ss = initial (zero if initial is NULL) and the sign −- if subtract is nonzero. The naive version calls padic_radix_mul and padic_radix_add in a loop. The delayed version finds the minimum valuation and the precision of the result first, then accumulates the limb products of all terms in three-word accumulators, grouped by the residue of the digit offset modulo ee and by sign; at the end the residue classes are combined in one pass (each accumulator multiplied by prp^r for its residue rr) and the carries are propagated once. The default uses the naive version for at most 4 terms at a precision of one limb, 3 terms at two limbs and 2 terms above (relative precision, or absolute if there is none), and, at precisions of up to two limbs, also for up to 7 terms whose valuations v(ai)+v(bi)v(a_i) + v(b_i) are not all equal.

When all terms are exact, the delayed version keeps the result exact if it fits in the context precision (as padic_radix_mul and padic_radix_add do), provided that the a priori extent of the terms, max⁡i(v(ai)+e∣ai∣+v(bi)+e∣bi∣)\max_i (v(a_i) + e |a_i| + v(b_i) + e |b_i|) for units of ∣ai∣|a_i| and ∣bi∣|b_i| limbs, is at most one limb beyond the context precision; otherwise the sum is rounded to the context precision. In a context without finite precision, when the window of the delayed version (the extent of the exact terms, or the precision they determine) exceeds the size_limit of the context, it calls the naive version, which builds only the partial sums (and still gets exact cancellations of terms with huge valuations right).

Cite this page

The FLINT team, “padic_radix_dot_strided, padic_radix_dot_strided_naive, padic_radix_dot_strided_delayed (padic_radix.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/padic_radix/padic_radix_dot_strided.html (generated 2026-11-02).