10#ifndef BIBASIS_MONOM_DL_HPP
11#define BIBASIS_MONOM_DL_HPP
72 void*
operator new(std::size_t);
73 void operator delete(
void* ptr);
120 TotalDegree = anotherMonom.TotalDegree;
121 VarsListNode **iterator = &ListHead,
122 *iteratorAnother = anotherMonom.ListHead;
123 while (iteratorAnother)
125 *iterator = new VarsListNode();
126 (*iterator)->Value = iteratorAnother->Value;
128 iterator = &((*iterator)->Next);
129 iteratorAnother = iteratorAnother->Next;
139 inline void* MonomDL::operator
new(std::size_t)
144 inline void MonomDL::operator
delete(
void* ptr)
157 while (position && position->
Next && position->
Next->
Value <= var)
159 position = position->
Next;
182 return varPosition && varPosition->
Value == var;
187 if (
this == &anotherMonom)
202 while (*iterator && iteratorAnother)
204 (*iterator)->Value = iteratorAnother->
Value;
205 iterator = &((*iterator)->Next);
206 iteratorAnother = iteratorAnother->
Next;
215 iteratorAnother = nodeToDelete;
216 nodeToDelete = nodeToDelete->
Next;
217 delete iteratorAnother;
220 else while (iteratorAnother)
223 (*iterator)->Value = iteratorAnother->
Value;
225 iterator = &((*iterator)->Next);
226 iteratorAnother = iteratorAnother->
Next;
248 position->
Value = var;
254 else if(position->
Value != var)
257 newNode->
Value = var;
259 position->
Next = newNode;
275 *
this = anotherMonom;
282 *anotherIterator = anotherMonom.
ListHead;
284 while (*iterator && anotherIterator)
286 if ((*iterator)->Value == anotherIterator->Value)
288 iterator = &((*iterator)->Next);
289 anotherIterator = anotherIterator->
Next;
291 else if ((*iterator)->Value < anotherIterator->Value)
293 iterator = &((*iterator)->Next);
298 newNode->
Value = anotherIterator->Value;
299 newNode->
Next = *iterator;
303 iterator = &(newNode->
Next);
304 anotherIterator = anotherIterator->
Next;
308 while (anotherIterator)
311 (*iterator)->Value = anotherIterator->Value;
314 iterator = &((*iterator)->Next);
315 anotherIterator = anotherIterator->
Next;
326 *anotherIterator = anotherMonom.
ListHead;
328 while (*iterator && anotherIterator)
330 if ((*iterator)->Value == anotherIterator->Value)
333 *iterator = (*iterator)->
Next;
336 anotherIterator = anotherIterator->Next;
338 else if ((*iterator)->Value < anotherIterator->Value)
340 iterator = &((*iterator)->Next);
354 while (iteratorA && iteratorB)
356 if (iteratorA->Value == iteratorB->Value)
358 iteratorA = iteratorA->Next;
359 iteratorB = iteratorB->Next;
365 (*iterator)->Value = iteratorA->Value;
366 iterator = &((*iterator)->Next);
367 if (iteratorA->Value < iteratorB->Value)
369 iteratorA = iteratorA->Next;
378 (*iterator)->Value = iteratorA->Value;
379 iterator = &((*iterator)->Next);
380 iteratorA = iteratorA->
Next;
393 *anotherIterator(anotherMonom.
ListHead);
394 while (anotherIterator)
396 if (iterator->Value != anotherIterator->
Value)
400 iterator = iterator->Next;
401 anotherIterator = anotherIterator->
Next;
403 return !anotherIterator;
416 *anotherIterator(anotherMonom.
ListHead);
417 while (anotherIterator)
419 if (iterator->Value != anotherIterator->
Value)
423 iterator = iterator->Next;
424 anotherIterator = anotherIterator->
Next;
426 return anotherIterator;
443 *anotherIterator(anotherMonom.
ListHead);
444 while (anotherIterator)
446 if (iterator->Value < anotherIterator->
Value)
450 if (iterator->Value > anotherIterator->
Value)
454 iterator = iterator->Next;
455 anotherIterator = anotherIterator->
Next;
474 *anotherIterator(anotherMonom.
ListHead);
475 while (anotherIterator)
477 if (iterator->Value < anotherIterator->
Value)
481 if (iterator->Value > anotherIterator->
Value)
485 iterator = iterator->Next;
486 anotherIterator = anotherIterator->
Next;
495 *anotherIterator = anotherMonom.
ListHead;
496 while (iterator && anotherIterator)
498 if (iterator->
Value == anotherIterator->Value)
500 iterator = iterator->
Next;
501 anotherIterator = anotherIterator->
Next;
503 else if (iterator->
Value < anotherIterator->Value)
505 iterator = iterator->
Next;
513 return !anotherIterator;
524 *anotherIterator(anotherMonom.
ListHead);
525 while (iterator && anotherIterator)
527 if (iterator->Value == anotherIterator->
Value)
529 iterator = iterator->Next;
530 anotherIterator = anotherIterator->
Next;
532 else if (iterator->Value < anotherIterator->
Value)
534 iterator = iterator->Next;
542 return !anotherIterator;
557 *anotherIterator = anotherMonom.
ListHead;
558 while (iterator && anotherIterator)
560 if (iterator->
Value != anotherIterator->Value)
564 iterator = iterator->
Next;
565 anotherIterator = anotherIterator->
Next;
568 return !anotherIterator;
579 while (iterator->
Next)
581 iterator = iterator->
Next;
583 return iterator->
Value;
593 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 FirstMultiVar() const
const MonomDL & operator=(const MonomDL &anotherMonom)
Integer operator[](Integer var) const
bool operator>(const MonomDL &anotherMonom) const
const MonomDL & operator/=(const MonomDL &anotherMonom)
bool IsDivisibleBy(const MonomDL &anotherMonom) const
int Compare(const MonomDL &anotherMonom)
static FastAllocator Allocator
void MultiplyBy(Integer var)
const MonomDL & operator*=(Integer var)
void SetQuotientOf(const MonomDL &monomA, const MonomDL &monomB)
VarsListNode * Find(const Integer var) const
bool IsTrueDivisibleBy(const MonomDL &anotherMonom) const
bool operator==(const MonomDL &anotherMonom) const
bool operator!=(const MonomDL &anotherMonom) const
bool operator<(const MonomDL &anotherMonom) const
bool IsPommaretDivisibleBy(const MonomDL &anotherMonom) const
std::set< Integer > GetVariablesSet() 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.