Package apron
Class Lincons0
java.lang.Object
apron.Lincons0
- All Implemented Interfaces:
Serializable
,Cloneable
Class of level 0 linear constraints.
A Lincons0 represents a linear constraint over variables denoted
by dimension (i.e., integer starting from 0).
It has a left member (which is a Linexpr0
level 0 linear
expression), a constraint operator (=, >=, >, <>, or = modulo),
a right member which is always 0, and an optional constant modulo
factor (for = modulo constraints only).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Disquality constraint: expr <> 0.static final int
Equality constraint: expr = 0.static final int
Congruence equality constraint modulo a constant: expr = 0 mod scalar.Left member of the constraint.int
Optional modulo factor.static final int
Strict inequality constraint: expr > 0.static final int
Inequality constraint: expr >= 0. -
Constructor Summary
ConstructorsConstructorDescriptionLincons0()
Constructs an universal constraint 0 >= 0.Lincons0
(boolean sat) Constructs a constraint that is either universal (0 >= 0), or unsatisfiable (-1 >= 0).Constructs a constraint with given kind and e as left member.Constructs a constraint with given kind, e as left member, and s as modulo factor.Constructs a copy of c. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds some dimensions and shifts coefficients accordingly .Returns a copy of the constraint with some dimensions added.clone()
Returns a copy of this.boolean
Whether x is a Lincons0 and structurally equal to this.getCoeff
(int dim) Returns a copy of the coefficient of dimension dim.Coeff[]
Returns a copy of all dimension coefficients.getCst()
Returns a copy of the constant coefficient.Returns the left expression.int
getKind()
Returns the constraint kind.Linterm0[]
Returns a copy of all dimension coefficients.Returns the optional modulo factor (may be null).int
getSize()
Returns the size of the constraint.int
hashCode()
Returns a hash of the constraint.boolean
Whether this and x have identical kinds and coefficients.boolean
isInteger
(int intdim) Whether the constraint only depends on the integer-valued dimensions (dimensions 0 to intdim-1).boolean
isLinear()
Whether the constraint has only scalar coefficients.boolean
Whether the constraint has only scalar coefficients, except maybe for the constant coefficient.boolean
isReal
(int intdim) Whether the constraint only depends on real-valued dimensions (dimensions intdim and greater).boolean
isSparse()
Whether the underlying expression is sparse or dense.boolean
isUnsat()
Whether the constraint is trivially unsatisfiable.int
maxDim()
Returns the maximum occurring dimension + 1.void
minimize()
Simplifies the representation.void
Permutes some dimensions in the constraint.Returns a copy of the constraint with some dimensions permuted.void
resize
(int size) Changes the size of the underlying expression.void
Sets the coefficient of dimension dim to c.void
Sets several dimension coefficients at the same time.void
Sets the constant coefficient to c.void
Sets the left expression.void
setKind
(int k) Sets the constraint kind.void
Sets the optional modulo factor (may be null).toString()
Returns a string representation of the constraint.Returns a string representation of the constraint.
-
Field Details
-
expr
Left member of the constraint. -
kind
public int kind -
scalar
Optional modulo factor.null, except for
EQMOD
. -
EQ
public static final int EQEquality constraint: expr = 0.- See Also:
-
SUPEQ
public static final int SUPEQInequality constraint: expr >= 0.- See Also:
-
SUP
public static final int SUPStrict inequality constraint: expr > 0.- See Also:
-
EQMOD
public static final int EQMODCongruence equality constraint modulo a constant: expr = 0 mod scalar.- See Also:
-
DISEQ
public static final int DISEQDisquality constraint: expr <> 0.- See Also:
-
-
Constructor Details
-
Lincons0
public Lincons0()Constructs an universal constraint 0 >= 0. -
Lincons0
public Lincons0(boolean sat) Constructs a constraint that is either universal (0 >= 0), or unsatisfiable (-1 >= 0). -
Lincons0
Constructs a constraint with given kind and e as left member.e is referenced, not copied.
-
Lincons0
Constructs a constraint with given kind, e as left member, and s as modulo factor.e and s are referenced, not copied.
-
Lincons0
Constructs a copy of c.The left member expression and the optional scalar are copied.
-
-
Method Details
-
setExpression
Sets the left expression. -
setCoeff
Sets the coefficient of dimension dim to c. -
setCst
Sets the constant coefficient to c. -
setCoeff
Sets several dimension coefficients at the same time. -
setKind
public void setKind(int k) Sets the constraint kind. -
setScalar
Sets the optional modulo factor (may be null). -
getExpression
Returns the left expression. -
getKind
public int getKind()Returns the constraint kind. -
getScalar
Returns the optional modulo factor (may be null). -
getCoeff
Returns a copy of the coefficient of dimension dim. -
getCst
Returns a copy of the constant coefficient. -
getLinterms
Returns a copy of all dimension coefficients. -
getCoeffs
Returns a copy of all dimension coefficients. -
getSize
public int getSize()Returns the size of the constraint. -
maxDim
public int maxDim()Returns the maximum occurring dimension + 1. -
toString
Returns a string representation of the constraint.Dimension i is denoted as xi.
-
toString
Returns a string representation of the constraint.Dimension i is denoted by names[i].
-
toString
-
hashCode
public int hashCode()Returns a hash of the constraint. -
isSparse
public boolean isSparse()Whether the underlying expression is sparse or dense. -
isInteger
public boolean isInteger(int intdim) Whether the constraint only depends on the integer-valued dimensions (dimensions 0 to intdim-1). -
isReal
public boolean isReal(int intdim) Whether the constraint only depends on real-valued dimensions (dimensions intdim and greater). -
isLinear
public boolean isLinear()Whether the constraint has only scalar coefficients. -
isQuasilinear
public boolean isQuasilinear()Whether the constraint has only scalar coefficients, except maybe for the constant coefficient. -
isUnsat
public boolean isUnsat()Whether the constraint is trivially unsatisfiable.Returns true if the constraint has the form b >= 0 or [a,b] >= 0 with b negative.
-
isEqual
Whether this and x have identical kinds and coefficients. -
resize
public void resize(int size) Changes the size of the underlying expression.Added coefficients are set to 0.
-
minimize
public void minimize()Simplifies the representation.- See Also:
-
addDimensions
Adds some dimensions and shifts coefficients accordingly . -
permuteDimensions
Permutes some dimensions in the constraint. -
addDimensionsCopy
Returns a copy of the constraint with some dimensions added.this is not changed.
-
permuteDimensionsCopy
Returns a copy of the constraint with some dimensions permuted.this is not changed.
-
clone
Returns a copy of this. -
equals
Whether x is a Lincons0 and structurally equal to this.
-