FLINT3.7.0-dev

gr_mpoly_sqr, gr_mpoly_sqr_monomial, gr_mpoly_sqr_commutative_heap, gr_mpoly_sqr_commutative_heap_threaded

Synopsis#include <flint/gr_mpoly.h>
int gr_mpoly_sqr(gr_mpoly_t poly1, const gr_mpoly_t poly2, gr_mpoly_ctx_t ctx)source
int gr_mpoly_sqr_monomial(gr_mpoly_t poly1, const gr_mpoly_t poly2, gr_mpoly_ctx_t ctx)source
int gr_mpoly_sqr_commutative_heap(gr_mpoly_t poly1, const gr_mpoly_t poly2, gr_mpoly_ctx_t ctx)source
int gr_mpoly_sqr_commutative_heap_threaded(gr_mpoly_t poly1, const gr_mpoly_t poly2, gr_mpoly_ctx_t ctx)source

Set poly1 to the square of poly2. The commutative versions require a commutative (or approximately commutative) coefficient ring and compute only the products b_i b_j with i \le j, doubling the off-diagonal ones; the default uses them (threaded above 100 terms) and the monomial version for a single term.

Cite this page

The FLINT team, “gr_mpoly_sqr, gr_mpoly_sqr_monomial, gr_mpoly_sqr_commutative_heap, gr_mpoly_sqr_commutative_heap_threaded (gr_mpoly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_mpoly/gr_mpoly_sqr.html (generated 2026-10-20).