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

◆ gb_insert()

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

Definition at line 485 of file res-a2-gb.cpp.

486{
487 monomial f_m = M->make_one();
488 gbvector *bull = nullptr;
489 gb_elem *p = new gb_elem(f, fsyz, ismin);
490
491 if (orig_syz < 0 && ismin)
492 GR->gbvector_remove_content(p->f, bull);
493 else
494 GR->gbvector_remove_content(p->f, p->fsyz);
495
496 if (M2_gbTrace >= 10)
497 {
498 buffer o;
499 o << "inserting level " << level << " ";
500 GR->gbvector_text_out(o, F, p->f);
501 o << newline;
502 emit(o.str());
503 }
504 if (ismin) n_mingens++;
505 GR->gbvector_get_lead_monomial(F, p->f, f_m);
506
507 if (M->in_subring(1, f_m)) n_subring++;
508 // insert into p->f->comp->mi_search
509 gc_vector<int> vp;
510 M->to_varpower(f_m, vp);
511 monideals[p->f->comp]->mi_search->insert(new Bag(p, vp));
512 gb.push_back(p);
513
514 M->remove(f_m);
515
516 // Now do auto-reduction of previous elements using this one.
517 if (orig_syz >= 0 || !ismin)
518 for (int i = n_gb_first; i < n_gb; i++)
519 {
520 // Now compute gb(i) := gb(i) - c gb(j), where
521 // c in(gb(j)) is a term in gb(i).
522 // Also compute change(i) -= c change(j).
523
524 GR->gbvector_auto_reduce(F, Fsyz, gb[i]->f, gb[i]->fsyz, p->f, p->fsyz);
525 }
526
527 n_gb++;
528}
char * str()
Definition buffer.hpp:72
int n_gb_first
Definition res-a2.hpp:126
int n_subring
Definition res-a2.hpp:143
FreeModule * Fsyz
Definition res-a2.hpp:121
int level
Definition res-a2.hpp:123
int orig_syz
Definition res-a2.hpp:157
int n_gb
Definition res-a2.hpp:141
int n_mingens
Definition res-a2.hpp:142
FreeModule * F
Definition res-a2.hpp:120
const Monoid * M
Definition res-a2.hpp:115
GBRing * GR
Definition res-a2.hpp:114
void gb(IntermediateBasis &F, int n)
#define monomial
Definition gb-toric.cpp:11
int p
int_bag Bag
Definition int-bag.hpp:70
char newline[]
Definition m2-types.cpp:49
int M2_gbTrace
Definition m2-types.cpp:52
void emit(const char *s)
Definition text-io.cpp:41

References emit(), F, Fsyz, gb(), GR, level, M, M2_gbTrace, monomial, n_gb, n_gb_first, n_mingens, n_subring, newline, orig_syz, p, and buffer::str().

Referenced by receive_generator(), and s_pair_step().