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

◆ processCurrentMonomial()

ComponentIndex F4Res::processCurrentMonomial ( res_packed_monomial thisMonom)
private

Definition at line 192 of file res-f4.cpp.

193{
194 res_packed_monomial new_m; // a pointer to a monomial we are visiting
195 if (mHashTable.find_or_insert(thisMonom, new_m))
196 {
197 // we did not need the monomial. So pop it.
198 mMonomSpace2.popLastAlloc(thisMonom-1);
199 return static_cast<ComponentIndex>(
200 new_m[-1]); // monom exists, don't save monomial space
201 }
202
203 // At this point thisMonom has been inserted. We keep it.
204
205 thisMonom = mMonomSpace2.allocate(1 + monoid().max_monomial_size());
206 thisMonom++; // so thisMonom[-1] exists, but is not part of the monomial, as far as
207
208 bool has_divisor = findDivisor(new_m, thisMonom);
209 if (!has_divisor)
210 {
211 mMonomSpace2.popLastAlloc(thisMonom-1);
212 new_m[-1] = -1; // no divisor exists
213 return -1;
214 }
215
216 ComponentIndex thiscol = static_cast<ComponentIndex>(mColumns.size());
217 new_m[-1] = thiscol; // this is a HACK: where we keep the divisor
218 mColumns.push_back(new_m);
219
220 Row row;
221 row.mLeadTerm = thisMonom;
222 mReducers.push_back(row);
223
224 return thiscol;
225}
MonomialHashTable< ResMonomialsWithComponent > mHashTable
Definition res-f4.hpp:173
const ResMonoid & monoid() const
Definition res-f4.hpp:103
std::vector< res_packed_monomial > mColumns
Definition res-f4.hpp:184
MonomialMemorySpace mMonomSpace2
Definition res-f4.hpp:188
std::vector< Row > mReducers
Definition res-f4.hpp:179
bool findDivisor(res_const_packed_monomial m, res_packed_monomial result)
findDivisor
Definition res-f4.cpp:109
res_monomial_word * res_packed_monomial
int ComponentIndex
res_packed_monomial mLeadTerm
Definition res-f4.hpp:121
One row of the Macaulay matrix built by F4Res::construct.
Definition res-f4.hpp:119

References findDivisor(), mColumns, mHashTable, F4Res::Row::mLeadTerm, mMonomSpace2, monoid(), and mReducers.

Referenced by processMonomialProduct().