Gröbner basis project
Codebase for research into Gröbner basis computation
monomial_ordering.hpp
1 #ifndef __MONOMIAL_ORDERING_HPP_
2 #define __MONOMIAL_ORDERING_HPP_
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 <cstdlib>
22 
23 #include "system_constants.hpp"
24 
25 class Monomial;
26 
40 public:
42 
44  virtual Monomial_Order_Data * clone() { return nullptr; }
46 
47 
49  virtual DEG_TYPE grading(NVAR_TYPE) const { return 0; }
51 
52 
54  virtual ~Monomial_Order_Data() {}
56 };
57 
78 public:
80 
82  virtual ~Monomial_Ordering();
84 
85 
93  virtual void set_data(Monomial &) const;
95 
96 
103  virtual int cmp(const Monomial & t, const Monomial & u) const = 0;/*{
104  int result = 0;
105  if (first_larger(t, u)) result = 1;
106  else if (first_larger(u, t)) result = -1;
107  else result = 0;
108  return result;
109  }*/
113  virtual bool first_larger(const Monomial &, const Monomial &) const = 0;
119  bool first_larger_or_equal(const Monomial &, const Monomial &) const;
124  virtual bool first_smaller(const Monomial &, const Monomial &) const = 0;
131  bool first_smaller_or_equal(const Monomial &, const Monomial &) const;
136  virtual bool first_larger_than_multiple(
137  const Monomial &, const Monomial &, const Monomial &
138  ) const = 0;
145  bool first_larger_or_equal_than_multiple(
146  const Monomial &, const Monomial &, const Monomial &
147  ) const;
153  bool first_smaller_than_multiple(
154  const Monomial &, const Monomial &, const Monomial &
155  ) const;
162  bool first_smaller_or_equal_than_multiple(
163  const Monomial &, const Monomial &, const Monomial &
164  ) const;
166 };
167 
178 public:
180 
182  virtual const WT_TYPE * order_weights() const = 0;
184 };
185 
186 
187 #endif
data for a monomial ordering: optional, but stored in Monomial
virtual ~Monomial_Order_Data()
does nothing but guarantee polymorphism (stupid, stupid C++)
Implementation of monomials.
Definition: monomial.hpp:69
interface to a monomial ordering
interface to a weighted monomial ordering
virtual Monomial_Order_Data * clone()
default clone returns nullptr
virtual DEG_TYPE grading(NVAR_TYPE) const
default value is useless; orderings that supply gradings should redefine