|
Frobby 0.10.0
|
#include <TermGrader.h>
Public Member Functions | |
| TermGrader (const vector< mpz_class > &varDegrees, const TermTranslator &translator) | |
| mpz_class | getDegree (const Term &term) const |
| void | getDegree (const Term &term, mpz_class °ree) const |
| void | getDegree (const Term &term, const Projection &projection, mpz_class °ree) 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 °ree) 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 |
A TermGrader assigns a value, the degree, to each monomial.
| mpz_class TermGrader::getDegree | ( | const Term & | term | ) | const |
Returns the degree of term.
| 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.
| void TermGrader::getDegree | ( | const Term & | term, |
| mpz_class & | degree ) const |
Assigns the degree of term to degree.
| 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.
| 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.
| 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.
| 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.
| 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.
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.
| 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.