Go to the documentation of this file.
72 Term(
const string& str);
153 ASSERT(a != 0 || varCount == 0);
154 ASSERT(b != 0 || varCount == 0);
155 for (
size_t var = 0; var < varCount; ++var)
174 ASSERT(a != 0 || varCount == 0);
175 ASSERT(b != 0 || varCount == 0);
176 for (
size_t var = 0; var < varCount; ++var)
198 ASSERT(a != 0 || varCount == 0);
199 ASSERT(b != 0 || varCount == 0);
200 bool bIsIdentity =
true;
201 for (
size_t var = 0; var < varCount; ++var) {
202 if (a[var] >= b[var] && a[var] != 0)
224 ASSERT(res != 0 || varCount == 0);
225 ASSERT(a != 0 || varCount == 0);
226 ASSERT(b != 0 || varCount == 0);
227 for (
size_t var = 0; var < varCount; ++var) {
258 ASSERT(res != 0 || varCount == 0);
259 ASSERT(a != 0 || varCount == 0);
260 ASSERT(b != 0 || varCount == 0);
261 for (
size_t var = 0; var < varCount; ++var) {
283 ASSERT(res != 0 || varCount == 0);
284 ASSERT(a != 0 || varCount == 0);
285 ASSERT(b != 0 || varCount == 0);
286 for (
size_t var = 0; var < varCount; ++var)
287 res[var] = a[var] + b[var];
305 ASSERT(res != 0 || varCount == 0);
306 for (
size_t var = 0; var < varCount; ++var)
317 ASSERT(a != 0 || varCount == 0);
318 for (
size_t var = 0; var < varCount; ++var)
332 ASSERT(a != 0 || varCount == 0);
333 for (
size_t var = 0; var < varCount; ++var)
347 ASSERT(a != 0 || varCount == 0);
348 for (
size_t var = 0; var < varCount; ++var)
362 ASSERT(a != 0 || varCount == 0);
364 for (
size_t var = 0; var < varCount; ++var) {
366 if (nonZeroOffset == 0)
382 ASSERT(a != 0 || varCount == 0);
384 for (
size_t var = 1; var < varCount; ++var)
403 ASSERT(a != 0 || varCount == 0);
405 for (
size_t var = 0; var < varCount; ++var)
418 for (
size_t var = 0; var < varCount; ++var)
419 if (a[var] != 0 && a[var] == b[var])
425 size_t hashCode = varCount;
426 for (
size_t var = 0; var < varCount; ++var)
427 hashCode = 31 * hashCode + a[var];
448 ASSERT(a != 0 || varCount == 0);
449 ASSERT(b != 0 || varCount == 0);
450 for (
size_t var = 0; var < varCount; ++var) {
479 ASSERT(res != 0 || varCount == 0);
480 ASSERT(a != 0 || varCount == 0);
481 ASSERT(b != 0 || varCount == 0);
482 for (
size_t var = 0; var < varCount; ++var) {
484 res[var] = a[var] - b[var];
508 ASSERT(res != 0 || varCount == 0);
509 ASSERT(dualOf != 0 || varCount == 0);
510 ASSERT(point != 0 || varCount == 0);
512 for (
size_t var = 0; var < varCount; ++var) {
513 ASSERT(dualOf[var] <= point[var]);
514 if (dualOf[var] != 0)
515 res[var] = point[var] - dualOf[var] + 1;
533 ASSERT(a != 0 || varCount == 0);
534 for (
size_t var = 0; var < varCount; ++var)
569 static void print(FILE* file,
const Exponent* e,
size_t varCount);
572 static void print(ostream& out,
const Exponent* e,
size_t varCount);
591 copy(exponents, exponents + varCount,
_exponents);
Exponent operator[](unsigned long offset) const
static bool isIdentity(const Exponent *a, size_t varCount)
Returns whether a is 1, i.e. whether all entries of a are 0.
bool hasSameSupport(const Exponent *a) const
Exponent operator[](int offset) const
static size_t getSizeOfSupport(const Exponent *a, size_t varCount)
Returns the number of variables such that divides .
Exponent operator[](unsigned long long offset) const
void colon(const Exponent *a, const Exponent *b)
static void deallocate(Exponent *p, size_t size)
static void lcm(Exponent *res, const Exponent *a, const Exponent *b, size_t varCount)
Sets res equal to the least commom multiple of a and b.
const Exponent * end() const
size_t getHashCode() const
void encodedDual(const Term &dualOf, const Term &point)
void reset(size_t newVarCount)
static bool hasSameSupport(const Exponent *a, const Exponent *b, size_t varCount)
Returns whether for every variable .
void lcm(const Exponent *a, const Exponent *b)
Term & operator=(const Exponent *exponents)
void product(const Exponent *a, const Exponent *b)
static void decrement(Exponent *a, size_t varCount)
Decrements each positive entry of a by one.
bool operator!=(const Exponent *term) const
bool sharesNonZeroExponent(const Term &a) const
void print(FILE *file) const
bool operator==(const Term &term) const
void swap(hashtable< _Val, _Key, _HF, _Extract, _EqKey, _All > &__ht1, hashtable< _Val, _Key, _HF, _Extract, _EqKey, _All > &__ht2)
const Exponent * begin() const
size_t getVarCount() const
bool dominates(const Term &term) const
static Exponent * allocate(size_t size)
bool divides(const Term &term) const
ostream & operator<<(ostream &out, const Term &term)
size_t getMiddleNonZeroExponent() const
static bool strictlyDivides(const Exponent *a, const Exponent *b, size_t varCount)
Returns whether a strictly divides b.
static void print(FILE *file, const Exponent *e, size_t varCount)
Writes e to file in a format suitable for debug output.
static size_t getFirstMaxExponent(const Exponent *a, size_t varCount)
Returns a var such that a[var] >= a[i] for all i.
bool hasSameSupport(const Term &a) const
static void product(Exponent *res, const Exponent *a, const Exponent *b, size_t varCount)
Sets res equal to the product of a and b.
void gcd(const Term &a, const Term &b)
void product(const Term &a, const Term &b)
Set this object equal to the product of a and b.
Exponent operator[](unsigned int offset) const
bool sharesNonZeroExponent(const Exponent *a) const
bool operator!=(const Term &term) const
Term represents a product of variables which does not include a coefficient.
bool divides(const Exponent *term) const
static size_t getMiddleNonZeroExponent(const Exponent *a, size_t varCount)
Returns a median element of the set of var's such that a[var] is non-zero.
static void colon(Exponent *res, const Exponent *a, const Exponent *b, size_t varCount)
Sets res equal to .
static size_t getHashCode(const Exponent *a, size_t varCount)
static bool isSquareFree(const Exponent *a, size_t varCount)
Returns whether a is square free, i.e. for each where .
void colon(const Term &a, const Term &b)
static void encodedDual(Exponent *res, const Exponent *dualOf, const Exponent *point, size_t varCount)
The parameter dualOf is interpreted to encode an irreducible ideal, and the dual of that reflected in...
void lcm(const Term &a, const Term &b, int position)
size_t getFirstMaxExponent() const
static bool divides(const Exponent *a, const Exponent *b, size_t varCount)
Returns whether a divides b.
size_t getFirstNonZeroExponent() const
size_t getSizeOfSupport() const
Term & operator=(const Term &term)
static bool sharesNonZeroExponent(const Exponent *a, const Exponent *b, size_t varCount)
Returns whether there is some such that .
static void setToIdentity(Exponent *res, size_t varCount)
Set res equal to , i.e. set each entry of res equal to 0.
void print(ostream &out) const
static void gcd(Exponent *res, const Exponent *a, const Exponent *b, size_t varCount)
Sets res equal to the greatest common divisor of a and b.
Exponent & operator[](unsigned int offset)
bool strictlyDivides(const Term &term) const
void lcm(const Term &a, const Term &b)
void initialize(const Exponent *exponents, size_t varCount)
bool isSquareFree() const
size_t getMaxExponent() const
bool dominates(const Exponent *term) const
static bool dominates(const Exponent *a, const Exponent *b, size_t varCount)
Returns whether a dominates b, i.e. whether b divides a.
bool strictlyDivides(const Exponent *term) const
static size_t getFirstNonZeroExponent(const Exponent *a, size_t varCount)
Returns least var such that a[var] is non-zero.
void encodedDual(const Exponent *dualOf, const Exponent *point)
Exponent & operator[](unsigned long offset)
void swap< Term >(Term &a, Term &b)
Exponent & operator[](unsigned long long offset)
Term(const Exponent *exponents, size_t varCount)
void gcd(const Exponent *a, const Exponent *b)
Term(size_t varCount)
This object is initialized to the identity, i.e. the exponent vector is the zero vector.
Exponent & operator[](int offset)