FLINT3.7.0-dev

mpn_ctx_struct, mpn_ctx_t

Synopsis#include <flint/fft_small.h>
mpn_ctx_struct
mpn_ctx_t

A multiplication context. It holds the transform contexts of MPN_CTX_NCRTS = 8 primes, the Chinese remaindering data for the first kk of them for every k≤8k \le 8, tables of powers of two modulo each prime for converting integers, the table of packing profiles, the constants of the two-prime pipeline, and a scratch buffer that grows on demand and is kept between calls.

The primes are generated from the initial prime given to mpn_ctx_init. FLINT always uses p0=63⋅244+1p_0 = 63 \cdot 2^{44} + 1, which yields

iipip_iform
0110830772079820963⋅244+163 \cdot 2^{44} + 1
165970697666560175⋅243+175 \cdot 2^{43} + 1
21086317488242689247⋅242+1247 \cdot 2^{42} + 1
3910395627798529207⋅242+1207 \cdot 2^{42} + 1
4699289395265537159⋅242+1159 \cdot 2^{42} + 1
51022545813831681465⋅241+1465 \cdot 2^{41} + 1
61013749720809473461⋅241+1461 \cdot 2^{41} + 1
7868614185943041395⋅241+1395 \cdot 2^{41} + 1

All have 50 bits. A transform of length 2d2^d modulo the first kk primes needs 2d∣pi−12^d \mid p_i - 1 for each of them, so d≤41d \le 41 in general and d≤43d \le 43 for the two-prime pipeline: far beyond any realistic size. The fields are described with the low-level functions in Chinese remaindering and integer conversion.

Guides#

Cite this page

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