Arrays.fill(currentSupport1, -1);
//double cardprod = v0.getDomainSize() * v1.getDomainSize();
//if (cardprod <= 7000)
fastInitNbSupports(Integer.MAX_VALUE, Integer.MAX_VALUE);
//else fastInitNbSupports(80,80);
DisposableValueIterator itv0 = v0.getValueIterator(true);
int left = Integer.MIN_VALUE;
int right = left;
int support = 0;
boolean found = false;
try {
while (itv0.hasNext()) {
DisposableValueIterator itv1 = v1.getValueIterator(true);
int val0 = itv0.next();
while (itv1.hasNext()) {
int val1 = itv1.next();
if (relation.isConsistent(val0, val1)) {
support = val1;
found = true;
break;
}
}
itv1.dispose();
if (!found) {
if (val0 == right + 1) {
right = val0;
} else {
v0.removeInterval(left, right, this);
left = right = val0;
}
} else {
storeSupportV0(support, val0);
}
found = false;
}
v0.removeInterval(left, right, this);
} finally {
itv0.dispose();
}
found = false;
DisposableValueIterator itv1 = v1.getValueIterator(true);
left = right = Integer.MIN_VALUE;
try {
while (itv1.hasNext()) {
itv0 = v0.getValueIterator(true);
int val1 = itv1.next();
while (itv0.hasNext()) {
int val0 = itv0.next();
if (relation.isConsistent(val0, val1)) {
support = val0;
found = true;
break;
}
}
itv0.dispose();
if (!found) {
if (val1 == right + 1) {
right = val1;
} else {
v1.removeInterval(left, right, this);
left = right = val1;
}
} else {
storeSupportV1(support, val1);
}
found = false;
}
v1.removeInterval(left, right, this);
} finally {
itv1.dispose();
}
//propagate();
}