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 == eltTerm);
// equivalent to == valuesArray[I]);


KConstraint KElement



Public Functions


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