Frobby 0.9.5
TermGrader.h
Go to the documentation of this file.
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
28public:
29 TermGrader(const vector<mpz_class>& varDegrees,
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,
43 mpz_class& degree) const;
44
48 void getUpperBound(const Term& divisor,
49 const Term& dominator,
50 mpz_class& bound) const;
51
60 const Term& dominator) const;
61
71 const mpz_class& value, bool strict = true) const;
72
78 const mpz_class& value, bool strict =
79 true) const;
80
81 void getIncrementedDegree(const Term& term,
83 mpz_class& degree) const;
84
88 bool getMinIndexLessThan(size_t var,
91 Exponent& index,
92 const mpz_class& maxDegree) const;
93
97 bool getMaxIndexLessThan(size_t var,
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:
120 vector<int> _signs;
121};
122
124
125#endif
void nameFactoryRegister(NameFactory< AbstractProduct > &factory)
Registers the string returned by ConcreteProduct::getStaticName() to a function that default-construc...
ostream & operator<<(ostream &out, const TermGrader &grader)
A TermGrader assigns a value, the degree, to each monomial.
Definition TermGrader.h:27
void getIncrementedDegree(const Term &term, const Projection &projection, mpz_class &degree) const
void print(ostream &out) const
vector< int > _signs
Definition TermGrader.h:120
Exponent getLargestLessThan2(size_t var, const mpz_class &value, bool strict=true) const
Returns the index of the largest stored exponent of var that is less than value.
mpz_class getDegree(const Term &term) const
Returns the degree of term.
size_t getVarCount() const
Exponent getMaxExponent(size_t var) const
bool getMaxIndexLessThan(size_t var, Exponent from, Exponent to, Exponent &index, const mpz_class &maxDegree) const
Finds maximal index in [from, to] to such that degree(t) <= maxDegree.
void getUpperBound(const Term &divisor, const Term &dominator, mpz_class &bound) const
Assigns to bound the degree of the largest term v such that divisor divides v and v divides dominator...
bool getMinIndexLessThan(size_t var, Exponent from, Exponent to, Exponent &index, const mpz_class &maxDegree) const
Finds minimal index in [from, to] to such that degree(t) <= maxDegree.
int getGradeSign(size_t var) const
Returns 1 if the grade strictly increases with the exponent of var, returns -1 if it strictly decreas...
const mpz_class & getGrade(size_t var, Exponent exponent) const
vector< vector< mpz_class > > _grades
Definition TermGrader.h:119
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Term represents a product of variables which does not include a coefficient.
Definition Term.h:49
unsigned int Exponent
Definition stdinc.h:89