static final String name = "Element";
public Element(int[] array, Var indexVar, String oper, int value) {
super(indexVar.getProblem(),name);
Problem problem = (Problem) indexVar.getProblem();
Constrainer constrainer = problem.getConstrainer();
IntArray intValues = new IntArray(constrainer, array.length);
for (int i = 0; i < array.length; i++) {
intValues.set(array[i], i);
}
try {
IntExp element = intValues.elementAt((IntExp) indexVar.getImpl());
problem.defineConstraintImpl(this, element, oper, value);
}
catch (Exception f) {
throw new RuntimeException("Failure to create constraint "+name);
}
}