Package apron

Class Linterm0

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

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

A Linterm0 is a pair composed of a Coeff coefficient and a variable denoted by dimension (i.e., integer starting from 0). It represents a single term in a Linexpr0 or Lincons0.

See Also:
  • Field Details

    • dim

      public int dim
      Dimension index (positive).
    • coeff

      public Coeff coeff
      Variable coefficient.
  • Constructor Details

    • Linterm0

      public Linterm0(int d, Coeff c)
      Creates a new linear term.

      The coefficient is referenced, not copied.

    • Linterm0

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

      The coefficient is copied.

  • Method Details

    • toString

      public String toString(Var[] names)
      Returns a String representation of the linear term.

      Dimension i is denoted by names[i].

    • toString

      public String toString(String[] names)
    • toString

      public String toString()
      Returns a String representation of the linear term.

      Dimension i is denoted as xi.

      Overrides:
      toString in class Object
    • clone

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

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

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

      public int getDimension()
    • getCoefficient

      public Coeff getCoefficient()
    • setDimension

      public void setDimension(int d)
    • setCoeffcient

      public void setCoeffcient(Coeff c)