Macaulay2 Engine
Loading...
Searching...
No Matches
NCReduction.hpp File Reference

PolynomialHeap abstract interface — batched-subtraction heap for non-commutative reduction. More...

#include "Polynomial.hpp"
#include "ringelem.hpp"
#include <iosfwd>
#include <memory>
#include <utility>

Go to the source code of this file.

Classes

class  PolynomialHeap
 Abstract interface for accumulating a polynomial as a sum of (coeff, left * poly * right) contributions in the free algebra. More...

Enumerations

enum class  HeapType {
  Trivial , Map , PriorityQueue , NaiveGeobucket ,
  NaiveHeap , NaiveTourTree , NaiveDedupGeobucket
}

Functions

HeapType getHeapType (int strategy)
std::string getHeapName (HeapType type)
std::unique_ptr< PolynomialHeapmakePolynomialHeap (HeapType type, const FreeAlgebra &F)

Detailed Description

PolynomialHeap abstract interface — batched-subtraction heap for non-commutative reduction.

Note
AI-generated documentation. Verify against the source before relying on it.

Declares the pure-virtual surface every NCGroebner / NCF4 reduction uses to combine many tail-polynomial subtractions into a single O(n log k) pipeline rather than a quadratic term-by-term merge. addPolynomial(poly) and addPolynomial(coeff, left, right, poly) queue a polynomial (or its left-coeff-right scaling) for subtraction; viewLeadTerm / removeLeadTerm give the running result's current leading term and pop it; value() materialises the accumulated polynomial when reduction is complete. The HeapType enum selects between concrete implementations (Trivial, Map, PriorityQueue, the various geobucket / tournament-tree / dedup variants) which makePolynomialHeap instantiates — kept side-by-side for benchmarking against each other.

Non-commutative analogue of the commutative engine's gbvectorHeap. getHeapType(strategy) maps the user-facing Strategy => integer onto a concrete HeapType, and getName() on a live heap reports which one is active so profile output is unambiguous.

See also
Polynomial.hpp
NCGroebner.hpp
NCF4.hpp
FreeAlgebra.hpp

Definition in file NCReduction.hpp.