_gr_mpn_mod_ctx_init_transformed_poly_repr, _gr_mpn_mod_ctx_init_transformed_poly_cyclic_repr
#include <flint/mpn_mod.h>int _gr_mpn_mod_ctx_init_transformed_poly_repr(gr_ctx_t ctx, gr_ctx_t base, slong len_bound, slong terms_bound, const struct gr_transformed_poly_workload_struct * workload)sourceint _gr_mpn_mod_ctx_init_transformed_poly_cyclic_repr(gr_ctx_t ctx, gr_ctx_t base, slong * len, slong terms_bound, const struct gr_transformed_poly_workload_struct * workload)sourceThe methods of the ring behind gr_ctx_init_gr_poly_transformed_repr and gr_ctx_init_gr_poly_transformed_cyclic_repr. They initialise ctx to a ring of transformed polynomials over the mpn_mod ring base, either for polynomials of length up to len_bound (linear), or for products modulo x^N - 1, where N is the least power of two that is at least *len and at least 256 and is written back to *len (cyclic). Each element may accumulate up to terms_bound products of two converted polynomials. Return GR_UNABLE if fft_small is not available, the modulus is too large, or the workload model predicts no gain over ordinary multiplication or exceeds the memory budget flint_fft_small_max_transformed_ring_size.
The prime count is provisioned for values up to 4 \cdot \mathit{terms\_bound} \cdot n^2: one factor 2 for a bias that makes the signed accumulated values nonnegative and one because the Chinese remaindering requires values below half the product of the primes. Unlike the nmod version, there is no single-prime path (the modulus never equals an FFT prime), so the multiplicative depth is capped at 2. The context keeps a pointer to base, which must outlive it. A context is read-only after construction and may be shared by several threads.
The truncation granularity of the transforms (whole blocks of 256 points for long transforms, the full transform length below one block) is given by the macros _fft_small_len_trunc and _fft_small_op_trunc of fft_small.h.
The FLINT team, “_gr_mpn_mod_ctx_init_transformed_poly_repr, _gr_mpn_mod_ctx_init_transformed_poly_cyclic_repr (mpn_mod.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpn_mod/_gr_mpn_mod_ctx_init_transformed_poly_repr.html (generated 2026-10-20).
@misc{flint-doc-mpn-mod-gr-mpn-mod-ctx-init-transformed-poly-repr,
author = {{The FLINT team}},
title = {{\_gr\_mpn\_mod\_ctx\_init\_transformed\_poly\_repr, \_gr\_mpn\_mod\_ctx\_init\_transformed\_poly\_cyclic\_repr (mpn\_mod.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mpn_mod/_gr_mpn_mod_ctx_init_transformed_poly_repr.html},
note = {Generated 2026-10-20}
}