FLINT3.7.0-dev

fmpz_mpoly_sqrt_heap

Synopsis#include <flint/fmpz_mpoly.h>
int fmpz_mpoly_sqrt_heap(fmpz_mpoly_t q, const fmpz_mpoly_t poly2, const fmpz_mpoly_ctx_t ctx, int check)source

If poly2 is the square of a polynomial, sets q to the square root with positive leading coefficient and returns 1; otherwise sets q to zero and returns 0. The terms of the root are computed in order with a heap, as in division [MonPea2011]. With check equal to 0 the input is assumed to be a square and the remaining terms are not verified, which saves time but gives a meaningless result for non-squares.

References#

Cite this page

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