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

◆ insert()

void GaussElimComputation::insert ( gm_elem * p)
private

Definition at line 32 of file gauss.cpp.

33{
34 if (p->f == nullptr)
35 {
36 if (p->fsyz != nullptr && collect_syz)
37 {
38 syz_list.push_back(p->fsyz);
39 n_syz++;
40 }
41 freemem(p);
42 }
43 else
44 {
45 ring_elem leadinv = R->invert(p->f->coeff);
46 R->mult_vec_to(p->f, leadinv, false);
47 R->mult_vec_to(p->fsyz, leadinv, false);
48 p->nterms = R->n_nonzero_terms(p->f);
49 int i = p->f->comp;
50 if (gb_list[i] == nullptr)
51 {
52 gb_list[i] = p;
53 n_gb++;
54 }
55 else
56 {
57 if (p->nterms < gb_list[i]->nterms)
58 {
59 gm_elem *q = p;
60 p = gb_list[i];
61 gb_list[i] = q;
62 }
63 p->next = reduce_list[i];
64 reduce_list[i] = p;
65 }
66 }
67}
gm_elem ** reduce_list
Definition gauss.hpp:62
gm_elem ** gb_list
Definition gauss.hpp:63
const Ring * R
Definition gauss.hpp:66
int p
void freemem(void *s)
Definition m2-mem.cpp:103

References collect_syz, freemem(), gb_list, n_gb, n_syz, p, R, and reduce_list.

Referenced by GaussElimComputation(), and start_computation().