small optim on tables

This commit is contained in:
lperron@google.com
2014-07-19 04:21:03 +00:00
parent 7f6ebdb100
commit b641dd9500

View File

@@ -1130,7 +1130,7 @@ class SmallCompactPositiveTableConstraint : public BasePositiveTableConstraint {
}
case 2: {
ApplyMask(var_index, masks_[var_index][var->Min() - original_min] |
masks_[var_index][var->Max() - original_min]);
masks_[var_index][var->Max() - original_min]);
return;
}
default: {
@@ -1149,8 +1149,10 @@ class SmallCompactPositiveTableConstraint : public BasePositiveTableConstraint {
// to remove this code and the var_sizes in the non_small
// version.
uint64 hole_mask = 0;
for (const int64 value : InitAndGetValues(holes_[var_index])) {
hole_mask |= var_mask[value - original_min];
if (!contiguous) {
for (const int64 value : InitAndGetValues(holes_[var_index])) {
hole_mask |= var_mask[value - original_min];
}
}
const int64 hole_operations = var_min - old_min + old_max - var_max;
// We estimate the domain iterator to be 4x slower.