Package apron

Class Texpr0BinNode

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

public class Texpr0BinNode extends Texpr0Node implements Cloneable, Serializable
Class of binary operator nodes in Texpr0Node level 0 expression trees.
See Also:
  • Field Details

  • Constructor Details

    • Texpr0BinNode

      public Texpr0BinNode(int o, int rtyp, int rdi, Texpr0Node lAr, Texpr0Node rAr)
      Creates a new binary operator node, with the specified operator, rounding type, rounding direction, left and right arguments.

      The subtree arguments are referenced, not copied.

    • Texpr0BinNode

      public Texpr0BinNode(int o, Texpr0Node lAr, Texpr0Node rAr)
      Creates a new binary operator node, with the specified operator, and left and right arguments, and no rounding.

      The subtree arguments are referenced, not copied.

  • Method Details

    • opName

      public static String opName(int op)
      Returns a String representation of an operator.
    • opPrecedence

      public static int opPrecedence(int op)
      Returns the precedence of an operator, used for printing.
    • shallowCopy

      public Texpr0Node shallowCopy()
      Description copied from class: Texpr0Node
      Shallow copy.
      Specified by:
      shallowCopy in class Texpr0Node
    • deepCopy

      public Texpr0Node deepCopy()
      Description copied from class: Texpr0Node
      Deep copy.
      Specified by:
      deepCopy in class Texpr0Node
    • toTexpr1Node

      public Texpr1Node toTexpr1Node(Environment e)
      Description copied from class: Texpr0Node
      Converts the level 0 tree to a level 1 tree in environment e.

      All dimension leaves are replaced with variable leaves.

      Specified by:
      toTexpr1Node in class Texpr0Node
    • toString

      public String toString(Var[] names)
      Description copied from class: Texpr0Node
      Converts the expression tree to a String.

      Dimension i is denoted by names[i].

      Specified by:
      toString in class Texpr0Node
    • getOperation

      public int getOperation()
    • setOperation

      public void setOperation(int o)
    • getRoundingType

      public int getRoundingType()
    • setRoundingType

      public void setRoundingType(int t)
    • getRoundingDirection

      public int getRoundingDirection()
    • setRoundingDirection

      public void setRoundingDirection(int d)
    • getLeftArgument

      public Texpr0Node getLeftArgument()
    • setLeftArgument

      public void setLeftArgument(Texpr0Node n)
    • getRightArgument

      public Texpr0Node getRightArgument()
    • setRightArgument

      public void setRightArgument(Texpr0Node n)
    • getDepth

      public int getDepth()
      Description copied from class: Texpr0Node
      Returns the depth of the expression tree.
      Specified by:
      getDepth in class Texpr0Node
    • getSize

      public int getSize()
      Description copied from class: Texpr0Node
      Returns the number of internal nodes in the tree.
      Specified by:
      getSize in class Texpr0Node
    • maxDim

      public int maxDim()
      Description copied from class: Texpr0Node
      Maximum occurring dimension + 1.
      Specified by:
      maxDim in class Texpr0Node
    • hasDim

      public boolean hasDim(int var)
      Description copied from class: Texpr0Node
      Whether the dimension dim is present.
      Specified by:
      hasDim in class Texpr0Node
    • fillDims

      protected void fillDims(boolean[] ar)
      Description copied from class: Texpr0Node
      Used internally by getDims.
      Specified by:
      fillDims in class Texpr0Node
    • isIntervalCst

      public boolean isIntervalCst()
      Description copied from class: Texpr0Node
      Whether the expression is constant.
      Specified by:
      isIntervalCst in class Texpr0Node
    • isIntervalLinear

      public boolean isIntervalLinear()
      Description copied from class: Texpr0Node
      Whether the expression is linear with interval or scalar coefficients, and there is no rounding.
      Specified by:
      isIntervalLinear in class Texpr0Node
    • isIntervalPolynomial

      public boolean isIntervalPolynomial()
      Description copied from class: Texpr0Node
      Whether the expression is polynomial, with interval or scalar coefficients, and there is no rounding.
      Specified by:
      isIntervalPolynomial in class Texpr0Node
    • isIntervalPolyfrac

      public boolean isIntervalPolyfrac()
      Description copied from class: Texpr0Node
      Whether the expression is a polynomial fraction, with interval or scalar coefficients, and there is no rounding.
      Specified by:
      isIntervalPolyfrac in class Texpr0Node
    • isScalar

      public boolean isScalar()
      Description copied from class: Texpr0Node
      Whether all coefficients are scalar (non interval).
      Specified by:
      isScalar in class Texpr0Node
    • substitute

      public Texpr0Node substitute(int dim, Texpr0Node t)
      Description copied from class: Texpr0Node
      Substitutes all occurrences of the dimension dim with the expression tree t.

      this is modified in-place.

      As some nodes can change their kind (a node for a dimension dim becomes the root of the tree t), a new root node is returned.

      Specified by:
      substitute in class Texpr0Node
    • addDimensions

      public void addDimensions(Dimchange c)
      Description copied from class: Texpr0Node
      Adds some dimensions and shifts coefficients accordingly .
      Specified by:
      addDimensions in class Texpr0Node
    • removeDimensions

      public Texpr0Node removeDimensions(Dimchange c)
      Description copied from class: Texpr0Node
      Removes some dimensions and shifts coefficients accordingly

      this is modified in-place.

      As some nodes can change their kind (removed dimensions become [-oo,+oo] constants), a new root node is returned.

      Specified by:
      removeDimensions in class Texpr0Node
    • permuteDimensions

      public void permuteDimensions(Dimperm p)
      Description copied from class: Texpr0Node
      Permutes some dimensions in the expression.
      Specified by:
      permuteDimensions in class Texpr0Node
    • hashCode

      public int hashCode()
      Description copied from class: Texpr0Node
      Recursive hashing.
      Specified by:
      hashCode in class Texpr0Node
    • isEqual

      public boolean isEqual(Texpr0Node t)
      Description copied from class: Texpr0Node
      Structural (recursive) equality.
      Specified by:
      isEqual in class Texpr0Node
    • getPrecedence

      public int getPrecedence()
      Description copied from class: Texpr0Node
      Precedence of the node, used when printing.
      Specified by:
      getPrecedence in class Texpr0Node
    • equals

      public boolean equals(Object x)
      Description copied from class: Texpr0Node
      Whether x is a Texpr0 tree and structurally equal to this.
      Specified by:
      equals in class Texpr0Node