Class ColorPolynomial<C extends RingElem<C>>

java.lang.Object
edu.jas.application.ColorPolynomial<C>
Type Parameters:
C - coefficient type
All Implemented Interfaces:
Serializable

public class ColorPolynomial<C extends RingElem<C>> extends Object implements Serializable
Colored Polynomials with green, red and white coefficients. Not implementing RingElem. Note: not general purpose, use only in comprehensive GB.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • toString

      public String toString()
      String representation of ColorPolynomial.
      Overrides:
      toString in class Object
      See Also:
    • toScript

      public String toScript()
      Script representation of ColorPolynomial.
      See Also:
    • isZERO

      public boolean isZERO()
      Is this polynomial ZERO.
      Returns:
      true, if there are only green terms, else false.
    • isONE

      public boolean isONE()
      Is this polynomial ONE.
      Returns:
      true, if the only non green term is 1, else false.
    • equals

      public boolean equals(Object p)
      Is this polynomial equal to other.
      Overrides:
      equals in class Object
      Parameters:
      p - other polynomial.
      Returns:
      true, if this is equal to other, else false.
    • hashCode

      public int hashCode()
      Hash code for this colored polynomial.
      Overrides:
      hashCode in class Object
      See Also:
    • isDetermined

      public boolean isDetermined()
      Is this polynomial determined.
      Returns:
      true, if there are nonzero red terms or if this == 0, else false.
    • checkInvariant

      public boolean checkInvariant()
      Check ordering invariants. TT(green) > LT(red) and TT(red) > LT(white).
      Returns:
      true, if all ordering invariants are met, else false.
    • getGreenCoefficients

      public List<GenPolynomial<C>> getGreenCoefficients()
      Get zero condition on coefficients.
      Returns:
      green coefficients.
    • getRedCoefficients

      public List<GenPolynomial<C>> getRedCoefficients()
      Get non zero condition on coefficients.
      Returns:
      red coefficients.
    • getPolynomial

      public GenPolynomial<GenPolynomial<C>> getPolynomial()
      Get full polynomial.
      Returns:
      sum of all parts.
    • getEssentialPolynomial

      public GenPolynomial<GenPolynomial<C>> getEssentialPolynomial()
      Get essential polynomial.
      Returns:
      sum of red and white parts.
    • length

      public int length()
      Length of red and white parts.
      Returns:
      length of essential parts.
    • leadingExpVector

      public ExpVector leadingExpVector()
      Get leading exponent vector.
      Returns:
      LT of red or white parts.
    • leadingMonomial

      public Map.Entry<ExpVector,GenPolynomial<C>> leadingMonomial()
      Get leading monomial.
      Returns:
      LM of red or white parts.
    • abs

      public ColorPolynomial<C> abs()
      ColorPolynomial absolute value.
      Returns:
      abs(this).
    • sum

      public ColorPolynomial<C> sum(ColorPolynomial<C> S)
      ColorPolynomial summation. Note: green coefficients stay green, all others become white.
      Parameters:
      S - ColorPolynomial.
      Returns:
      this+S.
    • sum

      public ColorPolynomial<C> sum(GenPolynomial<C> s, ExpVector e)
      ColorPolynomial summation.
      Parameters:
      s - GenPolynomial.
      e - exponent vector.
      Returns:
      this+(c e).
    • subtract

      public ColorPolynomial<C> subtract(ColorPolynomial<C> S)
      ColorPolynomial subtraction. Note: green coefficients stay green, all others become white.
      Parameters:
      S - ColorPolynomial.
      Returns:
      this-S.
    • subtract

      public ColorPolynomial<C> subtract(GenPolynomial<C> s, ExpVector e)
      ColorPolynomial subtract.
      Parameters:
      s - GenPolynomial.
      e - exponent vector.
      Returns:
      this-(c e).
    • multiply

      public ColorPolynomial<C> multiply(GenPolynomial<C> s, ExpVector e)
      ColorPolynomial multiplication by monomial.
      Parameters:
      s - Coefficient.
      e - Expvector.
      Returns:
      this * (c t).
    • multiply

      public ColorPolynomial<C> multiply(GenPolynomial<C> s)
      ColorPolynomial multiplication by coefficient.
      Parameters:
      s - Coefficient.
      Returns:
      this * (s).
    • divide

      public ColorPolynomial<C> divide(GenPolynomial<C> s)
      ColorPolynomial division by coefficient.
      Parameters:
      s - Coefficient.
      Returns:
      this / (s).