227{
228
229
231
232
233
234 int skew_sign;
235
236
239
240
242 {
243
244
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
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 {
265
266
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
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)
const VectorArithmetic & vectorArithmetic() const
const ResPolyRing & ring() const
const ResMonoid & monoid() const
const ResPolyRing & mRing
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
TermIterator< Nterm > end(Nterm *)