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

◆ gb_insert()

void GB_comp::gb_insert ( gbvector * f,
gbvector * fsyz,
int ismin )
private

Definition at line 559 of file gb-homog2.cpp.

560{
561 monomial f_m = _M->make_one();
562 gb_elem *p = new gb_elem(f, fsyz, ismin);
563
564 _GR->gbvector_get_lead_monomial(_F, p->f, f_m);
565 _GR->gbvector_remove_content(p->f, p->fsyz);
566
567 if (ismin)
568 {
569 p->is_min = 1;
570 }
571
572 if (_M->in_subring(1, f_m)) _n_subring++;
573 // insert into p->f->comp->mi_search
574 gc_vector<int> vp;
575 _M->to_varpower(f_m, vp);
576 _monideals[p->f->comp]->mi_search->insert(new Bag(p, vp));
577 _n_gb++;
578 _gb.push_back(p);
579 _M->remove(f_m);
580
581 // Now we must be a bit careful about this next, but we only want one
582 // copy of a GB element, since the whole thing can be quite large.
583 // Just make sure that when the GB is deleted at the end, that the 'f'
584 // field of the gb_elem's is not removed.
585
586 if (_use_hilb)
587 {
588 _hilb_new_elems = true;
590 }
591}
int _n_gb
Definition gb-homog2.hpp:92
bool _hilb_new_elems
int _n_subring
Definition gb-homog2.hpp:95
const Monoid * _M
Definition gb-homog2.hpp:70
const FreeModule * _F
Definition gb-homog2.hpp:73
bool _use_hilb
int _this_degree
Definition gb-homog2.hpp:75
GBRing * _GR
Definition gb-homog2.hpp:68
void flush_pairs(int deg)
int _hilb_n_in_degree
#define monomial
Definition gb-toric.cpp:11
int p
int_bag Bag
Definition int-bag.hpp:70

References _F, _GR, _hilb_n_in_degree, _hilb_new_elems, _M, _n_gb, _n_subring, _this_degree, _use_hilb, flush_pairs(), monomial, and p.

Referenced by gen_step(), and s_pair_step().