1 #ifndef __SUGAR_STRATEGY_CPP_ 2 #define __SUGAR_STRATEGY_CPP_ 21 #include "polynomial.hpp" 22 #include "strategies.hpp" 23 #include "critical_pair.hpp" 24 #include "sugar_strategy.hpp" 66 DEG_TYPE d = sd->
sugar;
67 for (NVAR_TYPE i = 0; i < t.
num_vars(); ++i) d += u[i];
74 os <<
"Sugar strategy recording sugar " << sd.
sugar;
86 if (cpb.
second() !=
nullptr) {
87 DEG_TYPE second_sugar =
98 and (cp->lcm() == nsd->
cp->
lcm())
101 if (cp->second() ==
nullptr) result = (nsd->
cp->
second() ==
nullptr);
103 if (nsd->
cp->
second() !=
nullptr) { result =
false; }
105 result = ((cp->second() == nsd->
cp->
second())
106 and (cp->second()->leading_monomial()
124 cp->first()->leading_monomial().is_like(
128 if (cp->second() ==
nullptr) result =
false;
129 else if (nsd->
cp->
second() ==
nullptr) result =
true;
DEG_TYPE total_degree(NVAR_TYPE m=0) const
Sum of exponents of the first m variables.
The general class of a polynomial.
const Abstract_Polynomial * p
the polynomial to which this strategy applies
const Monomial & second_multiplier() const
monomial needed to multiply second polynomial to lcm()
virtual bool equivalent(const Poly_Strategy_Data &sd) const
returns true iff the sugars are equal
polynomial-related strategy data
virtual Polynomial_Iterator * new_iterator() const =0
An iterator that poses no risk of modifying the polynomial.
virtual void moveRight()=0
Moves right in the polynomial, to the next smaller monomial.
unsigned long long sugar
the polynomial’s sugar
const Abstract_Polynomial * second() const
second polynomial in pair
virtual bool first_larger(const Poly_Strategy_Data &sd) const
returns true iff this sugar is larger than sd ’s
virtual DEG_TYPE standard_degree() const
maximum sum of exponents for any monomial
virtual Monomial & leading_monomial() const =0
leading monomial – call after sort_by_order()!
const Monomial & lcm() const
lcm of leading monomials of polynomials
ordering critical pairs using the sugar strategy
Structure for sorting critical pairs.
Critical_Pair_Basic * cp
the critical pair to which this Normal_Strategy belongs
DEG_TYPE poly_sugar() const
the sugar itself
NVAR_TYPE num_vars() const
number of variables
virtual bool fellOff() const =0
const Abstract_Polynomial * first() const
first polynomial in pair
Implementation of monomials.
Pair_Sugar_Data(Critical_Pair_Basic &cpb)
all the information we need is in cpb already so no additional processing is necessary ...
polynomial-related data for a sugar strategy
const Monomial & first_multiplier() const
monomial needed to multiply first polynomial to lcm()
virtual bool equivalent(const Pair_Strategy_Data &sd) const
implementation of equivalent()
DEG_TYPE sugar
the pair*rsquo;s sugar
Poly_Sugar_Data(const Abstract_Polynomial *poly)
records poly as the reference for this
Used to iterate through a polynomial.
virtual const Monomial & currMonomial() const =0
Reports the monomial at the current position.
virtual bool first_larger(const Pair_Strategy_Data &sd) const
implementation of first_larger()
virtual void pre_reduction_tasks(const EXP_TYPE *u, const Abstract_Polynomial &g)
re-evaluates the sugar, if need be
Controls the creation of s-polynomials.
virtual void at_generation_tasks()
sets the sugar to the largest total degree of a monomial in the assigned previously polynomial ...
virtual Poly_Strategy_Data * strategy() const
strategy related information