Package apron

Class Linterm1

java.lang.Object
apron.Linterm1
All Implemented Interfaces:
Serializable, Cloneable

public class Linterm1 extends Object implements Cloneable, Serializable
Class of terms in level 1 linear expressions and constraints.

A Linterm1 is a pair composed of a Coeff coefficient and a variable denoted by name. It represents a single term in a Linexpr1 or Lincons1.

See Also:
  • Field Details

    • var

      public Var var
      Variable name.
    • coeff

      public Coeff coeff
      Variable coefficient.
  • Constructor Details

    • Linterm1

      public Linterm1(String v, Coeff c)
    • Linterm1

      public Linterm1(Var v, Coeff c)
      Creates a new linear term.

      The coefficient is referenced, not copied.

    • Linterm1

      public Linterm1(Linterm1 t)
      Creates a copy of the linear term.

      The coefficient is copied.

  • Method Details

    • toString

      public String toString()
      Returns a String representation of the linear term.
      Overrides:
      toString in class Object
    • clone

      public Linterm1 clone()
      Returns a copy of this.
      Overrides:
      clone in class Object
    • isEqual

      public boolean isEqual(Linterm1 x)
      Whether x and this are structurally equal.
    • equals

      public boolean equals(Object x)
      Whether x is a Linterm1 and structurally equal to this.
      Overrides:
      equals in class Object
    • getVariable

      public Var getVariable()
    • getCoefficient

      public Coeff getCoefficient()
    • setVariable

      public void setVariable(String s)
    • setVariable

      public void setVariable(Var s)
    • setCoeffcient

      public void setCoeffcient(Coeff c)