int polyjam::core::Monomial::grevlexComparison( const Monomial & operant ) const { if( isIncompatible(operant) ) return 0; unsigned int thisDegree = degree(); unsigned int thatDegree = operant.degree(); if( thisDegree == thatDegree ) return revlexComparison(operant); else { if( thisDegree > thatDegree ) return 1; else return -1; } return 0; }
Polynomial::Polynomial(Monomial m) { mMonomials.resize(m.degree() + 1, Monomial("0", 0)); mMonomials[m.degree()] = m; }
Monomial::Monomial(const Monomial& rhs) { mCoeffR = rhs.coefficientReal(); mCoeffI = rhs.coefficientImag(); mDegree = rhs.degree(); }