Class ColorPolynomial<C extends RingElem<C>>

  • Type Parameters:
    C - coefficient type
    All Implemented Interfaces:
    java.io.Serializable

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

      • toString

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

        public java.lang.String toScript()
        Script representation of ColorPolynomial.
        See Also:
        Element.toScript()
      • 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​(java.lang.Object p)
        Is this polynomial equal to other.
        Overrides:
        equals in class java.lang.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 java.lang.Object
        See Also:
        Object.hashCode()
      • 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 java.util.List<GenPolynomial<C>> getGreenCoefficients()
        Get zero condition on coefficients.
        Returns:
        green coefficients.
      • getRedCoefficients

        public java.util.List<GenPolynomial<C>> getRedCoefficients()
        Get non zero condition on coefficients.
        Returns:
        red coefficients.
      • 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 java.util.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.
      • 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.
      • 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).