KEltTerm2D

class KEltTerm2D : public KTerm

This class represent an expression of type Tab[I+a][J+b] where Tab is an array of integer value; I,J are the indexing variable and a and b indexing offsets

Example :

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

KEltTerm2D eltTerm(valuesArray,I,J);

// 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

KEltTerm2D()

Default Constructor.

KEltTerm2D(const KIntMatrix &lValues, const KIntVar &indexVar1, const KIntVar &indexVar2)

Main constructor : implements the expression lValues[indexVar1][indexVar2].

KEltTerm2D(KIntMatrix &lValues, const KUnTerm &index1UnTerm, const KUnTerm &index2UnTerm)

implements the expression lValues[I+c][J+d]

KIntMatrix *getLValues() const

return the array of values indexed by the index variable

KIntVar *getFirstIndexVar() const

return the index variable in dimension one

KIntVar *getSecondIndexVar() const

return the index variable in dimension two