public class Texpr1UnNode extends Texpr1Node implements java.lang.Cloneable, java.io.Serializable
Texpr1Node
level 1
expression trees.Modifier and Type | Field and Description |
---|---|
Texpr1Node |
arg
Argument.
|
int |
op
Operation (
OP_NEG , etc.). |
static int |
OP_CAST
Cast.
|
static int |
OP_NEG
Negation (no rounding).
|
static int |
OP_SQRT
Square root.
|
int |
rdir
Rounding direction (
Texpr1Node.RDIR_NEAREST , etc.). |
int |
rtype
Rounding type (
Texpr1Node.RTYPE_REAL , etc). |
RDIR_DOWN, RDIR_NEAREST, RDIR_RND, RDIR_UP, RDIR_ZERO, RTYPE_DOUBLE, RTYPE_EXTENDED, RTYPE_INT, RTYPE_QUAD, RTYPE_REAL, RTYPE_SINGLE
Constructor and Description |
---|
Texpr1UnNode(int o,
int rtyp,
int rdi,
Texpr1Node ar)
Creates a new unary operator node, with the specified operator,
rounding type, rounding direction, and argument.
|
Texpr1UnNode(int o,
Texpr1Node ar)
Creates a new unary operator node, with the specified operator,
and argument, and no rounding.
|
Modifier and Type | Method and Description |
---|---|
Texpr1Node |
deepCopy()
Deep copy.
|
boolean |
equals(java.lang.Object x)
Whether x is a Texpr1 tree and structurally equal to this.
|
protected void |
fillVars(java.util.HashSet<Var> set)
Used internally for getVars.
|
Texpr1Node |
getArgument() |
int |
getDepth()
Returns the depth of the expression tree.
|
int |
getOperation() |
int |
getPrecedence()
Precedence of the node, used when printing.
|
int |
getRoundingDirection() |
int |
getRoundingType() |
int |
getSize()
Returns the number of internal nodes in the tree.
|
int |
hashCode()
Recursive hashing.
|
boolean |
hasVar(Var var)
Whether the variable var occurs in the tree.
|
boolean |
isEqual(Texpr1Node t)
Structural (recursive) equality.
|
boolean |
isIntervalCst()
Whether the expression is constant.
|
boolean |
isIntervalLinear()
Whether the expression is linear with interval or scalar coefficients,
and there is no rounding.
|
boolean |
isIntervalPolyfrac()
Whether the expression is a polynomial fraction, with interval or
scalar coefficients, and there is no rounding.
|
boolean |
isIntervalPolynomial()
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 |
setArgument(Texpr1Node n) |
void |
setOperation(int o) |
void |
setRoundingDirection(int d) |
void |
setRoundingType(int t) |
Texpr1Node |
shallowCopy()
Shallow copy.
|
Texpr1Node |
substitute(Var var,
Texpr1Node t)
Substitutes all occurrences of the variable var with the tree t.
|
java.lang.String |
toString()
Converts the expression tree to a String.
|
Texpr0Node |
toTexpr0Node(Environment e)
Converts the level 1 tree to a level 0 tree in the given
environment.
|
clone, fromLinexpr1, getVars, hasVar, substitute, substituteCopy, substituteCopy
public int op
OP_NEG
, etc.).public int rtype
Texpr1Node.RTYPE_REAL
, etc).public int rdir
Texpr1Node.RDIR_NEAREST
, etc.).public Texpr1Node arg
public static final int OP_NEG
public static final int OP_CAST
public static final int OP_SQRT
public Texpr1UnNode(int o, int rtyp, int rdi, Texpr1Node ar)
The subtree argument is referenced, not copied.
public Texpr1UnNode(int o, Texpr1Node ar)
The subtree argument is referenced, not copied.
public Texpr1Node shallowCopy()
Texpr1Node
shallowCopy
in class Texpr1Node
public Texpr1Node deepCopy()
Texpr1Node
deepCopy
in class Texpr1Node
public Texpr0Node toTexpr0Node(Environment e)
Texpr1Node
toTexpr0Node
in class Texpr1Node
public java.lang.String toString()
Texpr1Node
toString
in class Texpr1Node
public int getOperation()
public void setOperation(int o)
public int getRoundingType()
public void setRoundingType(int t)
public int getRoundingDirection()
public void setRoundingDirection(int d)
public Texpr1Node getArgument()
public void setArgument(Texpr1Node n)
public int getDepth()
Texpr1Node
getDepth
in class Texpr1Node
public int getSize()
Texpr1Node
getSize
in class Texpr1Node
public boolean hasVar(Var var)
Texpr1Node
hasVar
in class Texpr1Node
protected void fillVars(java.util.HashSet<Var> set)
Texpr1Node
fillVars
in class Texpr1Node
public boolean isIntervalCst()
Texpr1Node
isIntervalCst
in class Texpr1Node
public boolean isIntervalLinear()
Texpr1Node
isIntervalLinear
in class Texpr1Node
public boolean isIntervalPolynomial()
Texpr1Node
isIntervalPolynomial
in class Texpr1Node
public boolean isIntervalPolyfrac()
Texpr1Node
isIntervalPolyfrac
in class Texpr1Node
public boolean isScalar()
Texpr1Node
isScalar
in class Texpr1Node
public Texpr1Node substitute(Var var, Texpr1Node t)
Texpr1Node
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.
substitute
in class Texpr1Node
public int hashCode()
Texpr1Node
hashCode
in class Texpr1Node
public boolean isEqual(Texpr1Node t)
Texpr1Node
isEqual
in class Texpr1Node
public int getPrecedence()
Texpr1Node
getPrecedence
in class Texpr1Node
public boolean equals(java.lang.Object x)
Texpr1Node
equals
in class Texpr1Node