Package edu.jas.poly

Class Monomial<C extends RingElem<C>>

  • All Implemented Interfaces:
    Element<Monomial<C>>, java.io.Serializable, java.lang.Comparable<Monomial<C>>

    public final class Monomial<C extends RingElem<C>>
    extends java.lang.Object
    implements Element<Monomial<C>>
    Monomial class. Represents pairs of exponent vectors and coefficients. Adaptor for Map.Entry.
    Author:
    Heinz Kredel
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      C c
      Coefficient of monomial.
      ExpVector e
      Exponent of monomial.
    • Constructor Summary

      Constructors 
      Constructor Description
      Monomial​(ExpVector e, C c)
      Constructor of monomial.
      Monomial​(java.util.Map.Entry<ExpVector,​C> me)
      Constructor of monomial.
    • Field Detail

      • e

        public final ExpVector e
        Exponent of monomial.
      • c

        public final C extends RingElem<C> c
        Coefficient of monomial.
    • Constructor Detail

      • Monomial

        public Monomial​(java.util.Map.Entry<ExpVector,​C> me)
        Constructor of monomial.
        Parameters:
        me - a MapEntry.
      • Monomial

        public Monomial​(ExpVector e,
                        C c)
        Constructor of monomial.
        Parameters:
        e - exponent.
        c - coefficient.
    • Method Detail

      • coefficient

        public C coefficient()
        Getter for coefficient.
        Returns:
        coefficient.
      • copy

        public Monomial<Ccopy()
        Clone this Element.
        Specified by:
        copy in interface Element<C extends RingElem<C>>
        Returns:
        Creates and returns a copy of this Element.
      • toString

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

        public boolean equals​(java.lang.Object B)
        Comparison with any other object.
        Specified by:
        equals in interface Element<C extends RingElem<C>>
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to b, else false.
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        hashCode.
        Specified by:
        hashCode in interface Element<C extends RingElem<C>>
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hashCode.
        See Also:
        Object.hashCode()
      • compareTo

        public int compareTo​(Monomial<C> S)
        Monomial comparison.
        Specified by:
        compareTo in interface java.lang.Comparable<C extends RingElem<C>>
        Specified by:
        compareTo in interface Element<C extends RingElem<C>>
        Parameters:
        S - Monomial.
        Returns:
        SIGN(this-S).