Macaulay2 Engine
Loading...
Searching...
No Matches
res-poly-ring.hpp File Reference

ResPolyRing and ResPolynomial — resolution-tuned polynomial-ring view and value type. More...

#include "VectorArithmetic.hpp"
#include "newdelete.hpp"
#include "schreyer-resolution/res-moninfo.hpp"
#include "schreyer-resolution/res-monomial-types.hpp"
#include <iostream>
#include <memory>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Classes

class  ResPolynomial
 Polynomial type used by the F4 resolution engine: parallel coefficient vector and concatenated monomial buffer. More...
class  ResPolyRing
 The polynomial-ring view the F4 resolution engine reduces against: coefficient arithmetic plus the engine-specific ResMonoid. More...
class  ResPolynomialConstructor
 Builder that accumulates terms into a ResPolynomial and finalises the layout in one shot via setPoly. More...
class  ResPolynomialIterator
 Forward iterator over the terms of a ResPolynomial. More...

Functions

bool operator== (const ResPolynomialIterator &a, const ResPolynomialIterator &b)
bool operator!= (const ResPolynomialIterator &a, const ResPolynomialIterator &b)
void display_poly (std::ostream &o, const ResPolyRing &R, const ResPolynomial &f)
bool check_poly (const ResPolyRing &R, const ResPolynomial &f, const ResSchreyerOrder &O)

Detailed Description

ResPolyRing and ResPolynomial — resolution-tuned polynomial-ring view and value type.

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

Declares the F4 resolution's stripped-down counterpart of GBRing / gbvector. ResPolynomial stores a polynomial as a length counter, a flat ElementArray of coefficients (decoded through VectorArithmetic), and a flat std::vector<res_monomial_word> of packed monomials whose layout is controlled by ResMonoid; the destructor counts itself in the static npoly_destructor debug tally. The three friends — ResPolyRing, ResPolynomialConstructor, and ResPolynomialIterator — are the only entry points allowed to peek inside the layout, which lets future reshapes stay invisible to callers. ResPolyRing ties together the coefficient ring (via VectorArithmetic), the resolution monoid M, the original engine monoid origM (kept for promotion / lifting paths), and an optional SkewMultiplication so resolutions over skew-commutative rings get the right sign in mult.

The split from PolynomialRing exists because resolutions do vastly more monomial arithmetic per second than ordinary polynomial ops, and the standard ring's virtual dispatch and full degree-monoid recursion would dominate. Here the VectorArithmetic indirection inlines, and the ResMonoid choice between dense (res-moninfo-dense.hpp) and sparse (res-moninfo-sparse.hpp) layouts can be benchmarked without touching call sites.

See also
VectorArithmetic.hpp
res-moninfo.hpp
res-monomial-types.hpp
res-f4-computation.hpp
res-schreyer-frame.hpp

Definition in file res-poly-ring.hpp.