Frobby 0.10.0
Loading...
Searching...
No Matches
TermGrader.h
1/* Frobby: Software for monomial ideal computations.
2 Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see http://www.gnu.org/licenses/.
16*/
17#ifndef TERM_GRADER_GUARD
18#define TERM_GRADER_GUARD
19
20#include <vector>
21
22class Projection;
23class Term;
24class TermTranslator;
25
27class TermGrader {
28public:
29 TermGrader(const vector<mpz_class>& varDegrees,
30 const TermTranslator& translator);
31
33 mpz_class getDegree(const Term& term) const;
34
36 void getDegree(const Term& term, mpz_class& degree) const;
37
41 void getDegree(const Term& term,
42 const Projection& projection,
43 mpz_class& degree) const;
44
48 void getUpperBound(const Term& divisor,
49 const Term& dominator,
50 mpz_class& bound) const;
51
59 mpz_class getUpperBound(const Term& divisor,
60 const Term& dominator) const;
61
70 Exponent getLargestLessThan2(size_t var,
71 const mpz_class& value, bool strict = true) const;
72
77 Exponent getLargestLessThan2(size_t var, Exponent from, Exponent to,
78 const mpz_class& value, bool strict =
79 true) const;
80
81 void getIncrementedDegree(const Term& term,
82 const Projection& projection,
83 mpz_class& degree) const;
84
88 bool getMinIndexLessThan(size_t var,
89 Exponent from,
90 Exponent to,
91 Exponent& index,
92 const mpz_class& maxDegree) const;
93
97 bool getMaxIndexLessThan(size_t var,
98 Exponent from,
99 Exponent to,
100 Exponent& index,
101 const mpz_class& maxDegree) const;
102
103
104 const mpz_class& getGrade(size_t var, Exponent exponent) const;
105
106 Exponent getMaxExponent(size_t var) const;
107
108 size_t getVarCount() const;
109
110 void print(ostream& out) const;
111
116 int getGradeSign(size_t var) const;
117
118private:
119 vector<vector<mpz_class> > _grades;
120 vector<int> _signs;
121};
122
123ostream& operator<<(ostream& out, const TermGrader& grader);
124
125#endif
Definition Projection.h:29
Definition TermGrader.h:27
Exponent getLargestLessThan2(size_t var, const mpz_class &value, bool strict=true) const
Definition TermGrader.cpp:180
mpz_class getDegree(const Term &term) const
Definition TermGrader.cpp:47
bool getMaxIndexLessThan(size_t var, Exponent from, Exponent to, Exponent &index, const mpz_class &maxDegree) const
Definition TermGrader.cpp:153
void getUpperBound(const Term &divisor, const Term &dominator, mpz_class &bound) const
Definition TermGrader.cpp:69
bool getMinIndexLessThan(size_t var, Exponent from, Exponent to, Exponent &index, const mpz_class &maxDegree) const
Definition TermGrader.cpp:126
int getGradeSign(size_t var) const
Definition TermGrader.cpp:302
Definition TermTranslator.h:41
Definition Term.h:49