Gröbner basis project
Codebase for research into Gröbner basis computation
strategies.cpp
1 #ifndef __STRATEGIES_CPP_
2 #define __STRATEGIES_CPP_
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 
24  return equivalent(other);
25 }
26 
28  return first_larger(other);
29 }
30 
32  return *this == other or *this > other;
33 }
34 
36  return not (*this >= other);
37 }
38 
40  return not first_larger(other);
41 }
42 
44  const Abstract_Polynomial & r, const Abstract_Polynomial & g
45 ) const { return true; }
46 
47 ostream & operator <<(ostream &os, const Poly_Strategy_Data &sd) {
48  os << "generic Poly_Strategy_Data";
49  return os;
50 }
51 
52 Pair_Strategy_Data::~Pair_Strategy_Data() { };
53 
55  return equivalent(sd);
56 }
57 
59  return first_larger(sd);
60 }
61 
63  return *this > sd or *this == sd;
64 }
65 
67  return not (*this >= sd);
68 }
69 
71  return not first_larger(sd);
72 }
73 
75 
76 #endif
bool operator>=(const Poly_Strategy_Data &other) const
is this larger than or equivalent to other?
Definition: strategies.cpp:31
The general class of a polynomial.
Definition: polynomial.hpp:101
polynomial-related strategy data
Definition: strategies.hpp:49
bool operator>=(const Pair_Strategy_Data &sd) const
is this larger than or equivalent to other?
Definition: strategies.cpp:62
virtual void pre_spolynomial_tasks() const
hook called immediately before computing a new s-polynomiald
Definition: strategies.cpp:74
bool operator>(const Poly_Strategy_Data &other) const
alias for first_larger()
Definition: strategies.cpp:27
bool operator<(const Pair_Strategy_Data &sd) const
is this smaller than other?
Definition: strategies.cpp:66
Structure for sorting critical pairs.
Definition: strategies.hpp:145
friend ostream & operator<<(ostream &, const Poly_Strategy_Data &)
print strategy-related data in the polynomial
Definition: strategies.cpp:47
virtual bool valid_reduction(const Abstract_Polynomial &r, const Abstract_Polynomial &g) const
hook called while finding a reducer
Definition: strategies.cpp:43
bool operator<(const Poly_Strategy_Data &other) const
is this smaller than other?
Definition: strategies.cpp:35
virtual bool equivalent(const Poly_Strategy_Data &) const =0
should return true iff strategy considers this and other equivalent
bool operator<=(const Pair_Strategy_Data &sd) const
is this smaller than or equivalent to other?
Definition: strategies.cpp:70
bool operator==(const Poly_Strategy_Data &other) const
alias for equivalent()
Definition: strategies.cpp:23
virtual bool first_larger(const Poly_Strategy_Data &) const =0
should return true iff strategy considers this larger than other
bool operator<=(const Poly_Strategy_Data &other) const
is this smaller than or equivalent to other?
Definition: strategies.cpp:39
bool operator==(const Pair_Strategy_Data &sd) const
alias for equivalent()
Definition: strategies.cpp:54
bool operator>(const Pair_Strategy_Data &sd) const
alias for first_larger()
Definition: strategies.cpp:58