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

◆ createOverlapPoly() [1/2]

auto NCGroebner::createOverlapPoly ( const FreeAlgebra & A,
const PolyList & polyList,
int polyIndex1,
int polyIndex2,
int overlapIndex )->Poly *
static

Definition at line 351 of file NCGroebner.cpp.

356{
357 // here, polyIndex1 and 2 are indices into polyList, and overlapIndex
358 // is the index where the overlap starts in the polynomial pointed in
359 // by *polyIndex1*.
360 Poly* result = new Poly;
361 Poly tmp1, tmp2;
362 Word prefix, suffix;
363 prefix = A.lead_word_prefix(*polyList[polyIndex1], overlapIndex);
364 suffix = A.lead_word_suffix(*polyList[polyIndex2], *(polyList[polyIndex1]->cbegin().monom().begin()) - A.monoid().numWeights() - 1 - overlapIndex);
365 A.mult_by_term_right(tmp1, *polyList[polyIndex1], A.coefficientRing()->from_long(1), suffix);
366 A.mult_by_term_left(tmp2, *polyList[polyIndex2], A.coefficientRing()->from_long(1), prefix);
367 A.subtract(*result, tmp1, tmp2);
368 return result;
369}
Polynomial< CoefficientRingType > Poly
Word prefix(const Word vec, int lengthOfPrefix)
Word suffix(const Word vec, int indexOfSuffix)
const Ring * coefficientRing() const
void subtract(Poly &result, const Poly &f, const Poly &g) const
void mult_by_term_right(Poly &result, const Poly &f, const ring_elem c, const Monom m) const
void mult_by_term_left(Poly &result, const Poly &f, const ring_elem c, const Monom m) const
Word lead_word_prefix(const Poly &f, int endIndex) const
const FreeMonoid & monoid() const
Word lead_word_suffix(const Poly &f, int beginIndex) const
unsigned int numWeights() const
virtual ring_elem from_long(long n) const =0
VALGRIND_MAKE_MEM_DEFINED & result(result)
TermIterator< Nterm > begin(Nterm *ptr)
Definition ringelem.cpp:4

References begin(), prefix(), result(), and suffix().

Referenced by computeHomogeneous(), computeInhomogeneous(), createOverlapPoly(), and TEST().