26 const size_t MaxLeafSize = 60;
32 for (; begin != end; ++begin)
63 if ((
size_t)distance(
_begin,
_end) <= MaxLeafSize)
75 for (
size_t var = 1; var <
_varCount; ++var)
76 if (lcm[var] - gcd[var] > lcm[maxVar] - gcd[maxVar])
88 _pivot = (lcm[maxVar] + gcd[maxVar]) >> 1;
95 while (left != right) {
97 while ((*left)[
_var] <=
_pivot && left != right)
101 while ((*right)[
_var] >
_pivot && left != right)
135 if (_lessOrEqual.get() != 0) {
136 ASSERT(_greater.get() != 0);
138 _lessOrEqual->strictlyContains(term) ||
139 _greater->strictlyContains(term);
140 ASSERT(returnValue == rawStrictlyDivides(_begin, _end, term, _varCount));
143 ASSERT(_greater.get() == 0);
144 return rawStrictlyDivides(_begin, _end, term, _varCount);
163 return _root->strictlyContains(term);
168 return _root->getVarCount();
Cont::const_iterator const_iterator
auto_ptr< Node > _lessOrEqual
Represents a monomial ideal with int exponents.
void lcm(Word *res, const Word *resEnd, const Word *a, const Word *b)
size_t getVarCount() const
static bool strictlyDivides(const Exponent *a, const Exponent *b, size_t varCount)
Returns whether a strictly divides b.
size_t getVarCount() const
IdealTree(const Ideal &ideal)
void gcd(Word *res, const Word *resEnd, const Word *a, const Word *b)
size_t getVarCount() const
bool strictlyContains(const Exponent *term) const
Node(Ideal::iterator begin, Ideal::iterator end, size_t varCount)
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.
auto_ptr< Ideal > _storage
auto_ptr< Node > _greater
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.
Term represents a product of variables which does not include a coefficient.
bool strictlyContains(const Exponent *term) const
void swap(hashtable< _Val, _Key, _HF, _Extract, _EqKey, _All > &__ht1, hashtable< _Val, _Key, _HF, _Extract, _EqKey, _All > &__ht2)