1 #ifndef __CRITICAL_PAIR_HPP_ 2 #define __CRITICAL_PAIR_HPP_ 21 #include "polynomial.hpp" 22 #include "polynomial_geobucket.hpp" 23 #include "polynomial_linked_list.hpp" 24 #include "polynomial_double_buffered.hpp" 26 #include "strategies.hpp" 27 #include "sugar_strategy.hpp" 28 #include "normal_strategy.hpp" 29 #include "weighted_sugar_strategy.hpp" 31 #include "particular_orderings.hpp" 56 MIN_SPCREATE_FLAG = 0,
100 inline unsigned lcm_degree(
unsigned i)
const {
return tpq.degree(i); }
174 ordering = how_to_order;
183 ordering = how_to_order;
184 tpq.set_monomial_ordering(ordering);
185 tp.set_monomial_ordering(ordering);
186 tp.set_monomial_ordering(ordering);
189 case StrategyFlags::NORMAL_STRATEGY:
192 case StrategyFlags::SUGAR_STRATEGY :
195 case StrategyFlags::WSUGAR_STRATEGY:
235 ordering = new_order;
236 if (is_generator()) {
237 p->set_monomial_ordering(ordering);
238 tpq = p->leading_monomial();
240 tpq.set_monomial_ordering(ordering);
241 tp.set_monomial_ordering(ordering);
242 tq.set_monomial_ordering(ordering);
244 if (strat !=
nullptr) {
245 DEG_TYPE new_sugar = first()->weighted_degree(new_order->
order_weights());
246 new_sugar += first_multiplier().weighted_degree(new_order->
order_weights());
247 if (second() !=
nullptr) {
248 DEG_TYPE second_sugar = first()->weighted_degree(new_order->
order_weights());
249 second_sugar += second_multiplier().weighted_degree(new_order->
order_weights());
250 if (second_sugar > new_sugar) new_sugar = second_sugar;
252 strat->adjust_sugar(new_sugar);
The general class of a polynomial.
const Monomial & second_multiplier() const
monomial needed to multiply second polynomial to lcm()
void change_ordering(Weighted_Ordering *new_order)
change the ordering associated with this pair
virtual void set_spoly(Mutable_Polynomial *p)
sets the s-polynomial to p, for explorer methods
Monomial tq
monomial multiple of that produces -polynomial
const Abstract_Polynomial * second() const
second polynomial in pair
Mutable_Polynomial * s
S-polynomial.
ordering critical pairs using the weighted sugar strategy
const Monomial & lcm() const
lcm of leading monomials of polynomials
Controls the creation of s-polynomials, specialized for the dynamic algorithm.
Monomial tpq
lcm of leading monomials of and
ordering critical pairs using the sugar strategy
Structure for sorting critical pairs.
Abstract_Polynomial * q
second polynomial in the critical pair
StrategyFlags
flag indicating which strategy to use for computation
SPolyCreationFlags
flag indicating which structure to use for an s-polynomial
Polynomials that need arithmetic typically descend from this class.
const Abstract_Polynomial * first() const
first polynomial in pair
virtual const WT_TYPE * order_weights() const =0
returns the weights used by this orderings
Weighted_Ordering * ordering
the Monomial_Ordering assigned to this pair — might disagree with that of polynomials; they must be ...
Implementation of monomials.
polynomial-related data for a sugar strategy
const Monomial & first_multiplier() const
monomial needed to multiply first polynomial to lcm()
virtual Mutable_Polynomial * s_polynomial()
to use only if s-polynomial is already computed by another method
ordering critical pairs using the normal strategy
Critical_Pair_Dynamic(Abstract_Polynomial *f, Abstract_Polynomial *g, StrategyFlags strategy, Weighted_Ordering *how_to_order)
create critical pair (f,g) for two polynomials, with given ordering
unsigned lcm_degree(unsigned i) const
degree of ith variable in lcm
interface to a weighted monomial ordering
Weighted_Ordering * how_ordered() const
the ordering associated with this pair
const Pair_Strategy_Data * pair_key() const
strategy used for comparison of pairs
Critical_Pair_Dynamic(Abstract_Polynomial *f, StrategyFlags strategy, Weighted_Ordering *how_to_order)
create critical pair (f,0) for initial polynomial, with given ordering
Controls the creation of s-polynomials.
bool is_generator() const
whether this pair is from a generator
Monomial tp
monomial multiple of that produces -polynomial
Abstract_Polynomial * p
first polynomial in the critical pair