Class LinearTerm

  • All Implemented Interfaces:
    Term

    public class LinearTerm
    extends AbstractHierarchicalTerm
    The LinearTerm represents a linear constraint of the form:
    left-hand-side comparator right-hand-side.
    • Field Detail

      • coefficients

        protected final java.util.List<java.lang.Integer> coefficients
        The coefficients of the embedded terms.
      • rhs

        protected int rhs
        The right-hand-side of the LinearTerm.
    • Constructor Detail

      • LinearTerm

        public LinearTerm​(java.util.List<java.lang.Integer> coefficients,
                          java.util.List<Term> terms,
                          LinearTerm.Comparator comparator,
                          int rhs)
        Constructs a LinearTerm with a given list of coefficients, the embedded Terms, the LinearTerm.Comparator, and the right-hand-side.
        Parameters:
        coefficients - the coefficients of the terms
        terms - the terms
        comparator - the used comparator
        rhs - the right-hand-side
    • Method Detail

      • getCoefficients

        public java.util.List<java.lang.Integer> getCoefficients()
        Returns the coefficients of the Terms.
        Returns:
        the coefficients of the terms
      • getRHS

        public int getRHS()
        Returns the right-hand-side.
        Returns:
        the right-hand-side
      • add

        public void add​(int coefficient,
                        Term term)
        Adds a Term and its coefficient.
        Parameters:
        coefficient - the coefficient
        term - the term
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object