KAbs

class KAbs : public KConstraint

This class creates a X = abs(Y) constraint

Example :

KIntVar X(...);
KIntVar Y(...);
...
problem.post(KAbs("X=|Y|",X,Y));
...

See

KConstraint

Since

2016.1

Public Types

enum PropagationLevel

Propagation level of the constraint.

Values:

enumerator BOUND_CONSISTENCY
enumerator ARC_CONSISTENCY

Public Functions

KAbs(const char *name, KIntVar &X, KIntVar &Y)

This constructor takes threee arguments

Parameters
  • name – label for pretty printing of the constraint

  • X – the ‘X’ variable of the constraint

  • Y – the ‘Y” variable of the constraint

KAbs(const char *name, KNumVar &X, KNumVar &Y)

Constructor. This constructor takes threee arguments

Parameters
  • name – label for pretty printing of the constraint

  • X – the ‘X’ variable of the constraint

  • Y – the ‘Y” variable of the constraint

KAbs(const KAbs &toCopy)

Copy Constructor.