10#ifndef BIBASIS_MONOM_LEX_HPP
11#define BIBASIS_MONOM_LEX_HPP
75 void*
operator new(std::size_t);
76 void operator delete(
void* ptr);
122 TotalDegree = anotherMonom.TotalDegree;
123 VarsListNode **iterator = &ListHead,
124 *iteratorAnother = anotherMonom.ListHead;
125 while (iteratorAnother)
127 *iterator = new VarsListNode();
128 (*iterator)->Value = iteratorAnother->Value;
130 iterator = &((*iterator)->Next);
131 iteratorAnother = iteratorAnother->Next;
141 inline void* MonomLex::operator
new(std::size_t)
146 inline void MonomLex::operator
delete(
void* ptr)
159 while (position && position->
Next && position->
Next->
Value <= var)
161 position = position->
Next;
184 return varPosition && varPosition->
Value == var;
189 if (
this == &anotherMonom)
204 while (*iterator && iteratorAnother)
206 (*iterator)->Value = iteratorAnother->
Value;
207 iterator = &((*iterator)->Next);
208 iteratorAnother = iteratorAnother->
Next;
217 iteratorAnother = nodeToDelete;
218 nodeToDelete = nodeToDelete->
Next;
219 delete iteratorAnother;
222 else while (iteratorAnother)
225 (*iterator)->Value = iteratorAnother->
Value;
227 iterator = &((*iterator)->Next);
228 iteratorAnother = iteratorAnother->
Next;
250 position->
Value = var;
256 else if(position->
Value != var)
259 newNode->
Value = var;
261 position->
Next = newNode;
277 *
this = anotherMonom;
284 *anotherIterator = anotherMonom.
ListHead;
286 while (*iterator && anotherIterator)
288 if ((*iterator)->Value == anotherIterator->Value)
290 iterator = &((*iterator)->Next);
291 anotherIterator = anotherIterator->
Next;
293 else if ((*iterator)->Value < anotherIterator->Value)
295 iterator = &((*iterator)->Next);
300 newNode->
Value = anotherIterator->Value;
301 newNode->
Next = *iterator;
305 iterator = &(newNode->
Next);
306 anotherIterator = anotherIterator->
Next;
310 while (anotherIterator)
313 (*iterator)->Value = anotherIterator->Value;
316 iterator = &((*iterator)->Next);
317 anotherIterator = anotherIterator->
Next;
328 *anotherIterator = anotherMonom.
ListHead;
330 while (*iterator && anotherIterator)
332 if ((*iterator)->Value == anotherIterator->Value)
335 *iterator = (*iterator)->
Next;
338 anotherIterator = anotherIterator->Next;
340 else if ((*iterator)->Value < anotherIterator->Value)
342 iterator = &((*iterator)->Next);
356 while (iteratorA && iteratorB)
358 if (iteratorA->Value == iteratorB->Value)
360 iteratorA = iteratorA->Next;
361 iteratorB = iteratorB->Next;
367 (*iterator)->Value = iteratorA->Value;
368 iterator = &((*iterator)->Next);
369 if (iteratorA->Value < iteratorB->Value)
371 iteratorA = iteratorA->Next;
380 (*iterator)->Value = iteratorA->Value;
381 iterator = &((*iterator)->Next);
382 iteratorA = iteratorA->
Next;
395 *anotherIterator(anotherMonom.
ListHead);
396 while (anotherIterator)
398 if (iterator->Value != anotherIterator->
Value)
402 iterator = iterator->Next;
403 anotherIterator = anotherIterator->
Next;
405 return !anotherIterator;
418 *anotherIterator(anotherMonom.
ListHead);
419 while (anotherIterator)
421 if (iterator->Value != anotherIterator->
Value)
425 iterator = iterator->Next;
426 anotherIterator = anotherIterator->
Next;
428 return anotherIterator;
435 *anotherIterator = anotherMonom.
ListHead;
436 while (anotherIterator && iterator)
438 if (iterator->
Value < anotherIterator->Value)
442 if (iterator->
Value > anotherIterator->Value)
446 iterator = iterator->
Next;
447 anotherIterator = anotherIterator->
Next;
449 return anotherIterator;
455 *anotherIterator = anotherMonom.
ListHead;
456 while (anotherIterator && iterator)
458 if (iterator->
Value < anotherIterator->Value)
462 if (iterator->
Value > anotherIterator->Value)
466 iterator = iterator->
Next;
467 anotherIterator = anotherIterator->
Next;
475 *anotherIterator = anotherMonom.
ListHead;
476 while (iterator && anotherIterator)
478 if (iterator->
Value == anotherIterator->Value)
480 iterator = iterator->
Next;
481 anotherIterator = anotherIterator->
Next;
483 else if (iterator->
Value < anotherIterator->Value)
485 iterator = iterator->
Next;
493 return !anotherIterator;
504 *anotherIterator(anotherMonom.
ListHead);
505 while (iterator && anotherIterator)
507 if (iterator->Value == anotherIterator->
Value)
509 iterator = iterator->Next;
510 anotherIterator = anotherIterator->
Next;
512 else if (iterator->Value < anotherIterator->
Value)
514 iterator = iterator->Next;
522 return !anotherIterator;
537 *anotherIterator = anotherMonom.
ListHead;
538 while (iterator && anotherIterator)
540 if (iterator->
Value != anotherIterator->Value)
544 iterator = iterator->
Next;
545 anotherIterator = anotherIterator->
Next;
548 return !anotherIterator;
559 while (iterator->
Next)
561 iterator = iterator->
Next;
563 return iterator->
Value;
573 iterator = iterator->
Next;
BIBasis::FastAllocator — per-size-class slab allocator for BIBasis's small objects.
Slab allocator handing out fixed-size blocks for one BIBasis type per instance.
Integer operator[](Integer var) const
void MultiplyBy(Integer var)
VarsListNode * Find(const Integer var) const
const MonomLex & operator/=(const MonomLex &anotherMonom)
bool operator>(const MonomLex &anotherMonom) const
bool IsDivisibleBy(const MonomLex &anotherMonom) const
int Compare(const MonomLex &anotherMonom)
static FastAllocator Allocator
Integer FirstMultiVar() const
bool operator!=(const MonomLex &anotherMonom) const
std::set< Integer > GetVariablesSet() const
void SetQuotientOf(const MonomLex &monomA, const MonomLex &monomB)
bool IsTrueDivisibleBy(const MonomLex &anotherMonom) const
const MonomLex & operator=(const MonomLex &anotherMonom)
bool IsPommaretDivisibleBy(const MonomLex &anotherMonom) const
const MonomLex & operator*=(Integer var)
bool operator==(const MonomLex &anotherMonom) const
bool operator<(const MonomLex &anotherMonom) const
VALGRIND_MAKE_MEM_DEFINED & result(result)
BIBasis::Monom — abstract squarefree-monomial base for the three Janet orderings.
Singly linked-list node of a Monom's variable list, with a per-class slab allocator.