Package apron
Class Texpr0UnNode
java.lang.Object
apron.Texpr0Node
apron.Texpr0UnNode
- All Implemented Interfaces:
Serializable,Cloneable
Class of unary operator nodes in
Texpr0Node level 0
expression trees.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionArgument.intOperation (OP_NEG, etc.).static final intCast.static final intNegation (no rounding).static final intSquare root.intRounding direction (Texpr0Node.RDIR_NEAREST, etc.).intRounding 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
ConstructorsConstructorDescriptionTexpr0UnNode(int o, int rtyp, int rdi, Texpr0Node ar) Creates a new unary operator node, with the specified operator, rounding type, rounding direction, and argument.Texpr0UnNode(int o, Texpr0Node ar) Creates a new unary operator node, with the specified operator, and argument, and no rounding. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds some dimensions and shifts coefficients accordingly .deepCopy()Deep copy.booleanWhether x is a Texpr0 tree and structurally equal to this.protected voidfillDims(boolean[] ar) Used internally by getDims.intgetDepth()Returns the depth of the expression tree.intintPrecedence of the node, used when printing.intintintgetSize()Returns the number of internal nodes in the tree.booleanhasDim(int var) Whether the dimension dim is present.inthashCode()Recursive hashing.booleanStructural (recursive) equality.booleanWhether the expression is constant.booleanWhether the expression is linear with interval or scalar coefficients, and there is no rounding.booleanWhether the expression is a polynomial fraction, with interval or scalar coefficients, and there is no rounding.booleanWhether the expression is polynomial, with interval or scalar coefficients, and there is no rounding.booleanisScalar()Whether all coefficients are scalar (non interval).intmaxDim()Maximum occurring dimension + 1.static StringopName(int op) Returns a String representation of an operator.static intopPrecedence(int op) Returns the precedence of an operator, used for printing.voidPermutes some dimensions in the expression.Removes some dimensions and shifts coefficients accordinglyvoidvoidsetOperation(int o) voidsetRoundingDirection(int d) voidsetRoundingType(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_NEG, etc.). -
rtype
public int rtypeRounding type (Texpr0Node.RTYPE_REAL, etc). -
rdir
public int rdirRounding direction (Texpr0Node.RDIR_NEAREST, etc.). -
arg
Argument. -
OP_NEG
public static final int OP_NEGNegation (no rounding).- See Also:
-
OP_CAST
public static final int OP_CASTCast.- See Also:
-
OP_SQRT
public static final int OP_SQRTSquare root.- See Also:
-
-
Constructor Details
-
Texpr0UnNode
Creates a new unary operator node, with the specified operator, rounding type, rounding direction, and argument.The subtree argument is referenced, not copied.
-
Texpr0UnNode
Creates a new unary operator node, with the specified operator, and argument, and no rounding.The subtree argument is 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:Texpr0NodeShallow copy.- Specified by:
shallowCopyin classTexpr0Node
-
deepCopy
Description copied from class:Texpr0NodeDeep copy.- Specified by:
deepCopyin classTexpr0Node
-
toTexpr1Node
Description copied from class:Texpr0NodeConverts the level 0 tree to a level 1 tree in environment e.All dimension leaves are replaced with variable leaves.
- Specified by:
toTexpr1Nodein classTexpr0Node
-
toString
Description copied from class:Texpr0NodeConverts the expression tree to a String.Dimension i is denoted by names[i].
- Specified by:
toStringin 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) -
getArgument
-
setArgument
-
getDepth
public int getDepth()Description copied from class:Texpr0NodeReturns the depth of the expression tree.- Specified by:
getDepthin classTexpr0Node
-
getSize
public int getSize()Description copied from class:Texpr0NodeReturns the number of internal nodes in the tree.- Specified by:
getSizein classTexpr0Node
-
maxDim
public int maxDim()Description copied from class:Texpr0NodeMaximum occurring dimension + 1.- Specified by:
maxDimin classTexpr0Node
-
hasDim
public boolean hasDim(int var) Description copied from class:Texpr0NodeWhether the dimension dim is present.- Specified by:
hasDimin classTexpr0Node
-
fillDims
protected void fillDims(boolean[] ar) Description copied from class:Texpr0NodeUsed internally by getDims.- Specified by:
fillDimsin classTexpr0Node
-
isIntervalCst
public boolean isIntervalCst()Description copied from class:Texpr0NodeWhether the expression is constant.- Specified by:
isIntervalCstin classTexpr0Node
-
isIntervalLinear
public boolean isIntervalLinear()Description copied from class:Texpr0NodeWhether the expression is linear with interval or scalar coefficients, and there is no rounding.- Specified by:
isIntervalLinearin classTexpr0Node
-
isIntervalPolynomial
public boolean isIntervalPolynomial()Description copied from class:Texpr0NodeWhether the expression is polynomial, with interval or scalar coefficients, and there is no rounding.- Specified by:
isIntervalPolynomialin classTexpr0Node
-
isIntervalPolyfrac
public boolean isIntervalPolyfrac()Description copied from class:Texpr0NodeWhether the expression is a polynomial fraction, with interval or scalar coefficients, and there is no rounding.- Specified by:
isIntervalPolyfracin classTexpr0Node
-
isScalar
public boolean isScalar()Description copied from class:Texpr0NodeWhether all coefficients are scalar (non interval).- Specified by:
isScalarin classTexpr0Node
-
substitute
Description copied from class:Texpr0NodeSubstitutes 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:
substitutein classTexpr0Node
-
addDimensions
Description copied from class:Texpr0NodeAdds some dimensions and shifts coefficients accordingly .- Specified by:
addDimensionsin classTexpr0Node
-
removeDimensions
Description copied from class:Texpr0NodeRemoves 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:
removeDimensionsin classTexpr0Node
-
permuteDimensions
Description copied from class:Texpr0NodePermutes some dimensions in the expression.- Specified by:
permuteDimensionsin classTexpr0Node
-
hashCode
public int hashCode()Description copied from class:Texpr0NodeRecursive hashing.- Specified by:
hashCodein classTexpr0Node
-
isEqual
Description copied from class:Texpr0NodeStructural (recursive) equality.- Specified by:
isEqualin classTexpr0Node
-
getPrecedence
public int getPrecedence()Description copied from class:Texpr0NodePrecedence of the node, used when printing.- Specified by:
getPrecedencein classTexpr0Node
-
equals
Description copied from class:Texpr0NodeWhether x is a Texpr0 tree and structurally equal to this.- Specified by:
equalsin classTexpr0Node
-