gr_mpoly_mul, gr_mpoly_mul_heap, gr_mpoly_mul_heap_threaded, gr_mpoly_mul_monomial
#include <flint/gr_mpoly.h>int gr_mpoly_mul(gr_mpoly_t A, const gr_mpoly_t B, const gr_mpoly_t C, gr_mpoly_ctx_t ctx)sourceint gr_mpoly_mul_heap(gr_mpoly_t A, const gr_mpoly_t B, const gr_mpoly_t C, gr_mpoly_ctx_t ctx)sourceint gr_mpoly_mul_heap_threaded(gr_mpoly_t A, const gr_mpoly_t B, const gr_mpoly_t C, gr_mpoly_ctx_t ctx)sourceint gr_mpoly_mul_monomial(gr_mpoly_t A, const gr_mpoly_t B, const gr_mpoly_t C, gr_mpoly_ctx_t ctx)sourceSet A to the product BC. The heap version uses Johnson's algorithm, which merges the |B| sorted rows b_i C with a heap of size |B|, with O(|B| |C| \log |B|) monomial comparisons and memory proportional to the output; the heap_threaded version divides the output among threads. The monomial version requires C to have one term.
The default gr_mpoly_mul squares when B and C are the same object (see gr_mpoly_sqr), uses the monomial algorithm if one factor has a single term, and otherwise the heap algorithm, threaded when |B| |C| > 10000, both have more than two terms and threads are available. Products with more than the size limit of the context in terms return GR_UNABLE.
The FLINT team, “gr_mpoly_mul, gr_mpoly_mul_heap, gr_mpoly_mul_heap_threaded, gr_mpoly_mul_monomial (gr_mpoly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_mpoly/gr_mpoly_mul.html (generated 2026-10-20).
@misc{flint-doc-gr-mpoly-gr-mpoly-mul,
author = {{The FLINT team}},
title = {{gr\_mpoly\_mul, gr\_mpoly\_mul\_heap, gr\_mpoly\_mul\_heap\_threaded, gr\_mpoly\_mul\_monomial (gr\_mpoly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/gr_mpoly/gr_mpoly_mul.html},
note = {Generated 2026-10-20}
}