Package apron
Class Texpr0BinNode
java.lang.Object
apron.Texpr0Node
apron.Texpr0BinNode
- All Implemented Interfaces:
Serializable
,Cloneable
Class of binary operator nodes in
Texpr0Node
level 0
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 (Texpr0Node.RDIR_NEAREST
, etc.).int
Rounding type (Texpr0Node.RTYPE_REAL
, etc).Fields inherited from class apron.Texpr0Node
RDIR_DOWN, RDIR_NEAREST, RDIR_RND, RDIR_UP, RDIR_ZERO, RTYPE_DOUBLE, RTYPE_EXTENDED, RTYPE_INT, RTYPE_QUAD, RTYPE_REAL, RTYPE_SINGLE
-
Constructor Summary
ConstructorsConstructorDescriptionTexpr0BinNode
(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.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. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds some dimensions and shifts coefficients accordingly .deepCopy()
Deep copy.boolean
Whether x is a Texpr0 tree and structurally equal to this.protected void
fillDims
(boolean[] ar) Used internally by getDims.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.boolean
hasDim
(int var) Whether the dimension dim is present.int
hashCode()
Recursive hashing.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).int
maxDim()
Maximum occurring dimension + 1.static String
opName
(int op) Returns a String representation of an operator.static int
opPrecedence
(int op) Returns the precedence of an operator, used for printing.void
Permutes some dimensions in the expression.Removes some dimensions and shifts coefficients accordinglyvoid
void
setOperation
(int o) void
void
setRoundingDirection
(int d) void
setRoundingType
(int t) Shallow copy.substitute
(int dim, Texpr0Node t) Substitutes all occurrences of the dimension dim with the expression tree t.Converts the expression tree to a String.Converts the level 0 tree to a level 1 tree in environment e.Methods inherited from class apron.Texpr0Node
addDimensionsCopy, clone, fromLinexpr0, getDims, permuteDimensionsCopy, removeDimensionsCopy, substituteCopy, suffixRDir, suffixRType, toString, toString
-
Field Details
-
op
public int opOperation (OP_ADD
, etc.). -
rtype
public int rtypeRounding type (Texpr0Node.RTYPE_REAL
, etc). -
rdir
public int rdirRounding direction (Texpr0Node.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
-
Texpr0BinNode
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
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
Returns a String representation of an operator. -
opPrecedence
public static int opPrecedence(int op) Returns the precedence of an operator, used for printing. -
shallowCopy
Description copied from class:Texpr0Node
Shallow copy.- Specified by:
shallowCopy
in classTexpr0Node
-
deepCopy
Description copied from class:Texpr0Node
Deep copy.- Specified by:
deepCopy
in classTexpr0Node
-
toTexpr1Node
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 classTexpr0Node
-
toString
Description copied from class:Texpr0Node
Converts the expression tree to a String.Dimension i is denoted by names[i].
- Specified by:
toString
in classTexpr0Node
-
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:Texpr0Node
Returns the depth of the expression tree.- Specified by:
getDepth
in classTexpr0Node
-
getSize
public int getSize()Description copied from class:Texpr0Node
Returns the number of internal nodes in the tree.- Specified by:
getSize
in classTexpr0Node
-
maxDim
public int maxDim()Description copied from class:Texpr0Node
Maximum occurring dimension + 1.- Specified by:
maxDim
in classTexpr0Node
-
hasDim
public boolean hasDim(int var) Description copied from class:Texpr0Node
Whether the dimension dim is present.- Specified by:
hasDim
in classTexpr0Node
-
fillDims
protected void fillDims(boolean[] ar) Description copied from class:Texpr0Node
Used internally by getDims.- Specified by:
fillDims
in classTexpr0Node
-
isIntervalCst
public boolean isIntervalCst()Description copied from class:Texpr0Node
Whether the expression is constant.- Specified by:
isIntervalCst
in classTexpr0Node
-
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 classTexpr0Node
-
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 classTexpr0Node
-
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 classTexpr0Node
-
isScalar
public boolean isScalar()Description copied from class:Texpr0Node
Whether all coefficients are scalar (non interval).- Specified by:
isScalar
in classTexpr0Node
-
substitute
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 classTexpr0Node
-
addDimensions
Description copied from class:Texpr0Node
Adds some dimensions and shifts coefficients accordingly .- Specified by:
addDimensions
in classTexpr0Node
-
removeDimensions
Description copied from class:Texpr0Node
Removes some dimensions and shifts coefficients accordinglythis 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 classTexpr0Node
-
permuteDimensions
Description copied from class:Texpr0Node
Permutes some dimensions in the expression.- Specified by:
permuteDimensions
in classTexpr0Node
-
hashCode
public int hashCode()Description copied from class:Texpr0Node
Recursive hashing.- Specified by:
hashCode
in classTexpr0Node
-
isEqual
Description copied from class:Texpr0Node
Structural (recursive) equality.- Specified by:
isEqual
in classTexpr0Node
-
getPrecedence
public int getPrecedence()Description copied from class:Texpr0Node
Precedence of the node, used when printing.- Specified by:
getPrecedence
in classTexpr0Node
-
equals
Description copied from class:Texpr0Node
Whether x is a Texpr0 tree and structurally equal to this.- Specified by:
equals
in classTexpr0Node
-