public class Texpr0BinNode extends Texpr0Node implements java.lang.Cloneable, java.io.Serializable
Texpr0Node
level 0
expression trees.Modifier and Type | Field and Description |
---|---|
Texpr0Node |
lArg
Left argument.
|
int |
op
Operation (
OP_ADD , etc.). |
static int |
OP_ADD
Addition.
|
static int |
OP_DIV
Division.
|
static int |
OP_MOD
Modulo (for integers or reals).
|
static int |
OP_MUL
Multiplication.
|
static int |
OP_POW
Power.
|
static int |
OP_SUB
Subtraction.
|
Texpr0Node |
rArg
Right argument.
|
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 |
---|
Texpr0BinNode(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.
|
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.
|
int |
getDepth()
Returns the depth of the expression tree.
|
Texpr0Node |
getLeftArgument() |
int |
getOperation() |
int |
getPrecedence()
Precedence of the node, used when printing.
|
Texpr0Node |
getRightArgument() |
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 |
setLeftArgument(Texpr0Node n) |
void |
setOperation(int o) |
void |
setRightArgument(Texpr0Node n) |
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_ADD
, etc.).public int rtype
Texpr0Node.RTYPE_REAL
, etc).public int rdir
Texpr0Node.RDIR_NEAREST
, etc.).public Texpr0Node lArg
public Texpr0Node rArg
public static final int OP_ADD
public static final int OP_SUB
public static final int OP_MUL
public static final int OP_DIV
public static final int OP_MOD
public static final int OP_POW
public Texpr0BinNode(int o, int rtyp, int rdi, Texpr0Node lAr, Texpr0Node rAr)
The subtree arguments are referenced, not copied.
public Texpr0BinNode(int o, Texpr0Node lAr, Texpr0Node rAr)
The subtree arguments are 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 getLeftArgument()
public void setLeftArgument(Texpr0Node n)
public Texpr0Node getRightArgument()
public void setRightArgument(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