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

◆ is_equal()

bool FreeAlgebra::is_equal ( const Poly & f,
const Poly & g ) const

Definition at line 288 of file FreeAlgebra.cpp.

289{
290 if (f.numTerms() != g.numTerms()) return false;
291 if (f.getMonomVector() != g.getMonomVector()) return false;
292 auto fCoeffIt = f.cbeginCoeff();
293 auto gCoeffIt = g.cbeginCoeff();
294 auto fEnd = f.cendCoeff();
295 for ( ; fCoeffIt != fEnd ; fCoeffIt++, gCoeffIt++)
296 {
297 bool cmp = coefficientRing()->is_equal(*fCoeffIt, *gCoeffIt);
298 if (!cmp) return false;
299 }
300 return true;
301}
const Ring * coefficientRing() const
virtual bool is_equal(const ring_elem f, const ring_elem g) const =0

References coefficientRing(), and Ring::is_equal().

Referenced by M2FreeAlgebra::is_equal(), is_homogeneous(), multi_degree(), TEST(), TEST(), and TEST().