public class Texpr0CstNode extends Texpr0Node implements java.lang.Cloneable, java.io.Serializable
Texpr0Node
level 0
expression trees.
A constant value is represented by a Coeff
object.
Modifier and Type | Field and Description |
---|---|
Coeff |
cst
Constant value.
|
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 |
---|
Texpr0CstNode()
Create a zero constant node (DoubleScalar).
|
Texpr0CstNode(Coeff c)
Creates a new constant node.
|
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.
|
Coeff |
getConstant() |
int |
getDepth()
Returns the depth of the expression tree.
|
int |
getPrecedence()
Precedence of the node, used when printing.
|
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.
|
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 |
setConstant(Coeff c) |
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 Coeff cst
public Texpr0CstNode(Coeff c)
The coefficient is referenced, not copied.
public Texpr0CstNode()
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 Coeff getConstant()
public void setConstant(Coeff c)
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