Package apron
Class Texpr1BinNode
java.lang.Object
apron.Texpr1Node
apron.Texpr1BinNode
- All Implemented Interfaces:
Serializable
,Cloneable
Class of binary operator nodes in
Texpr1Node
level 1
expression trees.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionLeft argument.int
Operation (OP_ADD
, etc.).static final int
Addition.static final int
Division.static final int
Modulo (for integers or reals).static final int
Multiplication.static final int
Power.static final int
Subtraction.Right argument.int
Rounding direction (Texpr1Node.RDIR_NEAREST
, etc.).int
Rounding type (Texpr1Node.RTYPE_REAL
, etc).Fields inherited from class apron.Texpr1Node
RDIR_DOWN, RDIR_NEAREST, RDIR_RND, RDIR_UP, RDIR_ZERO, RTYPE_DOUBLE, RTYPE_EXTENDED, RTYPE_INT, RTYPE_QUAD, RTYPE_REAL, RTYPE_SINGLE
-
Constructor Summary
ConstructorsConstructorDescriptionTexpr1BinNode
(int o, int rtyp, int rdi, Texpr1Node lAr, Texpr1Node rAr) Creates a new binary operator node, with the specified operator, rounding type, rounding direction, left and right arguments.Texpr1BinNode
(int o, Texpr1Node lAr, Texpr1Node rAr) Creates a new binary operator node, with the specified operator, and left and right arguments, and no rounding. -
Method Summary
Modifier and TypeMethodDescriptiondeepCopy()
Deep copy.boolean
Whether x is a Texpr1 tree and structurally equal to this.protected void
Used internally for getVars.int
getDepth()
Returns the depth of the expression tree.int
int
Precedence of the node, used when printing.int
int
int
getSize()
Returns the number of internal nodes in the tree.int
hashCode()
Recursive hashing.boolean
Whether the variable var occurs in the tree.boolean
Structural (recursive) equality.boolean
Whether the expression is constant.boolean
Whether the expression is linear with interval or scalar coefficients, and there is no rounding.boolean
Whether the expression is a polynomial fraction, with interval or scalar coefficients, and there is no rounding.boolean
Whether the expression is polynomial, with interval or scalar coefficients, and there is no rounding.boolean
isScalar()
Whether all coefficients are scalar (non interval).void
void
setOperation
(int o) void
void
setRoundingDirection
(int d) void
setRoundingType
(int t) Shallow copy.substitute
(Var var, Texpr1Node t) Substitutes all occurrences of the variable var with the tree t.toString()
Converts the expression tree to a String.Converts the level 1 tree to a level 0 tree in the given environment.Methods inherited from class apron.Texpr1Node
clone, fromLinexpr1, getVars, hasVar, substitute, substituteCopy, substituteCopy
-
Field Details
-
op
public int opOperation (OP_ADD
, etc.). -
rtype
public int rtypeRounding type (Texpr1Node.RTYPE_REAL
, etc). -
rdir
public int rdirRounding direction (Texpr1Node.RDIR_NEAREST
, etc.). -
lArg
Left argument. -
rArg
Right argument. -
OP_ADD
public static final int OP_ADDAddition.- See Also:
-
OP_SUB
public static final int OP_SUBSubtraction.- See Also:
-
OP_MUL
public static final int OP_MULMultiplication.- See Also:
-
OP_DIV
public static final int OP_DIVDivision.- See Also:
-
OP_MOD
public static final int OP_MODModulo (for integers or reals).- See Also:
-
OP_POW
public static final int OP_POWPower.- See Also:
-
-
Constructor Details
-
Texpr1BinNode
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.
-
Texpr1BinNode
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
-
shallowCopy
Description copied from class:Texpr1Node
Shallow copy.- Specified by:
shallowCopy
in classTexpr1Node
-
deepCopy
Description copied from class:Texpr1Node
Deep copy.- Specified by:
deepCopy
in classTexpr1Node
-
toTexpr0Node
Description copied from class:Texpr1Node
Converts the level 1 tree to a level 0 tree in the given environment.- Specified by:
toTexpr0Node
in classTexpr1Node
-
toString
Description copied from class:Texpr1Node
Converts the expression tree to a String.- Specified by:
toString
in classTexpr1Node
-
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
-
setLeftArgument
-
getRightArgument
-
setRightArgument
-
getDepth
public int getDepth()Description copied from class:Texpr1Node
Returns the depth of the expression tree.- Specified by:
getDepth
in classTexpr1Node
-
getSize
public int getSize()Description copied from class:Texpr1Node
Returns the number of internal nodes in the tree.- Specified by:
getSize
in classTexpr1Node
-
hasVar
Description copied from class:Texpr1Node
Whether the variable var occurs in the tree.- Specified by:
hasVar
in classTexpr1Node
-
fillVars
Description copied from class:Texpr1Node
Used internally for getVars.- Specified by:
fillVars
in classTexpr1Node
-
isIntervalCst
public boolean isIntervalCst()Description copied from class:Texpr1Node
Whether the expression is constant.- Specified by:
isIntervalCst
in classTexpr1Node
-
isIntervalLinear
public boolean isIntervalLinear()Description copied from class:Texpr1Node
Whether the expression is linear with interval or scalar coefficients, and there is no rounding.- Specified by:
isIntervalLinear
in classTexpr1Node
-
isIntervalPolynomial
public boolean isIntervalPolynomial()Description copied from class:Texpr1Node
Whether the expression is polynomial, with interval or scalar coefficients, and there is no rounding.- Specified by:
isIntervalPolynomial
in classTexpr1Node
-
isIntervalPolyfrac
public boolean isIntervalPolyfrac()Description copied from class:Texpr1Node
Whether the expression is a polynomial fraction, with interval or scalar coefficients, and there is no rounding.- Specified by:
isIntervalPolyfrac
in classTexpr1Node
-
isScalar
public boolean isScalar()Description copied from class:Texpr1Node
Whether all coefficients are scalar (non interval).- Specified by:
isScalar
in classTexpr1Node
-
substitute
Description copied from class:Texpr1Node
Substitutes all occurrences of the variable var with the tree t.this is modified in-place.
As some nodes can change their kind (a node for a variable var becomes the root of the tree t), a new root node is returned.
- Specified by:
substitute
in classTexpr1Node
-
hashCode
public int hashCode()Description copied from class:Texpr1Node
Recursive hashing.- Specified by:
hashCode
in classTexpr1Node
-
isEqual
Description copied from class:Texpr1Node
Structural (recursive) equality.- Specified by:
isEqual
in classTexpr1Node
-
getPrecedence
public int getPrecedence()Description copied from class:Texpr1Node
Precedence of the node, used when printing.- Specified by:
getPrecedence
in classTexpr1Node
-
equals
Description copied from class:Texpr1Node
Whether x is a Texpr1 tree and structurally equal to this.- Specified by:
equals
in classTexpr1Node
-