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 "weighted_sugar_strategy.hpp" 25 #include "particular_orderings.hpp" 49 not pi->
fellOff(); pi->moveRight()
51 if (pi->currMonomial().total_degree() >
sugar)
75 DEG_TYPE d = sd->
sugar;
86 os <<
"Weighted sugar strategy recording sugar " << sd.
sugar;
96 const WT_TYPE * w = (mord ==
nullptr) ?
nullptr : mord->
order_weights();
102 const WT_TYPE * w = (wdata ==
nullptr) ?
nullptr : wdata->
weighting();
105 if (cpb.
second() !=
nullptr) {
107 if (
false) cout <<
"second: " << *q << endl;
110 const WT_TYPE * w = (wdata ==
nullptr) ?
nullptr : wdata->
weighting();
113 if (second_sugar >
sugar)
sugar = second_sugar;
120 and (cp->lcm() == nsd->
cp->
lcm())
122 and (cp->second()->leading_monomial()
137 cp->first()->leading_monomial().is_like(
virtual const WT_TYPE * order_weights() const override
the weights that define this ordering
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()
const Monomial_Ordering * monomial_ordering() const
reports leading monomial’s monomial ordering
DEG_TYPE weighted_degree(const WT_TYPE *weights, NVAR_TYPE m=0) const
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.
Critical_Pair_Basic * cp
the critical pair to which this Normal_Strategy belongs
const Abstract_Polynomial * second() const
second polynomial in pair
ordering critical pairs using the weighted sugar strategy
DEG_TYPE poly_sugar() const
the sugar itself
virtual Monomial & leading_monomial() const =0
leading monomial – call after sort_by_order()!
DEG_TYPE sugar
the polynomial’s sugar
const Monomial & lcm() const
lcm of leading monomials of polynomials
Structure for sorting critical pairs.
virtual bool first_larger(const Poly_Strategy_Data &sd) const
returns true iff this sugar is larger than sd ’s
DEG_TYPE sugar
the pair*rsquo;s sugar
virtual void pre_reduction_tasks(const EXP_TYPE *u, const Abstract_Polynomial &g)
re-evaluates the sugar, if need be
virtual DEG_TYPE weighted_degree(const WT_TYPE *w=nullptr) const
NVAR_TYPE num_vars() const
number of variables
virtual bool fellOff() const =0
const Abstract_Polynomial * first() const
first polynomial in pair
virtual void at_generation_tasks()
sets the sugar to the largest weighted degree of a monomial in the assigned previously polynomial ...
virtual bool first_larger(const Pair_Strategy_Data &sd) const
implementation of first_larger()
polynomial-related data for a weighted sugar strategy
Implementation of monomials.
Poly_WSugar_Data(const Abstract_Polynomial *poly, const WT_TYPE *w)
records poly as the reference for this
const WT_TYPE * weights
pointer to the weights
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()
Used to iterate through a polynomial.
DEG_TYPE pair_sugar()
the weighted sugar
const WT_TYPE * weighting() const
the weights used to compute the sugar
virtual const Monomial & currMonomial() const =0
Reports the monomial at the current position.
the weighted grevlex ordering for a specified number of variables, with cached weights for each monom...
Controls the creation of s-polynomials.
Pair_WSugar_Strategy(Critical_Pair_Basic &)
creates a pair whose weighted sugar is the maximum of that of the products of the polynomials in the ...
virtual bool equivalent(const Poly_Strategy_Data &sd) const
returns true iff the sugars are equal
virtual Poly_Strategy_Data * strategy() const
strategy related information