40 for (
size_t var = 1; var <
varCount; ++var)
100 for (
size_t i = 0;
i <
ideals.size(); ++
i)
109 for (
size_t i = 0;
i <
ideals.size(); ++
i) {
120 unsigned int ui =
e.get_ui();
139 for (
size_t e = 0;
e < size; ++
e)
156(
const string*
a,
const string*
b) {
161(
const string*
a,
const string*
b) {
171 for (
size_t ideal = 0; ideal <
bigIdeals.size(); ++ideal) {
175 for (
size_t var = 0; var <
bigIdeals[ideal]->getVarCount(); ++var)
200 Ideal& ideal)
const {
208 for (
size_t var = 0; var <
bigIdeal.getVarCount(); ++var)
211 for (
size_t var = 0; var <
bigIdeal.getVarCount(); ++var) {
223 for (
size_t i = 0;
i <
bigIdeal.getGeneratorCount(); ++
i) {
224 for (
size_t var = 0; var <
varCount; ++var) {
251 for (
size_t var = 0; var <
varCount; ++var) {
267 while (term != ideal.
end()) {
269 for (
size_t var = 0; var <
varCount; ++var) {
270 if ((*term)[var] ==
getMaxId(var)) {
279 bool last = (term + 1 == ideal.
end());
290 for (
size_t var = 0; var <
_exponents.size(); ++var)
298 for (
size_t var = 0; var <
_exponents.size(); ++var)
329 out <<
"TermTranslator(\n";
330 for (
size_t var = 0; var <
_exponents.size(); ++var) {
331 out <<
" var " << var + 1 <<
':';
368 str =
new char[
out.str().size() + 1];
455 for (
size_t var = 0; var <
varCount; ++var) {
467 const Term&
b)
const {
485 for (
size_t var = 0; var <
translator.getVarCount(); ++var)
void exceptionSafePushBack(Container &container, auto_ptr< Element > pointer)
void nameFactoryRegister(NameFactory< AbstractProduct > &factory)
Registers the string returned by ConcreteProduct::getStaticName() to a function that default-construc...
void setToZeroOne(TermTranslator &translator)
bool mpzClassPointerLess(const mpz_class *a, const mpz_class *b)
ostream & operator<<(ostream &out, const TermTranslator &translator)
bool mpzClassPointerEqual(const mpz_class *a, const mpz_class *b)
void extractExponents(const vector< BigIdeal * > &ideals, vector< mpz_class > &exponents, const string &varName)
bool TermTranslatorInitializeHelper_StringPointerCompareLess(const string *a, const string *b)
bool TermTranslatorInitializeHelper_StringPointerCompareEqual(const string *a, const string *b)
const VarNames & getNames() const
size_t getGeneratorCount() const
const mpz_class & getExponent(size_t term, size_t var) const
A replacement for stringstream.
Represents a monomial ideal with int exponents.
void remove(const_iterator it)
void clearAndSetVarCount(size_t varCount)
Cont::const_iterator const_iterator
void insert(const Exponent *term)
const_iterator end() const
const_iterator begin() const
size_t getVarCount() const
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
void swapVariables(size_t a, size_t b)
const mpz_class & getExponent(size_t variable, Exponent exponent) const
This method translates from IDs to arbitrary precision integers.
size_t getVarCount() const
void addPurePowersAtInfinity(Ideal &ideal) const
Adds a generator of the form v^e, e > 0, for any variable v where generator of that form is not alrea...
void renameVariables(const VarNames &names)
bool lessThanReverseLex(const Exponent *a, const Exponent *b) const
vector< vector< const char * > > _stringExponents
TermTranslator(size_t varCount, size_t upToExponent)
Constructs a translator of varCount variables that translates each number to itself,...
void makeStrings(bool includeVar) const
vector< vector< const char * > > _stringVarExponents
void dualize(const vector< mpz_class > &a)
Replaces var^v by var^(a[i] - v) except that var^0 is left alone.
TermTranslator & operator=(const TermTranslator &translator)
const char * getExponentString(size_t variable, Exponent exponent) const
as getExponent, except the string "e" is returned, where e is the exponent.
Exponent getMaxId(size_t variable) const
The assigned IDs are those in the range [0, getMaxId(var)].
Exponent shrinkExponent(size_t var, const mpz_class &exponent) const
void shrinkBigIdeal(const BigIdeal &bigIdeal, Ideal &ideal) const
vector< vector< mpz_class > > _exponents
void initialize(const vector< BigIdeal * > &bigIdeals, bool sortVars)
void setInfinityPowersToZero(Ideal &ideal) const
The method addPurePowersAtInfinity adds high exponents that map to zero.
const char * getVarExponentString(size_t variable, Exponent exponent) const
As getExponent, except the string "var^e" is returned or null if the exponent is zero,...
void decrement()
Replaces var^v by var^(v-1).
void print(ostream &out) const
const VarNames & getNames() const
Term represents a product of variables which does not include a coefficient.
size_t getFirstNonZeroExponent() const
size_t getSizeOfSupport() const
bool operator()(const Term &a, const Term &b) const
const TermTranslator & _translator
Defines the variables of a polynomial ring and facilities IO involving them.
bool addVar(const string &name)
Adds the variable and returns true if name is not already a variable.
size_t getVarCount() const
Returns the current number of variables.
const string & getName(size_t index) const
The returned reference can become invalid next time addVar is called.
void swapVariables(size_t a, size_t b)
Swaps the variables with indexes a and b.
static const size_t invalidIndex
Returns a fixed variable offset that is always invalid.
size_t getIndex(const string &name) const
Returns VarNames::invalidIndex() if name is not known.