TermGrader.h
Go to the documentation of this file.
/* Frobby: Software for monomial ideal computations.
Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/
#ifndef TERM_GRADER_GUARD
#define TERM_GRADER_GUARD
#include <vector>
class Projection;
class Term;
class TermTranslator;
class TermGrader {
public:
TermGrader(const vector<mpz_class>& varDegrees,
const TermTranslator& translator);
mpz_class getDegree(const Term& term) const;
void getDegree(const Term& term, mpz_class& degree) const;
void getDegree(const Term& term,
const Projection& projection,
mpz_class& degree) const;
void getUpperBound(const Term& divisor,
const Term& dominator,
mpz_class& bound) const;
mpz_class getUpperBound(const Term& divisor,
const Term& dominator) const;
Exponent getLargestLessThan2(size_t var,
const mpz_class& value, bool strict = true) const;
Exponent getLargestLessThan2(size_t var, Exponent from, Exponent to,
const mpz_class& value, bool strict =
true) const;
void getIncrementedDegree(const Term& term,
const Projection& projection,
mpz_class& degree) const;
bool getMinIndexLessThan(size_t var,
Exponent from,
Exponent to,
Exponent& index,
const mpz_class& maxDegree) const;
bool getMaxIndexLessThan(size_t var,
Exponent from,
Exponent to,
Exponent& index,
const mpz_class& maxDegree) const;
const mpz_class& getGrade(size_t var, Exponent exponent) const;
Exponent getMaxExponent(size_t var) const;
size_t getVarCount() const;
void print(ostream& out) const;
int getGradeSign(size_t var) const;
private:
vector<vector<mpz_class> > _grades;
vector<int> _signs;
};
ostream& operator<<(ostream& out, const TermGrader& grader);
#endif
operator<<
ostream & operator<<(ostream &out, const TermGrader &grader)
Definition TermGrader.cpp:307
Projection
Definition Projection.h:29
TermGrader
A TermGrader assigns a value, the degree, to each monomial.
Definition TermGrader.h:27
TermGrader::getIncrementedDegree
void getIncrementedDegree(const Term &term, const Projection &projection, mpz_class &degree) const
Definition TermGrader.cpp:266
TermGrader::print
void print(ostream &out) const
Definition TermGrader.cpp:291
TermGrader::_signs
vector< int > _signs
Definition TermGrader.h:120
TermGrader::getLargestLessThan2
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.
Definition TermGrader.cpp:180
TermGrader::getDegree
mpz_class getDegree(const Term &term) const
Returns the degree of term.
Definition TermGrader.cpp:47
TermGrader::getVarCount
size_t getVarCount() const
Definition TermGrader.cpp:287
TermGrader::getMaxExponent
Exponent getMaxExponent(size_t var) const
Definition TermGrader.cpp:282
TermGrader::TermGrader
TermGrader(const vector< mpz_class > &varDegrees, const TermTranslator &translator)
Definition TermGrader.cpp:24
TermGrader::getMaxIndexLessThan
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.
Definition TermGrader.cpp:153
TermGrader::getUpperBound
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...
Definition TermGrader.cpp:69
TermGrader::getMinIndexLessThan
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.
Definition TermGrader.cpp:126
TermGrader::getGradeSign
int getGradeSign(size_t var) const
Returns 1 if the grade strictly increases with the exponent of var, returns -1 if it strictly decreas...
Definition TermGrader.cpp:302
TermGrader::getGrade
const mpz_class & getGrade(size_t var, Exponent exponent) const
Definition TermGrader.cpp:275
TermGrader::_grades
vector< vector< mpz_class > > _grades
Definition TermGrader.h:119
TermTranslator
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Definition TermTranslator.h:41
Term
Term represents a product of variables which does not include a coefficient.
Definition Term.h:49
Exponent
unsigned int Exponent
Definition stdinc.h:89