MCPcopy Create free account
hub / github.com/Gecode/gecode / operator ++

Method operator ++

gecode/iter/ranges-diff.hpp:70–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69 template<class I, class J>
70 forceinline void
71 Diff<I,J>::operator ++(void) {
72 // Precondition: mi <= ma
73 // Task: find next mi greater than ma
74 while (true) {
75 if (!i()) break;
76 mi = ma+1;
77 ma = i.max();
78 if (mi > i.max()) {
79 ++i;
80 if (!i()) break;
81 mi = i.min();
82 ma = i.max();
83 }
84 while (j() && (j.max() < mi))
85 ++j;
86 if (j() && (j.min() <= ma)) {
87 // Now the interval [mi ... ma] must be shrunken
88 // Is [mi ... ma] completely consumed?
89 if ((mi >= j.min()) && (ma <= j.max()))
90 continue;
91 // Does [mi ... ma] overlap on the left?
92 if (j.min() <= mi) {
93 mi = j.max()+1;
94 // Search for max!
95 ++j;
96 if (j() && (j.min() <= ma))
97 ma = j.min()-1;
98 } else {
99 ma = j.min()-1;
100 }
101 }
102 return;
103 }
104 finish();
105 }
106
107 template<class I, class J>
108 forceinline

Callers

nothing calls this directly

Calls 4

jFunction · 0.85
iFunction · 0.70
maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected