Frobby 0.10.0
Loading...
Searching...
No Matches
TermGrader Class Reference

#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 &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

Detailed Description

A TermGrader assigns a value, the degree, to each monomial.

Member Function Documentation

◆ getDegree() [1/3]

mpz_class TermGrader::getDegree ( const Term & term) const

Returns the degree of term.

◆ getDegree() [2/3]

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.

◆ getDegree() [3/3]

void TermGrader::getDegree ( const Term & term,
mpz_class & degree ) const

Assigns the degree of term to degree.

◆ getGradeSign()

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.

◆ getLargestLessThan2() [1/2]

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.

◆ getLargestLessThan2() [2/2]

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.

◆ getMaxIndexLessThan()

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.

◆ getMinIndexLessThan()

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.

◆ getUpperBound() [1/2]

mpz_class TermGrader::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.

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.

◆ getUpperBound() [2/2]

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.


The documentation for this class was generated from the following files: