Module org.chocosolver
Class UnArExpression
- java.lang.Object
-
- org.chocosolver.solver.expression.discrete.arithmetic.UnArExpression
-
- All Implemented Interfaces:
ArExpression
public class UnArExpression extends Object implements ArExpression
Unary arithmetic expressionProject: choco-solver.
- Since:
- 28/04/2016.
- Author:
- Charles Prud'homme
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.chocosolver.solver.expression.discrete.arithmetic.ArExpression
ArExpression.Operator
-
-
Field Summary
-
Fields inherited from interface org.chocosolver.solver.expression.discrete.arithmetic.ArExpression
NO_CHILD
-
-
Constructor Summary
Constructors Constructor Description UnArExpression(ArExpression.Operator op, ArExpression exp)
Builds a unary expression
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArExpression[]
getExpressionChild()
Model
getModel()
Return the associated modelint
getNoChild()
ArExpression.Operator
getOp()
int
ieval(int[] values, Map<IntVar,Integer> map)
IntVar
intVar()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.chocosolver.solver.expression.discrete.arithmetic.ArExpression
abs, add, add, add, dist, dist, div, div, eq, eq, eq, extractVar, ge, ge, gt, gt, isExpressionLeaf, le, le, lt, lt, max, max, max, min, min, min, mod, mod, mul, mul, mul, ne, ne, neg, pow, pow, sqr, sub, sub
-
-
-
-
Constructor Detail
-
UnArExpression
public UnArExpression(ArExpression.Operator op, ArExpression exp)
Builds a unary expression- Parameters:
op
- operatorexp
- an arithmetic expression
-
-
Method Detail
-
getModel
public Model getModel()
Description copied from interface:ArExpression
Return the associated model- Specified by:
getModel
in interfaceArExpression
- Returns:
- a Model object
-
getOp
public ArExpression.Operator getOp()
-
getNoChild
public int getNoChild()
- Specified by:
getNoChild
in interfaceArExpression
- Returns:
- the child of this expression, or null if thid
-
getExpressionChild
public ArExpression[] getExpressionChild()
- Specified by:
getExpressionChild
in interfaceArExpression
- Returns:
- the child of this expression, or null if thid
-
intVar
public IntVar intVar()
- Specified by:
intVar
in interfaceArExpression
- Returns:
- the arithmetic expression as an
IntVar
. If necessary, it creates intermediary variable and posts intermediary constraints
-
ieval
public int ieval(int[] values, Map<IntVar,Integer> map)
- Specified by:
ieval
in interfaceArExpression
- 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
-
-