add MakeAllDifferent api without range parameter

This commit is contained in:
lperron@google.com
2012-01-16 10:34:51 +00:00
parent 52210f822a
commit c93623d87b
2 changed files with 9 additions and 1 deletions

View File

@@ -423,6 +423,10 @@ bool BoundsAllDifferent::PropagateMax() {
}
} // namespace
Constraint* Solver::MakeAllDifferent(const std::vector<IntVar*>& vars) {
return MakeAllDifferent(vars.data(), vars.size(), true);
}
Constraint* Solver::MakeAllDifferent(const std::vector<IntVar*>& vars, bool range) {
return MakeAllDifferent(vars.data(), vars.size(), range);
}

View File

@@ -1534,8 +1534,12 @@ class Solver {
int64 total_sum);
// All variables are pairwise different.
Constraint* MakeAllDifferent(const std::vector<IntVar*>& vars);
// All variables are pairwise different. If 'range' is true,
// stronger , and potentially slower propagation will occur.
Constraint* MakeAllDifferent(const std::vector<IntVar*>& vars, bool range);
// All variables are pairwise different.
// All variables are pairwise different. If 'range' is true,
// stronger , and potentially slower propagation will occur.
Constraint* MakeAllDifferent(const IntVar* const* vars,
int size, bool range);