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

◆ wipe_unneeded_terms()

void GBKernelComputation::wipe_unneeded_terms ( gbvector *& f)
private

Definition at line 342 of file Eschreyer.cpp.

343{
344 // Remove every term of f (except the lead term)
345 // which is NOT divisible by an element of mi.
346 exponents_t exp = newarray_atomic(int, GR->n_vars());
347 // int nterms = 1;
348 // int nsaved = 0;
349 gbvector *g = f;
350 while (g->next != nullptr)
351 {
352 // First check to see if the term g->next is in the monideal
353 // nterms++;
354 Bag *b;
355 GR->gbvector_get_lead_exponents(F, g->next, exp);
356 if (mi[g->next->comp - 1]->search_expvector(exp, b))
357 {
358 // Want to keep the monomial
359 g = g->next;
360 }
361 else
362 {
363 // Want to dump this term
364 // nsaved++;
365 gbvector *tmp = g->next;
366 g->next = tmp->next;
367 tmp->next = nullptr;
368 GR->gbvector_remove(tmp);
369 }
370 }
371#if 0
372// if (M2_gbTrace >= 5)
373// {
374// buffer o;
375// o << "[" << nterms << ",s" << nsaved << "]";
376// emit_wrapped(o.str());
377// }
378#endif
379}
exponents::Exponents exponents_t
const FreeModule * F
Definition Eschreyer.hpp:93
gc_vector< MonomialIdeal * > mi
Definition Eschreyer.hpp:97
int_bag Bag
Definition int-bag.hpp:70
const mpreal exp(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
Definition mpreal.h:2298
#define newarray_atomic(T, len)
Definition newdelete.hpp:91
gbvector * next
Definition gbring.hpp:80
int comp
Definition gbring.hpp:82

References gbvector::comp, F, GR, mi, newarray_atomic, and gbvector::next.

Referenced by geo_reduce(), reduce(), and s_pair().