Package com.artelys.kalis
Class KElement2D
- java.lang.Object
-
- com.artelys.kalis.KConstraint
-
- com.artelys.kalis.KElement2D
-
public class KElement2D extends KConstraint
This class creates a X == Tab[I + cste1][J + cste2] constraint
Example :
KIntArray Tab(...); KIntVar X(...); KIntVar I(...); KIntVar J(...); // ... problem.post(KElement2D(Tab, I, J, X, 4, 8, "X == Tab[I + 4][J+8]"));
- Since:
- 2016.1
- See Also:
KConstraint
-
-
Field Summary
-
Fields inherited from class com.artelys.kalis.KConstraint
swigCMemOwn
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
KElement2D(long cPtr, boolean cMemoryOwn)
KElement2D(KElement2D toCopy)
Copy constructorKElement2D(KEltTerm2D eltTerm2D, KIntVar X)
Constructor with KEltTerm2DKElement2D(KEltTerm2D eltTerm2D, KIntVar X, java.lang.String name)
Constructor with KEltTerm2DKElement2D(KIntMatrix matrix, KIntVar I, KIntVar J, KIntVar X, int offset1, int offset2)
Primary ConstructorKElement2D(KIntMatrix matrix, KIntVar I, KIntVar J, KIntVar X, int offset1, int offset2, java.lang.String name)
Primary Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
protected void
finalize()
com.artelys.kalis.SWIGTYPE_p_void
getConstraintIPtr()
protected static long
getCPtr(KElement2D obj)
int
getValueForIndex(int index1, int index2)
Get the value for I = index1 and J = index2void
setUseValueFunction(boolean useValueFunction)
Choose value method between Table and method 'getValueForIndex'-
Methods inherited from class com.artelys.kalis.KConstraint
askIfEntailed, getArity, getCopyPtr, getCPtr, getInstance, getInstanceCopyPtr, getLinearRelaxation, getLinearRelaxation, getName, getPriority, getProblem, getTag, getTypeInfo, isGetLinearRelaxationImplemented, print, print, setName, setPriority, setTag
-
-
-
-
Constructor Detail
-
KElement2D
protected KElement2D(long cPtr, boolean cMemoryOwn)
-
KElement2D
public KElement2D(KIntMatrix matrix, KIntVar I, KIntVar J, KIntVar X, int offset1, int offset2, java.lang.String name)
Primary Constructor- Parameters:
matrix
- the valuesI
- the first index variableJ
- the second index variableX
- the value variableoffset1
- constant offset of first index variableoffset2
- constant offset of second index variablename
- name of the constraint
-
KElement2D
public KElement2D(KIntMatrix matrix, KIntVar I, KIntVar J, KIntVar X, int offset1, int offset2)
Primary Constructor- Parameters:
matrix
- the valuesI
- the first index variableJ
- the second index variableX
- the value variableoffset1
- constant offset of first index variableoffset2
- constant offset of second index variable
-
KElement2D
public KElement2D(KEltTerm2D eltTerm2D, KIntVar X, java.lang.String name)
Constructor with KEltTerm2D- Parameters:
eltTerm2D
- the two dimensional element termX
- the value variablename
- name of the constraint
-
KElement2D
public KElement2D(KEltTerm2D eltTerm2D, KIntVar X)
Constructor with KEltTerm2D- Parameters:
eltTerm2D
- the two dimensional element termX
- the value variable
-
KElement2D
public KElement2D(KElement2D toCopy)
Copy constructor
-
-
Method Detail
-
getCPtr
protected static long getCPtr(KElement2D obj)
-
finalize
protected void finalize()
- Overrides:
finalize
in classKConstraint
-
delete
public void delete()
- Overrides:
delete
in classKConstraint
-
getValueForIndex
public int getValueForIndex(int index1, int index2)
Get the value for I = index1 and J = index2
-
setUseValueFunction
public void setUseValueFunction(boolean useValueFunction)
Choose value method between Table and method 'getValueForIndex'
-
getConstraintIPtr
public com.artelys.kalis.SWIGTYPE_p_void getConstraintIPtr()
-
-