Class UnArExpression

  • All Implemented Interfaces:
    ArExpression

    public class UnArExpression
    extends Object
    implements ArExpression
    Unary arithmetic expression

    Project: choco-solver.

    Since:
    28/04/2016.
    Author:
    Charles Prud'homme
    • Constructor Detail

      • UnArExpression

        public UnArExpression​(ArExpression.Operator op,
                              ArExpression exp)
        Builds a unary expression
        Parameters:
        op - operator
        exp - an arithmetic expression
    • Method Detail

      • getModel

        public Model getModel()
        Description copied from interface: ArExpression
        Return the associated model
        Specified by:
        getModel in interface ArExpression
        Returns:
        a Model object
      • getNoChild

        public int getNoChild()
        Specified by:
        getNoChild in interface ArExpression
        Returns:
        the child of this expression, or null if thid
      • intVar

        public IntVar intVar()
        Specified by:
        intVar in interface ArExpression
        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 interface ArExpression
        Parameters:
        values - int values to evaluate
        map - mapping between variables of the topmost expression and position in values
        Returns:
        an evaluation of this expression with a tuple