Macaulay2 Engine
Loading...
Searching...
No Matches

◆ IsPommaretDivisibleBy()

bool BIBasis::MonomDRL::IsPommaretDivisibleBy ( const MonomDRL & anotherMonom) const
inline

Definition at line 545 of file monomDRL.hpp.

546 {
547 if (TotalDegree < anotherMonom.TotalDegree)
548 {
549 return false;
550 }
551 if (!anotherMonom.TotalDegree)
552 {
553 return true;
554 }
555
556 VarsListNode *iterator = ListHead,
557 *anotherIterator = anotherMonom.ListHead;
558 while (iterator && iterator->Value > anotherIterator->Value)
559 {
560 iterator = iterator->Next;
561 }
562
563 while (iterator && anotherIterator)
564 {
565 if (iterator->Value != anotherIterator->Value)
566 {
567 break;
568 }
569 iterator = iterator->Next;
570 anotherIterator = anotherIterator->Next;
571 }
572
573 return !iterator && !anotherIterator;
574 }
Integer TotalDegree
Definition monom.hpp:106
VarsListNode * ListHead
Definition monom.hpp:105
Singly linked-list node of a Monom's variable list, with a per-class slab allocator.
Definition monom.hpp:94

References IsPommaretDivisibleBy(), BIBasis::Monom::ListHead, MonomDRL(), BIBasis::Monom::VarsListNode::Next, BIBasis::Monom::TotalDegree, and BIBasis::Monom::VarsListNode::Value.

Referenced by IsPommaretDivisibleBy().