KMax

class KMax : public KConstraint

This class creates a vMax = max(X1,X2,…,Xn) constraint

Example :

KIntVarArray X(...);
KIntVar maxOfX(...);
// ...
problem.post(KMax("maxOfX=max(X)", maxOfX, X));

See

KConstraint

Since

2016.1

Public Functions

KMax(const char *name, KIntVar &vMax, KIntVarArray &vars, bool boundConsistency = false)

Primary constructor of vMax = max(X1,X2,…,Xn)

Parameters
  • vMax – variable to be the max of vars

  • vars – variable array whose maximum is seeked

KMax(const char *name, KNumVar &vMax, KNumVarArray &vars)

Primary constructor of vMax = max(X1,X2,…,Xn)

Parameters
  • vMax – variable to be the max of vars

  • vars – variable array whose maximum is seeked

KMax(const KMax &toCopy)

Copy Constructor.