MCPcopy Create free account
hub / github.com/Gecode/gecode / minSymDiff

Function minSymDiff

test/set/dom.cpp:71–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70 namespace {
71 static int minSymDiff(const SetAssignment& x, int i, const IntSet& is) {
72 typedef Iter::Ranges::Diff<CountableSetRanges,IntSetRanges> DiffA;
73 CountableSetRanges xr00(x.lub, x[i]);
74 IntSetRanges xr10(is);
75 DiffA a(xr00,xr10);
76 typedef Iter::Ranges::Diff<IntSetRanges,CountableSetRanges> DiffB;
77 CountableSetRanges xr01(x.lub, x[i]);
78 IntSetRanges xr11(is);
79 DiffB b(xr11,xr01);
80 Iter::Ranges::Union<DiffA,DiffB> u(a,b);
81 return u() ? u.min() : Gecode::Set::Limits::max+1;
82 }
83 template<class I>
84 static bool in(int i, I& c, bool eq=false) {
85 if (eq && i==Gecode::Set::Limits::max+1)

Callers 5

solutionMethod · 0.85
solutionMethod · 0.85
solutionMethod · 0.85
solutionMethod · 0.85
solutionMethod · 0.85

Calls 1

minMethod · 0.45

Tested by

no test coverage detected