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

◆ add_marked_elems()

void MarkedGB::add_marked_elems ( const VECTOR(gbvector *) & leadterms,
const VECTOR(POLY) & polys0,
bool auto_reduced )
virtual

Definition at line 61 of file reducedgb-marked.cpp.

64{
65 (void) auto_reduced;
66 // First sort these elements via increasing lex order (or monomial order?)
67 // Next insert minimal elements into T, and polys
68 const Monoid *M = originalR->getMonoid();
69
70 leadterms = newarray(gbvector *, leadterms0.size());
71
72 // Now loop through each element, and see if the lead monomial is in T.
73 // If not, add it in , and place element into 'polys'.
74
75 for (int i = 0; i < leadterms0.size(); i++)
76 {
77 POLY h;
78 ring_elem junk;
79
80 gbvector *f = polys0[i].f;
81 gbvector *inf = leadterms0[i];
82
83 h.f = R->gbvector_copy(f);
84 h.fsyz = R->gbvector_copy(polys0[i].fsyz);
85
86 gbvector *iinf = nullptr;
87 for (gbvector *t = h.f; t != nullptr; t = t->next)
88 if (inf->comp == t->comp && EQ == M->compare(inf->monom, t->monom))
89 {
90 iinf = t;
91 break;
92 }
93 if (!iinf)
94 {
95 ERROR("lead term does not appear in the polynomial!");
96 iinf = f;
97 }
98 leadterms[i] = iinf;
99
100 exponents_t e = R->exponents_make();
101 R->gbvector_get_lead_exponents(F, iinf, e);
102
103 // if (auto_reduced)
104 // remainder(h,false,junk); // This auto-reduces h. MES MES!! Maybe
105 // not for marked GB!!
106
107 R->gbvector_remove_content(h.f, h.fsyz);
108
109 T->insert(e, iinf->comp, i);
110 polys.push_back(h);
111 }
112
113 auto_reduce();
114}
exponents::Exponents exponents_t
MonomialTable * T
gbvector ** leadterms
int compare(int nslots, const_monomial m, const_monomial n) const
Definition monoid.hpp:226
GBRing * R
Definition reducedgb.hpp:64
const PolynomialRing * originalR
Definition reducedgb.hpp:65
const FreeModule * F
Definition reducedgb.hpp:66
const int ERROR
Definition m2-mem.cpp:55
#define newarray(T, len)
Definition newdelete.hpp:82
#define POLY(q)
Definition poly.cpp:23
gbvector * fsyz
Definition gbring.hpp:99
gbvector * f
Definition gbring.hpp:98
gbvector * next
Definition gbring.hpp:80
int monom[1]
Definition gbring.hpp:83
int comp
Definition gbring.hpp:82
const int EQ
Definition style.hpp:40

References auto_reduce(), gbvector::comp, Monoid::compare(), EQ, ERROR, ReducedGB::F, POLY::f, POLY::fsyz, leadterms, gbvector::monom, newarray, gbvector::next, ReducedGB::originalR, POLY, ReducedGB::R, and T.

Referenced by GBDeclared::GBDeclared().