302{
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
324
326 positions.reserve(exps.size());
327 for (unsigned int i = 0; i < exps.size(); i++) positions.push_back(i);
328
329
330
331
332 std::stable_sort(
333 positions.begin(), positions.end(), sorter(nvars, exps, comps));
334
336
338 first = positions.begin();
339 end = positions.end();
341 {
342 VECTOR(
int)::iterator next = first + 1;
344 int comp = comps[*first];
346 {
348 if (comp != comps[*next]) break;
349 next++;
350 }
351 if (
T->find_divisor(this_exp, comp) == -1)
352 {
353
354
355 T->insert(this_exp, comp, *first);
356 result_positions.push_back(*first);
357 if (keep_duplicates)
358 while (++first != next) result_positions.push_back(*first);
359 }
360
361 first = next;
362
363 }
365}
exponents::Exponents exponents_t
static MonomialTable * make(int nvars)
static bool exponents_equal(int nvars, exponents_t a, exponents_t b)
TermIterator< Nterm > end(Nterm *)