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

Method operator ++

gecode/iter/ranges-union.hpp:125–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123
124 template<class I, class J>
125 inline void
126 Union<I,J>::operator ++(void) {
127 if (!i() && !j()) {
128 finish(); return;
129 }
130
131 if (!i() || (j() && (j.max()+1 < i.min()))) {
132 mi = j.min(); ma = j.max(); ++j; return;
133 }
134 if (!j() || (i() && (i.max()+1 < j.min()))) {
135 mi = i.min(); ma = i.max(); ++i; return;
136 }
137
138 mi = std::min(i.min(),j.min());
139 ma = std::max(i.max(),j.max());
140
141 ++i; ++j;
142
143 next:
144 if (i() && (i.min() <= ma+1)) {
145 ma = std::max(ma,i.max()); ++i;
146 goto next;
147 }
148 if (j() && (j.min() <= ma+1)) {
149 ma = std::max(ma,j.max()); ++j;
150 goto next;
151 }
152 }
153
154
155 template<class I, class J>

Callers

nothing calls this directly

Calls 6

jFunction · 0.85
iFunction · 0.70
minFunction · 0.50
maxFunction · 0.50
maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected