5 #ifndef TB2SAMECONSTR_HPP_ 6 #define TB2SAMECONSTR_HPP_ 8 #include "tb2flowbasedconstr.hpp" 10 class SameConstraint :
public FlowBasedGlobalConstraint {
15 int nDistinctDomainValues;
16 pair<int, int> mapto(
int varindex, Value val);
18 size_t GetGraphAllocatedSize();
19 void buildGraph(Graph& g);
23 SameConstraint(WCSP* wcsp, EnumeratedVariable** scope_in,
int 28 Cost evalOriginal(
const String& s);
41 string getName() {
return "ssame"; }
42 void read(istream& file,
bool mult =
true);
43 void addVariablesToGroup(EnumeratedVariable* variable,
int groupID)
46 for (
int j = 0; j < arity_; j++) {
47 if (getVar(j) == variable) {
48 group[groupID].push_back(j);
55 for (
int g = 0; g < 2; g++)
56 sort(group[g].begin(), group[g].end());
60 void dump(ostream& os,
bool original =
true);