Module org.chocosolver
Interface ArExpression
-
- All Known Subinterfaces:
BoolVar
,IntVar
,ReExpression
- All Known Implementing Classes:
BiArExpression
,BiLoExpression
,BiReExpression
,BitsetArrayIntVarImpl
,BitsetIntVarImpl
,BoolNotView
,BoolVarImpl
,EqView
,FixedBoolVarImpl
,FixedIntVarImpl
,IfArExpression
,IntBoolView
,IntervalIntVarImpl
,IntView
,LeqView
,LoExpression
,MinusView
,NaArExpression
,NaLoExpression
,NaReExpression
,OffsetView
,ScaleView
,UnArExpression
,UnLoExpression
public interface ArExpression
arithmetic expressionProject: choco-solver.
- Since:
- 28/04/2016.
- Author:
- Charles Prud'homme
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ArExpression.Operator
List of available operator for arithmetic expression
-
Field Summary
Fields Modifier and Type Field Description static ArExpression[]
NO_CHILD
A default empty array
-
Method Summary
-
-
-
Field Detail
-
NO_CHILD
static final ArExpression[] NO_CHILD
A default empty array
-
-
Method Detail
-
getModel
Model getModel()
Return the associated model- Returns:
- a Model object
-
intVar
IntVar intVar()
- Returns:
- the arithmetic expression as an
IntVar
. If necessary, it creates intermediary variable and posts intermediary constraints
-
isExpressionLeaf
default boolean isExpressionLeaf()
- Returns:
- true if this expression is a leaf, ie a variable, false otherwise
-
extractVar
default void extractVar(HashSet<IntVar> variables)
Extract the variables from this expression- Parameters:
variables
- set of variables
-
ieval
default int ieval(int[] values, Map<IntVar,Integer> map)
- Parameters:
values
- int values to evaluatemap
- mapping between variables of the topmost expression and position in values- Returns:
- an evaluation of this expression with a tuple
-
getNoChild
default int getNoChild()
- Returns:
- the child of this expression, or null if thid
-
getExpressionChild
default ArExpression[] getExpressionChild()
- Returns:
- the child of this expression, or null if thid
-
neg
default ArExpression neg()
- Returns:
- return the expression "-x" where this is "x"
-
abs
default ArExpression abs()
- Returns:
- return the expression "|x|" where this is "x"
-
add
default ArExpression add(int y)
- Parameters:
y
- an int- Returns:
- return the expression "x + y" where this is "x"
-
add
default ArExpression add(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "x + y" where this is "x"
-
add
default ArExpression add(ArExpression... y)
- Parameters:
y
- some expressions- Returns:
- return the expression "x + y_1 + y_2 + ..." where this is "x"
-
sub
default ArExpression sub(int y)
- Parameters:
y
- an int- Returns:
- return the expression "x - y" where this is "x"
-
sub
default ArExpression sub(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "x - y" where this is "x"
-
mul
default ArExpression mul(int y)
- Parameters:
y
- an int- Returns:
- return the expression "x * y" where this is "x"
-
mul
default ArExpression mul(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "x * y" where this is "x"
-
mul
default ArExpression mul(ArExpression... y)
- Parameters:
y
- some expressions- Returns:
- return the expression "x * y_1 * y_2 * ..." where this is "x"
-
div
default ArExpression div(int y)
- Parameters:
y
- an int- Returns:
- return the expression "x / y" where this is "x"
-
div
default ArExpression div(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "x / y" where this is "x"
-
mod
default ArExpression mod(int y)
- Parameters:
y
- an int- Returns:
- return the expression "x % y" where this is "x"
-
mod
default ArExpression mod(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "x % y" where this is "x"
-
sqr
default ArExpression sqr()
- Returns:
- return the expression "x^2" where this is "x"
-
pow
default ArExpression pow(int y)
- Parameters:
y
- an int- Returns:
- return the expression "x + y" where this is "x"
-
pow
default ArExpression pow(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "x + y" where this is "x"
-
min
default ArExpression min(int y)
- Parameters:
y
- an int- Returns:
- return the expression "min(x, y)" where this is "x"
-
min
default ArExpression min(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "min(x, y)" where this is "x"
-
min
default ArExpression min(ArExpression... y)
- Parameters:
y
- some expressions- Returns:
- return the expression "min(x, y_1, y_2, ...)" where this is "x"
-
max
default ArExpression max(int y)
- Parameters:
y
- an int- Returns:
- return the expression "max(x, y)" where this is "x"
-
max
default ArExpression max(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "max(x, y)" where this is "x"
-
max
default ArExpression max(ArExpression... y)
- Parameters:
y
- some expressions- Returns:
- return the expression "max(x, y_1, y_2, ...)" where this is "x"
-
dist
default ArExpression dist(int y)
- Parameters:
y
- an int- Returns:
- return the expression "|x - y|" where this is "x"
-
dist
default ArExpression dist(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "|x - y|" where this is "x"
-
lt
default ReExpression lt(int y)
- Parameters:
y
- an int- Returns:
- return the expression "x < y" where this is "x"
-
lt
default ReExpression lt(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "x < y" where this is "x"
-
le
default ReExpression le(int y)
- Parameters:
y
- an int- Returns:
- return the expression "x <= y" where this is "x"
-
le
default ReExpression le(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "x <= y" where this is "x"
-
gt
default ReExpression gt(int y)
- Parameters:
y
- an ibt- Returns:
- return the expression "x > y" where this is "x"
-
gt
default ReExpression gt(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "x > y" where this is "x"
-
ge
default ReExpression ge(int y)
- Parameters:
y
- an int- Returns:
- return the expression "x >= y" where this is "x"
-
ge
default ReExpression ge(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "x >= y" where this is "x"
-
ne
default ReExpression ne(int y)
- Parameters:
y
- an int- Returns:
- return the expression "x =/= y" where this is "x"
-
ne
default ReExpression ne(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "x =/= y" where this is "x"
-
eq
default ReExpression eq(int y)
- Parameters:
y
- an int- Returns:
- return the expression "x = y" where this is "x"
-
eq
default ReExpression eq(ArExpression y)
- Parameters:
y
- an expression- Returns:
- return the expression "x = y" where this is "x"
-
eq
default ReExpression eq(ArExpression... ys)
- Parameters:
ys
- some expressions- Returns:
- return the expression "x = y_1 = y_2 = ..." where this is "x"
-
-