Gröbner basis project
Codebase for research into Gröbner basis computation
sugar_strategy.hpp
1 #ifndef __SUGAR_STRATEGY_
2 #define __SUGAR_STRATEGY_
3 
4 /*****************************************************************************\
5 * This file is part of DynGB. *
6 * *
7 * DynGB is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * Foobar is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with DynGB. If not, see <http://www.gnu.org/licenses/>. *
19 \*****************************************************************************/
20 
21 #include "strategies.hpp"
22 #include "polynomial.hpp"
23 
25 
34 public:
46  virtual bool equivalent(const Poly_Strategy_Data & sd) const;
52  virtual bool first_larger(const Poly_Strategy_Data & sd) const;
57  virtual void at_generation_tasks();
63  virtual void at_generation_tasks(const Monomial & t);
70  virtual void pre_reduction_tasks(
71  const EXP_TYPE * u, const Abstract_Polynomial & g
72  );
74 
76  DEG_TYPE poly_sugar() const;
78  virtual StrategyFlags type() { return StrategyFlags::SUGAR_STRATEGY; }
80 
81 
83  void force_sugar(DEG_TYPE new_sugar) { sugar = new_sugar; }
85 
86  friend ostream & operator <<(ostream &, const Poly_Sugar_Data &);
89 protected:
91  unsigned long long sugar;
92 };
93 
102 public:
104 
111 
112 
114  virtual bool equivalent(const Pair_Strategy_Data & sd) const;
116  virtual bool first_larger(const Pair_Strategy_Data & sd) const;
118 
119  DEG_TYPE pair_sugar() const { return sugar; }
122 protected:
126  DEG_TYPE sugar;
127 };
128 
129 #endif
The general class of a polynomial.
Definition: polynomial.hpp:101
virtual bool equivalent(const Poly_Strategy_Data &sd) const
returns true iff the sugars are equal
polynomial-related strategy data
Definition: strategies.hpp:49
unsigned long long sugar
the polynomial’s sugar
virtual bool first_larger(const Poly_Strategy_Data &sd) const
returns true iff this sugar is larger than sd ’s
ordering critical pairs using the sugar strategy
Structure for sorting critical pairs.
Definition: strategies.hpp:145
Critical_Pair_Basic * cp
the critical pair to which this Normal_Strategy belongs
DEG_TYPE poly_sugar() const
the sugar itself
StrategyFlags
flag indicating which strategy to use for computation
Definition: strategies.hpp:34
virtual StrategyFlags type()
the strategy type
Implementation of monomials.
Definition: monomial.hpp:69
polynomial-related data for a sugar strategy
DEG_TYPE sugar
the pair*rsquo;s sugar
Poly_Sugar_Data(const Abstract_Polynomial *poly)
records poly as the reference for this
void force_sugar(DEG_TYPE new_sugar)
for those times when a different sugar is appropriate
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 ...