mpn_ctx_init, mpn_ctx_clear
#include <flint/fft_small.h>The eight primes are (or, if is not prime, the first prime in the sequence below) and then the next primes of the sequence obtained by repeatedly subtracting from the previous value, where ; when that would lose a bit, the bit size is kept and the two-adic valuation is decreased by one. Each prime must pass fft_small_mulmod_satisfies_bounds and have , or sd_fft_ctx_init_prime throws. Other starting values are meant only for testing: the packing profiles, the two-prime pipeline and the shortcut for moduli that are context primes all assume 50-bit primes.
Initialisation computes the twiddle factors for transforms of length up to , the cofactors for the Chinese remainder theorem, and the tables for . Longer twiddle tables are added on first use.
The FLINT team, “mpn_ctx_init, mpn_ctx_clear (fft_small.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fft_small/mpn_ctx_init.html (generated 2026-11-02).
@misc{flint-doc-fft-small-mpn-ctx-init,
author = {{The FLINT team}},
title = {{mpn\_ctx\_init, mpn\_ctx\_clear (fft\_small.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fft_small/mpn_ctx_init.html},
note = {Generated 2026-11-02}
}