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

◆ autoreduceByLastElement()

void NCF4::autoreduceByLastElement ( )
private

Definition at line 358 of file NCF4.cpp.

359{
360 if (mGroebner.size() <= 1) return;
361 const Poly& lastPoly = *(mGroebner[mGroebner.size()-1]);
362 Monom leadMon = lastPoly.cbegin().monom();
363 for (auto fPtr = mGroebner.begin(); fPtr != mGroebner.end() - 1; ++fPtr)
364 {
365 ring_elem foundCoeff = getCoeffOfMonom(**fPtr,leadMon);
366 if (!freeAlgebra().coefficientRing()->is_zero(foundCoeff))
367 {
368 Poly* result = new Poly;
369 freeAlgebra().subtractScalarMultipleOf(*result,**fPtr,lastPoly,foundCoeff);
370 freeAlgebra().swap(**fPtr,*result);
371 }
372 }
373}
Polynomial< CoefficientRingType > Poly
void subtractScalarMultipleOf(Poly &result, const Poly &f, const Poly &g, ring_elem coeff) const
void swap(Poly &f, Poly &g) const
PolyList mGroebner
Definition NCF4.hpp:222
ring_elem getCoeffOfMonom(const Poly &f, const Monom &m) const
Definition NCF4.cpp:347
const FreeAlgebra & freeAlgebra() const
Definition NCF4.hpp:282
VALGRIND_MAKE_MEM_DEFINED & result(result)

References freeAlgebra(), getCoeffOfMonom(), mGroebner, result(), FreeAlgebra::subtractScalarMultipleOf(), and FreeAlgebra::swap().