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

◆ loadRow()

void F4Res::loadRow ( Row & r)
private

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

227{
228 // std::cout << "loadRow: " << std::endl;
229
231
232 // monoid().showAlpha(r.mLeadTerm);
233 // std::cout << std::endl;
234 int skew_sign; // will be set to 1, unless ring().isSkewCommutative() is
235 // true, then it can be -1,0,1.
236 // however, if it is 0, then "val" below will also be -1.
237 long comp = monoid().get_component(r.mLeadTerm);
238 auto& thiselement = mFrame.level(mThisLevel - 1)[comp];
239 // std::cout << " comp=" << comp << " mDegree=" << thiselement.mDegree << "
240 // mThisDegree=" << mThisDegree << std::endl;
241 if (thiselement.mDegree == mThisDegree)
242 {
243 // We only need to add in the current monomial
244 // fprintf(stdout, "USING degree 0 monomial\n");
245 ComponentIndex val =
246 processMonomialProduct(r.mLeadTerm, thiselement.mMonom, skew_sign);
247 if (val < 0) fprintf(stderr, "ERROR: expected monomial to live\n");
248 r.mComponents.push_back(val);
249 if (skew_sign > 0)
250 mRing.vectorArithmetic().pushBackOne(r.mCoeffs);
251 else
252 {
253 // Only happens if we are in a skew commuting ring.
255 }
256 return;
257 }
258 auto& p = thiselement.mSyzygy;
259 auto end = ResPolynomialIterator(mRing, p, 1);
260 auto i = ResPolynomialIterator(mRing, p);
261 for (; i != end; ++i)
262 {
263 ComponentIndex val =
264 processMonomialProduct(r.mLeadTerm, i.monomial(), skew_sign);
265 // std::cout << " monom: " << val << " skewsign=" << skew_sign << "
266 // mColumns.size=" << mColumns.size() << std::endl;
267 if (val < 0) continue;
268 r.mComponents.push_back(val);
269 if (skew_sign > 0)
270 mRing.vectorArithmetic().pushBackElement(
271 r.mCoeffs, p.coeffs, i.coefficient_index());
272 else
273 {
274 // Only happens if we are in a skew commuting ring.
275 mRing.vectorArithmetic().pushBackNegatedElement(
276 r.mCoeffs, p.coeffs, i.coefficient_index());
277 }
278 }
279}
ComponentIndex processMonomialProduct(res_const_packed_monomial m, res_const_packed_monomial n, int &result_sign_if_skew)
Definition res-f4.cpp:154
int mThisDegree
Definition res-f4.hpp:165
const VectorArithmetic & vectorArithmetic() const
Definition res-f4.hpp:102
const ResPolyRing & ring() const
Definition res-f4.hpp:104
int mThisLevel
Definition res-f4.hpp:164
const ResMonoid & monoid() const
Definition res-f4.hpp:103
SchreyerFrame & mFrame
Definition res-f4.hpp:159
const ResPolyRing & mRing
Definition res-f4.hpp:161
component_index get_component(res_const_packed_monomial m) const
const VectorArithmetic & vectorArithmetic() const
ElementArray allocateElementArray(ComponentIndex nelems) const
Create a coefficient vector with room for nelems coefficients.
void pushBackMinusOne(ElementArray &coeffs) const
int p
int ComponentIndex
TermIterator< Nterm > end(Nterm *)
Definition ringelem.cpp:5

References VectorArithmetic::allocateElementArray(), end(), ResMonoidDense::get_component(), F4Res::Row::mCoeffs, F4Res::Row::mComponents, mFrame, F4Res::Row::mLeadTerm, monoid(), mRing, mThisDegree, mThisLevel, p, processMonomialProduct(), VectorArithmetic::pushBackMinusOne(), ring(), vectorArithmetic(), and ResPolyRing::vectorArithmetic().

Referenced by makeMatrix().