Module org.maxicp

Interface IntExpression

All Superinterfaces:
Expression, Serializable
All Known Subinterfaces:
BoolExpression, BoolVar, ConcreteBoolVar, ConcreteIntVar, CPBoolVar, CPIntVar, IntVar, SymbolicBoolExpression, SymbolicBoolVar, SymbolicIntExpression, SymbolicIntVar
All Known Implementing Classes:
Abs, And, BoolVarImpl, Constant, CPBoolVarImpl, CPBoolVarIsEqual, CPIntVarConstant, CPIntVarImpl, CPIntVarViewMul, CPIntVarViewOffset, CPIntVarViewOpposite, CstMul, CstOffset, Element1D, Element1DVar, Element2D, Element2DVar, EndAfter, EndBefore, EndBeforeStart, Eq, GreaterOrEq, InSet, IntervalEnd, IntervalEndOrValue, IntervalLength, IntervalLengthOrValue, IntervalStart, IntervalStartOrValue, IntervalStatus, IntVarRangeImpl, IntVarSetImpl, IsNodeRequired, LessOrEq, Max, Min, Mul, MulBinary, Not, NotEq, Or, Present, StartAfter, StartBefore, Sum, UnaryMinus, WeightedSum

public interface IntExpression extends Expression
  • Method Details

    • evaluate

      int evaluate() throws VariableNotFixedException
      Evaluate this expression. All variables referenced have to be fixed.
      Returns:
      the value of this expression
      Throws:
      VariableNotFixedException - when a variable is not fixed
    • min

      int min()
      Return a *lower bound* for this expression
    • max

      int max()
      Return an *upper bound* for this expression
    • contains

      boolean contains(int v)
      Returns whether this expression *can* contain v.
    • fillArray

      int fillArray(int[] array)
      Fill an array of minimum size size() with a *superset* of the domain of this expression. Returns `v`, the size of the domain after it has been computed, with v <= size().
    • size

      int size()
      *Upper bound* on the size of the domain of this expression.
    • plus

      IntExpression plus(int v)
    • minus

      IntExpression minus(int v)
    • plus

    • minus

    • abs

    • mapSubexpressions

      Description copied from interface: Expression
      Apply a function on all sub-expressions of this expression and returns a new expression of the same type. This function should return a value that is of the same class as the object that was given to it.
      Specified by:
      mapSubexpressions in interface Expression
    • show

      default String show()
      Gives the current domain of the expression as a human-readable String. If the expression is fixed, a single number is returned. Otherwise, if the domain can be represented as an interval, it is represented by "{min..max}". Otherwise, all values are enumerated in brackets, without any guarantee on the value ordering (i.e. "{v2, v0, v1}")
      Returns:
      representation of the current domain, in human-readable format.