Пример #1
0
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;
}
Пример #2
0
Polynomial::Polynomial(Monomial m)
{
  mMonomials.resize(m.degree() + 1, Monomial("0", 0));
  mMonomials[m.degree()] = m;
}
Пример #3
0
Monomial::Monomial(const Monomial& rhs)
{
  mCoeffR = rhs.coefficientReal();
  mCoeffI = rhs.coefficientImag();
  mDegree = rhs.degree();
}