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

◆ minimalize()

void ReducedGB_Field::minimalize ( const VECTOR(POLY) & polys0,
bool auto_reduced )
virtual

Reimplemented from ReducedGB.

Reimplemented in ReducedGB_Field_Local.

Definition at line 56 of file reducedgb-field.cpp.

58{
59 // First sort these elements via increasing lex order (or monomial order?)
60 // Next insert minimal elements into T, and polys
61
62 VECTOR(int) positions;
63 positions.reserve(polys0.size());
64
65 for (int i = 0; i < polys0.size(); i++) positions.push_back(i);
66
67 // displayElements("-- before sort --", R, polys0, [](auto& g) { return g.f;
68 // } );
69
70 std::stable_sort(
71 positions.begin(), positions.end(), ReducedGB_Field_sorter(R, F, polys0));
72
73 // VECTOR(gbvector*) sorted_elements_debug_only;
74 // for (int i=0; i<positions.size(); i++)
75 // sorted_elements_debug_only.push_back(polys0[positions[i]].f);
76 // displayElements("-- after sort --", R, sorted_elements_debug_only,
77 // [](auto& g) { return g; } );
78
79 // Now loop through each element, and see if the lead monomial is in T.
80 // If not, add it in , and place element into 'polys'.
81
82 for (VECTOR(int)::iterator i = positions.begin(); i != positions.end(); i++)
83 {
84 Bag *not_used;
85 gbvector *f = polys0[*i].f;
86 exponents_t e = R->exponents_make();
87 R->gbvector_get_lead_exponents(F, f, e);
88 if ((!Rideal || !Rideal->search_expvector(e, not_used)) &&
89 T->find_divisors(1, e, f->comp) == 0)
90 {
91 // Keep this element
92
93 POLY h;
94 ring_elem junk;
95
96 h.f = R->gbvector_copy(f);
97 h.fsyz = R->gbvector_copy(polys0[*i].fsyz);
98
99 if (auto_reduced) remainder(h, false, junk); // This auto-reduces h.
100
101 R->gbvector_remove_content(h.f, h.fsyz);
102
103 T->insert(e, f->comp, INTSIZE(polys));
104 polys.push_back(h);
105 }
106 else
107 R->exponents_delete(e);
108 }
109}
exponents::Exponents exponents_t
virtual void remainder(POLY &f, bool use_denom, ring_elem &denom)
const MonomialIdeal * Rideal
MonomialTable * T
GBRing * R
Definition reducedgb.hpp:64
const FreeModule * F
Definition reducedgb.hpp:66
int_bag Bag
Definition int-bag.hpp:70
#define VECTOR(T)
Definition newdelete.hpp:78
#define POLY(q)
Definition poly.cpp:23
gbvector * fsyz
Definition gbring.hpp:99
gbvector * f
Definition gbring.hpp:98
int comp
Definition gbring.hpp:82
#define INTSIZE(a)
Definition style.hpp:37

References gbvector::comp, ReducedGB::F, POLY::f, POLY::fsyz, INTSIZE, POLY, ReducedGB::R, remainder(), Rideal, T, and VECTOR.