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

◆ find_divisor()

int MonomialTable::find_divisor ( exponents_t exp,
int comp )

Definition at line 131 of file montable.cpp.

132{
133 assert(comp >= 1);
134 if (comp >= static_cast<int>(_head.size())) return -1;
135 if (comp == _last_match_comp && _last_match != nullptr &&
137 return _last_match->_val;
138 unsigned long expmask = ~exponents::mask(_nvars, exp);
139 mon_term *head = _head[comp];
140 for (mon_term *t = head->_next; t != head; t = t->_next)
141 if ((expmask & t->_mask) == 0)
142 if (exponents::divides(_nvars, t->_lead, exp))
143 {
144 _last_match = t;
145 _last_match_comp = comp;
146 // move_up(t,head);
147 return t->_val;
148 }
149 return -1;
150}
static bool divides(int nvars, ConstExponents a, ConstExponents b)
mon_term * _last_match
Definition montable.hpp:156
Doubly-linked-list node of a MonomialTable's per-component monomial list.
Definition montable.hpp:109

References _last_match, _last_match_comp, MonomialTable::mon_term::_next, _nvars, and ExponentVector< int, true >::divides().