FLINT3.7.0-dev

nmod_mat_mul_u32

Synopsis#include <flint/nmod_mat.h>
int nmod_mat_mul_u32(nmod_mat_t C, const nmod_mat_t A, const nmod_mat_t B)source

Sets C=ABC = AB for a modulus n<232n < 2^{32} with an integer SIMD kernel (AVX-512, AVX2, NEON, or portable C), and returns 1. Returns 0 if n≥232n \ge 2^{32} or on 32-bit machines. CC may be aliased with AA or BB. Uses several threads when available.

The entries are lifted to signed 32-bit integers ∣x∣≤n/2|x| \le n/2, and their products are accumulated exactly in signed 64-bit lanes with widening 32×32→6432 \times 32 \to 64-bit multiplications. When an accumulator could overflow, it is folded: writing it as h232+lh 2^{32} + l, it is replaced by hc+lh c + l with c=232 mod nc = 2^{32} \bmod n. For nn below about 228.52^{28.5} no fold is needed within a block of 256 products, and a single pass serves any n<232n < 2^{32}.

AlgorithmMatrix multiplication kernels modulo nThe blocked SIMD kernels nmod_mat_mul_u32, _u52, _k52 and _fp50, which multiply matrices modulo moduli up to 2522^{52} in one pass with delayed reduction, and the floating-point route of nmod_mat_mul_blas with Chinese remaindering.
Cite this page

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