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

Method disjoint

gecode/int/nvalues/int-base.hpp:79–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77
78 template<class VY>
79 void
80 IntBase<VY>::disjoint(Space& home, Region& r, int*& dis, int& n_dis) {
81 // Compute positions of disjoint views
82 int n=x.size();
83 dis = r.alloc<int>(n); n_dis = 0;
84
85 int i=0;
86 while (i < n)
87 switch (vs.compare(x[i])) {
88 case Iter::Ranges::CS_SUBSET:
89 // All values are already contained in vs, eliminate x[i]
90 x[i].cancel(home, *this, PC_INT_DOM);
91 x[i] = x[--n];
92 break;
93 case Iter::Ranges::CS_DISJOINT:
94 dis[n_dis++] = i++;
95 break;
96 case Iter::Ranges::CS_NONE:
97 i++;
98 break;
99 default:
100 GECODE_NEVER;
101 }
102 x.size(n);
103 }
104
105 template<class VY>
106 void

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
compareMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected