Frobby
0.9.5
|
A TermGrader assigns a value, the degree, to each monomial. More...
#include <TermGrader.h>
Public Member Functions | |
TermGrader (const vector< mpz_class > &varDegrees, const TermTranslator &translator) | |
mpz_class | getDegree (const Term &term) const |
Returns the degree of term. More... | |
void | getDegree (const Term &term, mpz_class °ree) const |
Assigns the degree of term to degree. More... | |
void | getDegree (const Term &term, const Projection &projection, mpz_class °ree) const |
Assigns the degree of the preimage of term through the projection to degree. More... | |
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. More... | |
mpz_class | getUpperBound (const Term &divisor, const Term &dominator) const |
Returns the degree of the largest term v such that divisor divides v and v divides dominator. More... | |
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. More... | |
Exponent | getLargestLessThan2 (size_t var, Exponent from, Exponent to, const mpz_class &value, bool strict=true) const |
Returns the value in the interval [from, to] that is closest to getLargestLessThan(var, value, strict). More... | |
void | getIncrementedDegree (const Term &term, const Projection &projection, mpz_class °ree) const |
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. More... | |
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. More... | |
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 |
Returns 1 if the grade strictly increases with the exponent of var, returns -1 if it strictly decreases, and returns 0 if changing the exponent has no impact on the grade. More... | |
Private Attributes | |
vector< vector< mpz_class > > | _grades |
vector< int > | _signs |
A TermGrader assigns a value, the degree, to each monomial.
Definition at line 27 of file TermGrader.h.
TermGrader::TermGrader | ( | const vector< mpz_class > & | varDegrees, |
const TermTranslator & | translator | ||
) |
Definition at line 24 of file TermGrader.cpp.
mpz_class TermGrader::getDegree | ( | const Term & | term | ) | const |
Returns the degree of term.
Definition at line 47 of file TermGrader.cpp.
void TermGrader::getDegree | ( | const Term & | term, |
const Projection & | projection, | ||
mpz_class & | degree | ||
) | const |
Assigns the degree of the preimage of term through the projection to degree.
Definition at line 60 of file TermGrader.cpp.
void TermGrader::getDegree | ( | const Term & | term, |
mpz_class & | degree | ||
) | const |
Assigns the degree of term to degree.
Definition at line 53 of file TermGrader.cpp.
const mpz_class & TermGrader::getGrade | ( | size_t | var, |
Exponent | exponent | ||
) | const |
Definition at line 275 of file TermGrader.cpp.
int TermGrader::getGradeSign | ( | size_t | var | ) | const |
Returns 1 if the grade strictly increases with the exponent of var, returns -1 if it strictly decreases, and returns 0 if changing the exponent has no impact on the grade.
Definition at line 302 of file TermGrader.cpp.
void TermGrader::getIncrementedDegree | ( | const Term & | term, |
const Projection & | projection, | ||
mpz_class & | degree | ||
) | const |
Definition at line 266 of file TermGrader.cpp.
Exponent TermGrader::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.
If strict is true, then it is strictly less than, otherwise it is less than or equal to. If no such exponent exists, then the return value is 0.
If the sign is zero, then 0 is returned. Uses a linear scan, and is only really used to check the output of the other overload.
Definition at line 179 of file TermGrader.cpp.
Exponent TermGrader::getLargestLessThan2 | ( | size_t | var, |
Exponent | from, | ||
Exponent | to, | ||
const mpz_class & | value, | ||
bool | strict = true |
||
) | const |
Returns the value in the interval [from, to] that is closest to getLargestLessThan(var, value, strict).
Only uses a logarithmic number of comparisons.
Definition at line 199 of file TermGrader.cpp.
Exponent TermGrader::getMaxExponent | ( | size_t | var | ) | const |
Definition at line 282 of file TermGrader.cpp.
bool TermGrader::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.
Returns true if such a t exists, and false otherwise.
Definition at line 152 of file TermGrader.cpp.
bool TermGrader::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.
Returns true if such a t exists, and false otherwise.
Definition at line 125 of file TermGrader.cpp.
Returns the degree of the largest term v such that divisor divides v and v divides dominator.
Returning the value implies a copy so that this overload is less efficient than the one placing the value in a parameter. This purpose of this method is to be more convenient for tests.
Definition at line 118 of file TermGrader.cpp.
void TermGrader::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 at line 69 of file TermGrader.cpp.
size_t TermGrader::getVarCount | ( | ) | const |
Definition at line 287 of file TermGrader.cpp.
void TermGrader::print | ( | ostream & | out | ) | const |
Definition at line 291 of file TermGrader.cpp.
|
private |
Definition at line 119 of file TermGrader.h.
|
private |
Definition at line 120 of file TermGrader.h.