KEltTerm

class KEltTerm : public KTerm

This class represent an expression of type Tab[I] where Tab is an array of integer value and I is the indexing variable

Example :

KProblem p(...);
KIntVar X(...);
KIntVar I(...);
KIntArray valuesArray(...);

KEltTerm eltTerm(valuesArray, I);

// posting the constraint X can take its values indexed by the I variable in the valuesArray
p.post(X == eltTerm);
// equivalent to
p.post(X == valuesArray[I]);

See

KConstraint KElement

Since

2016.1

Public Functions

KEltTerm()

Default Constructor.

KEltTerm(const KIntArray &lValues, const KIntVar &indexVar)

Main constructor : implements the expression lValues[indexVar].

KEltTerm(const KIntArray &lValues, const KUnTerm &indexUnTerm)

implements the expression lValues[I+c]

KEltTerm(void *ptr, const KIntVar &indexVar)

Main constructor : implements the expression lValues[indexVar].

KEltTerm(void *ptr, const KUnTerm &indexUnTerm)

implements the expression lValues[I+c]

KEltTerm(const KEltTerm &toCopy, int pb)

Copy constructor for a specific instance.

KIntArray *getLValues() const

return the array of values indexed by the index variable

KIntVar *getIndexVar() const

return the index variable

void *getUserPointer() const

return the user pointer