Class KElement


public class KElement extends KConstraint
This class creates a X == Tab[I + cste] constraint

Example :

KIntArray Tab(...);
KIntVar X(...);
KIntVar I(...);
// ...
problem.post(KElement(Tab,I,X,4,"X == Tab[I + 4]"));


Since:
2016.1
See Also:
KConstraint

  • Constructor Details

    • KElement

      protected KElement(long cPtr, boolean cMemoryOwn)
    • KElement

      public KElement(KIntArray Tab, KIntVar I, KIntVar X, int offset, String name)
      Constructor for X == Tab[I + cste]
      Parameters:
      Tab - the values
      I - the index variable
      X - the value variable
      offset - constant offset of index
      name - name of the constraint
    • KElement

      public KElement(KIntArray Tab, KIntVar I, KIntVar X, int offset)
      Constructor for X == Tab[I + cste]
      Parameters:
      Tab - the values
      I - the index variable
      X - the value variable
      offset - constant offset of index
    • KElement

      public KElement(KIntArray Tab, KIntVar I, int x, int offset, String name)
      Constructor for x == Tab[I + cste]
      Parameters:
      Tab - the values
      I - the index variable
      x - the value constant
      offset - constant offset of index
      name - name of the constraint
    • KElement

      public KElement(KIntArray Tab, KIntVar I, int x, int offset)
      Constructor for x == Tab[I + cste]
      Parameters:
      Tab - the values
      I - the index variable
      x - the value constant
      offset - constant offset of index
    • KElement

      public KElement(KEltTerm e, KIntVar X, String name)
    • KElement

      public KElement(KEltTerm e, KIntVar X)
    • KElement

      public KElement(KEltTerm e, int x, String name)
    • KElement

      public KElement(KEltTerm e, int x)
    • KElement

      public KElement(KElement toCopy)
  • Method Details

    • getCPtr

      protected static long getCPtr(KElement obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class KConstraint
    • delete

      public void delete()
      Overrides:
      delete in class KConstraint
    • getValueForIndex

      public int getValueForIndex(int index)
    • setUseValueFunction

      public void setUseValueFunction(boolean useValueFunction)
    • getConstraintIPtr

      public com.artelys.kalis.SWIGTYPE_p_void getConstraintIPtr()