public class Tcons0
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
A Tcons0 represents a constraint over variables denoted
by dimension (i.e., integer starting from 0).
It has a left member (which is a Texpr0Intern
level 0
opaque expression), a constraint operator (=, >=, >, <>, or = modulo),
a right member which is always 0, and an optional constant modulo
factor (for = modulo constraints only).
Modifier and Type | Field and Description |
---|---|
static int |
DISEQ
Disquality constraint: expr <> 0.
|
static int |
EQ
Equality constraint: expr = 0.
|
static int |
EQMOD
Congruence equality constraint modulo a constant:
expr = 0 mod scalar.
|
Texpr0Intern |
expr
Left member of the constraint.
|
int |
kind
|
Scalar |
scalar
Optional modulo factor.
|
static int |
SUP
Strict inequality constraint: expr > 0.
|
static int |
SUPEQ
Inequality constraint: expr >= 0.
|
Constructor and Description |
---|
Tcons0(int k,
Texpr0Intern e)
Constructs a constraint with given kind and e as left member.
|
Tcons0(int k,
Texpr0Intern e,
Scalar s)
Constructs a constraint with given kind, e as left member, and
s as modulo factor.
|
Tcons0(int k,
Texpr0Node e)
Constructs a constraint with given kind and e as left member.
|
Tcons0(int k,
Texpr0Node e,
Scalar s)
Constructs a constraint with given kind, e as left member, and
s as modulo factor.
|
Tcons0(Lincons0 c)
Converts a linear constraint to a comb-line tree expression constraint.
|
Tcons0(Tcons0 c)
Constructs a copy of c.
|
Modifier and Type | Method and Description |
---|---|
void |
addDimensions(Dimchange c)
Adds some dimensions and shifts coefficients accordingly .
|
Tcons0 |
addDimensionsCopy(Dimchange c)
Returns a copy of the constraint with some dimensions added.
|
Tcons0 |
clone()
Returns a copy of this.
|
boolean |
equals(java.lang.Object x)
Whether x is a Tcons0 tree and structurally equal to this.
|
int |
getDepth()
Returns the depth of the expression tree.
|
int[] |
getDims()
Returns an ordered list of all occurring dimensions.
|
Texpr0Intern |
getExpression()
Returns the left expression.
|
int |
getKind()
Returns the constraint kind.
|
Scalar |
getScalar()
Returns the optional modulo factor (may be null).
|
int |
getSize()
Returns the number of internal nodes in the tree.
|
boolean |
hasDim(int dim)
Whether the dimension dim is present.
|
int |
hashCode()
Returns a hash of the constraint.
|
boolean |
isEqual(Tcons0 x)
Whether x and this are structurally equal.
|
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 constraint.
|
Tcons0 |
permuteDimensionsCopy(Dimperm p)
Returns a copy of the constraint with some dimensions permuted.
|
void |
removeDimensions(Dimchange c)
Removes some dimensions and shifts coefficients accordingly .
|
Tcons0 |
removeDimensionsCopy(Dimchange c)
Returns a copy of the constraint with some dimensions removed.
|
void |
setExpression(Texpr0Intern e)
Sets the left expression.
|
void |
setKind(int k)
Sets the constraint kind.
|
void |
setScalar(Scalar s)
Sets the optional modulo factor (may be null).
|
void |
substitute(int dim,
Texpr0Intern t)
Substitutes all occurrences of the dimension dim with
the tree t.
|
Tcons0 |
substituteCopy(int dim,
Texpr0Intern t)
Returns a copy of this where all occurrences of the dimension dim
are substituted with the expression tree t.
|
java.lang.String |
toString()
Returns a string representation of the constraint.
|
java.lang.String |
toString(java.lang.String[] names) |
java.lang.String |
toString(Var[] names)
Returns a string representation of the constraint.
|
Texpr0Node |
toTexpr0Node()
Converts the expression tree to a concrete Java tree.
|
public Texpr0Intern expr
public int kind
public static final int EQ
public static final int SUPEQ
public static final int SUP
public static final int EQMOD
public static final int DISEQ
public Tcons0(int k, Texpr0Intern e)
e is referenced, not copied.
public Tcons0(int k, Texpr0Intern e, Scalar s)
e and s are referenced, not copied.
public Tcons0(int k, Texpr0Node e)
e is converted to an opaque Texpr0Intern
Apron expression tree.
public Tcons0(int k, Texpr0Node e, Scalar s)
e is converted to an opaque Texpr0Intern
Apron expression tree.
public Tcons0(Tcons0 c)
The left member expression and the optional scalar are copied.
public Tcons0(Lincons0 c)
public java.lang.String toString()
Dimension i is denoted as xi.
toString
in class java.lang.Object
public java.lang.String toString(Var[] names)
Dimension i is denoted by names[i].
public java.lang.String toString(java.lang.String[] names)
public int hashCode()
hashCode
in class java.lang.Object
public void substitute(int dim, Texpr0Intern t)
public Tcons0 substituteCopy(int dim, Texpr0Intern t)
public void addDimensions(Dimchange c)
public void removeDimensions(Dimchange c)
public void permuteDimensions(Dimperm p)
public Tcons0 addDimensionsCopy(Dimchange c)
this is not changed.
public Tcons0 removeDimensionsCopy(Dimchange c)
this is not changed.
public Tcons0 permuteDimensionsCopy(Dimperm p)
this is not changed.
public boolean isIntervalCst()
public boolean isIntervalLinear()
public boolean isIntervalPolynomial()
public boolean isIntervalPolyfrac()
public boolean isScalar()
public Texpr0Node toTexpr0Node()
public int getDepth()
public int getSize()
public int maxDim()
public boolean hasDim(int dim)
public int[] getDims()
public Texpr0Intern getExpression()
public int getKind()
public Scalar getScalar()
public void setExpression(Texpr0Intern e)
public void setKind(int k)
public void setScalar(Scalar s)
public Tcons0 clone()
clone
in class java.lang.Object
public boolean isEqual(Tcons0 x)
public boolean equals(java.lang.Object x)
equals
in class java.lang.Object