public class Texpr0UnNode extends Texpr0Node implements java.lang.Cloneable, java.io.Serializable
Texpr0Node
level 0
expression trees.Modifier and Type | Field and Description |
---|---|
Texpr0Node |
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 (
Texpr0Node.RDIR_NEAREST , etc.). |
int |
rtype
Rounding type (
Texpr0Node.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 |
---|
Texpr0UnNode(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.
|
Modifier and Type | Method and Description |
---|---|
void |
addDimensions(Dimchange c)
Adds some dimensions and shifts coefficients accordingly .
|
Texpr0Node |
deepCopy()
Deep copy.
|
boolean |
equals(java.lang.Object x)
Whether x is a Texpr0 tree and structurally equal to this.
|
protected void |
fillDims(boolean[] ar)
Used internally by getDims.
|
Texpr0Node |
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.
|
boolean |
hasDim(int var)
Whether the dimension dim is present.
|
int |
hashCode()
Recursive hashing.
|
boolean |
isEqual(Texpr0Node 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).
|
int |
maxDim()
Maximum occurring dimension + 1.
|
static java.lang.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 |
permuteDimensions(Dimperm p)
Permutes some dimensions in the expression.
|
Texpr0Node |
removeDimensions(Dimchange c)
Removes some dimensions and shifts coefficients accordingly
this is modified in-place.
|
void |
setArgument(Texpr0Node n) |
void |
setOperation(int o) |
void |
setRoundingDirection(int d) |
void |
setRoundingType(int t) |
Texpr0Node |
shallowCopy()
Shallow copy.
|
Texpr0Node |
substitute(int dim,
Texpr0Node t)
Substitutes all occurrences of the dimension dim with
the expression tree t.
|
java.lang.String |
toString(Var[] names)
Converts the expression tree to a String.
|
Texpr1Node |
toTexpr1Node(Environment e)
Converts the level 0 tree to a level 1 tree in
environment e.
|
addDimensionsCopy, clone, fromLinexpr0, getDims, permuteDimensionsCopy, removeDimensionsCopy, substituteCopy, suffixRDir, suffixRType, toString, toString
public int op
OP_NEG
, etc.).public int rtype
Texpr0Node.RTYPE_REAL
, etc).public int rdir
Texpr0Node.RDIR_NEAREST
, etc.).public Texpr0Node arg
public static final int OP_NEG
public static final int OP_CAST
public static final int OP_SQRT
public Texpr0UnNode(int o, int rtyp, int rdi, Texpr0Node ar)
The subtree argument is referenced, not copied.
public Texpr0UnNode(int o, Texpr0Node ar)
The subtree argument is referenced, not copied.
public static java.lang.String opName(int op)
public static int opPrecedence(int op)
public Texpr0Node shallowCopy()
Texpr0Node
shallowCopy
in class Texpr0Node
public Texpr0Node deepCopy()
Texpr0Node
deepCopy
in class Texpr0Node
public Texpr1Node toTexpr1Node(Environment e)
Texpr0Node
All dimension leaves are replaced with variable leaves.
toTexpr1Node
in class Texpr0Node
public java.lang.String toString(Var[] names)
Texpr0Node
Dimension i is denoted by names[i].
toString
in class Texpr0Node
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 Texpr0Node getArgument()
public void setArgument(Texpr0Node n)
public int getDepth()
Texpr0Node
getDepth
in class Texpr0Node
public int getSize()
Texpr0Node
getSize
in class Texpr0Node
public int maxDim()
Texpr0Node
maxDim
in class Texpr0Node
public boolean hasDim(int var)
Texpr0Node
hasDim
in class Texpr0Node
protected void fillDims(boolean[] ar)
Texpr0Node
fillDims
in class Texpr0Node
public boolean isIntervalCst()
Texpr0Node
isIntervalCst
in class Texpr0Node
public boolean isIntervalLinear()
Texpr0Node
isIntervalLinear
in class Texpr0Node
public boolean isIntervalPolynomial()
Texpr0Node
isIntervalPolynomial
in class Texpr0Node
public boolean isIntervalPolyfrac()
Texpr0Node
isIntervalPolyfrac
in class Texpr0Node
public boolean isScalar()
Texpr0Node
isScalar
in class Texpr0Node
public Texpr0Node substitute(int dim, Texpr0Node t)
Texpr0Node
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.
substitute
in class Texpr0Node
public void addDimensions(Dimchange c)
Texpr0Node
addDimensions
in class Texpr0Node
public Texpr0Node removeDimensions(Dimchange c)
Texpr0Node
this is modified in-place.
As some nodes can change their kind (removed dimensions become [-oo,+oo] constants), a new root node is returned.
removeDimensions
in class Texpr0Node
public void permuteDimensions(Dimperm p)
Texpr0Node
permuteDimensions
in class Texpr0Node
public int hashCode()
Texpr0Node
hashCode
in class Texpr0Node
public boolean isEqual(Texpr0Node t)
Texpr0Node
isEqual
in class Texpr0Node
public int getPrecedence()
Texpr0Node
getPrecedence
in class Texpr0Node
public boolean equals(java.lang.Object x)
Texpr0Node
equals
in class Texpr0Node