_mpoly_heap_insert, _mpoly_heap_insert1
#include <flint/mpoly.h>int _mpoly_heap_insert(mpoly_heap_s * heap, ulong * exp, void * x, slong * next_loc, slong * heap_len, slong N, const ulong * cmpmask)sourcevoid _mpoly_heap_insert1(mpoly_heap1_s * heap, ulong exp, void * x, slong * next_loc, slong * heap_len, ulong maskhi)sourceInsert the chain node x with monomial exp into the heap. The entry of index 0 is unused, so *heap_len is one more than the number of entries. If an entry with the same monomial is found at the top, at index *next_loc, or on the path from the insertion point to the root, x is chained to it (and *next_loc remembers its position); otherwise a new entry is created and *heap_len is incremented. _mpoly_heap_insert returns 1 if a new entry was created and 0 if the node was chained. The one-word version takes maskhi = cmpmask[0]. Initialise *next_loc to a value larger than any heap length.
The FLINT team, “_mpoly_heap_insert, _mpoly_heap_insert1 (mpoly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/mpoly/_mpoly_heap_insert.html (generated 2026-10-20).
@misc{flint-doc-mpoly-mpoly-heap-insert,
author = {{The FLINT team}},
title = {{\_mpoly\_heap\_insert, \_mpoly\_heap\_insert1 (mpoly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/mpoly/_mpoly_heap_insert.html},
note = {Generated 2026-10-20}
}