10#ifndef BIBASIS_MONOM_DRL_HPP
11#define BIBASIS_MONOM_DRL_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* MonomDRL::operator
new(std::size_t)
144 inline void MonomDRL::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 && iterator->
Value > anotherIterator->Value)
560 iterator = iterator->
Next;
563 while (iterator && anotherIterator)
565 if (iterator->
Value != anotherIterator->Value)
569 iterator = iterator->
Next;
570 anotherIterator = anotherIterator->
Next;
573 return !iterator && !anotherIterator;
595 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.
bool operator!=(const MonomDRL &anotherMonom) const
Integer operator[](const Integer var) const
const MonomDRL & operator*=(Integer var)
bool IsPommaretDivisibleBy(const MonomDRL &anotherMonom) const
bool operator<(const MonomDRL &anotherMonom) const
int Compare(const MonomDRL &anotherMonom)
const MonomDRL & operator/=(const MonomDRL &anotherMonom)
bool operator>(const MonomDRL &anotherMonom) const
bool operator==(const MonomDRL &anotherMonom) const
void MultiplyBy(Integer var)
Integer FirstMultiVar() const
static FastAllocator Allocator
VarsListNode * Find(const Integer var) const
bool IsTrueDivisibleBy(const MonomDRL &anotherMonom) const
std::set< Integer > GetVariablesSet() const
const MonomDRL & operator=(const MonomDRL &anotherMonom)
bool IsDivisibleBy(const MonomDRL &anotherMonom) const
void SetQuotientOf(const MonomDRL &monomA, const MonomDRL &monomB)
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.