196{
197
198
199
200
201
202
203
204 assert(comp >= 1);
205 if (comp >= static_cast<int>(_head.size())) return 0;
208 int i;
209
211 mpz_t g;
212 bool g_is_set = false;
213 for (t = head->_next; t != head; t = t->_next)
214 if ((expmask & t->_mask) == 0)
215 {
216 bool is_div = true;
217 for (i = 0; i <
_nvars; i++)
218 if (exp[i] < t->_lead[i])
219 {
220 is_div = false;
221 break;
222 }
223 if (!is_div) continue;
224 if (!g_is_set)
225 {
226 mpz_init_set(g, t->_coeff);
227 g_is_set = true;
228 }
229 else
230 mpz_gcd(g, g, t->_coeff);
231
232 if (mpz_divisible_p(c, g))
233 {
234 mpz_clear(g);
235 return true;
236 }
237 }
238 if (g_is_set) mpz_clear(g);
239 return false;
240}
static unsigned long monomial_mask(int nvars, exponents_t exp)
MonomialTable::mon_term plus an _coeff slot pointing at the entry's leading ZZ coefficient (or nullpt...