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

◆ minimalize()

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

Reimplemented from ReducedGB_Field.

Definition at line 82 of file reducedgb-field-local.cpp.

84{
85 // First sort these elements via increasing lex order (or monomial order?)
86 // Next insert minimal elements into T, and polys
87
88 VECTOR(int) positions;
89 positions.reserve(polys0.size());
90
91 for (int i = 0; i < polys0.size(); i++) positions.push_back(i);
92
93 // displayElements("-- before sort --", R, polys0, [](auto& g) { return g.f;
94 // } );
95
96 std::stable_sort(positions.begin(),
97 positions.end(),
98 ReducedGB_Field_Local_sorter(R, F, polys0));
99
100 // VECTOR(gbvector*) sorted_elements_debug_only;
101 // for (int i=0; i<positions.size(); i++)
102 // sorted_elements_debug_only.push_back(polys0[positions[i]].f);
103 // displayElements("-- after sort --", R, sorted_elements_debug_only,
104 // [](auto& g) { return g; } );
105
106 // Now loop through each element, and see if the lead monomial is in T.
107 // If not, add it in , and place element into 'polys'.
108
109 for (VECTOR(int)::iterator i = positions.begin(); i != positions.end(); i++)
110 {
111 Bag *not_used;
112 gbvector *f = polys0[*i].f;
113 exponents_t e = R->exponents_make();
114 R->gbvector_get_lead_exponents(F, f, e);
115 if ((!Rideal || !Rideal->search_expvector(e, not_used)) &&
116 T->find_divisors(1, e, f->comp) == 0)
117 {
118 // Keep this element
119
120 POLY h;
121 ring_elem junk;
122
123 h.f = R->gbvector_copy(f);
124 h.fsyz = R->gbvector_copy(polys0[*i].fsyz);
125
126 if (false and auto_reduced)
127 remainder(h, false, junk); // This auto-reduces h.
128
129 R->gbvector_remove_content(h.f, h.fsyz);
130
131 T->insert(e, f->comp, INTSIZE(polys));
132 polys.push_back(h);
133 }
134 else
135 R->exponents_delete(e);
136 }
137
138 for (int i = 0; i < polys.size(); i++)
139 {
140 int f_lead_wt;
141 gbvector *f = polys[i].f;
142 int d = wt->gbvector_weight(f, f_lead_wt);
143 int a = d - f_lead_wt;
144
145 divisor_info t;
146 t.g = polys[i];
147 t.size = R->gbvector_n_terms(f);
148 t.alpha = a;
149 gb_elems.push_back(t);
150 }
151}
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
Per-element bookkeeping record used by ReducedGB_Field_Local during local-ring GB minimisation.
int comp
Definition gbring.hpp:82
#define INTSIZE(a)
Definition style.hpp:37

References ReducedGB_Field_Local::divisor_info::alpha, gbvector::comp, ReducedGB::F, POLY::f, POLY::fsyz, ReducedGB_Field_Local::divisor_info::g, INTSIZE, POLY, ReducedGB::R, remainder(), ReducedGB_Field::Rideal, ReducedGB_Field_Local::divisor_info::size, ReducedGB_Field::T, VECTOR, and wt.