FLINT3.7.0-dev

fft_small_plan_init_nmod

Synopsis#include <flint/fft_small.h>
int fft_small_plan_init_nmod(fft_small_plan_t P, mpn_ctx_t R, ulong zl, ulong zh, ulong zn, ulong xtrunc_max, ulong len_bound, ulong prod_bits, nmod_t mod, ulong direct_len)source

Initialises P for computing the coefficients [zl,zh)[z_l, z_h) of convolutions of length znz_n over Z/nZ\mathbb{Z}/n\mathbb{Z} in which at most len_bound products, each less than 2prod_bits2^{\mathtt{prod\_bits}}, accumulate in one coefficient. Returns 0 if more than eight primes would be needed. Requires zl<zh≤znz_l < z_h \le z_n.

xtrunc_max bounds the operand lengths, rounded up to a multiple of 256. For a product of lengths ana_n and bnb_n, take len_bound =min⁡(an,bn)= \min(a_n, b_n) and prod_bits =2⌈log⁡2n⌉= 2 \lceil \log_2 n \rceil; for a sum of KK products, len_bound =Kmin⁡(an,bn)= K \min(a_n, b_n). Unreduced inputs, such as sums of operands formed in transform space, are accounted for by increasing prod_bits. If zn≤zl+2dz_n \le z_l + 2^d for a power of two 2d2^d that is at least zhz_h and the operand lengths, the transform has length 2d2^d and the excess coefficients wrap around below zlz_l. If mod.n is a context prime, one prime is used without Chinese remaindering. If direct_len is at least 100, nn has at least 20 bits, 2d∣n−12^d \mid n - 1 and nn is prime, the transform is done modulo nn itself; pass 0 to disable this.

Guides#

Cite this page

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