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

Method copy

gecode/set/precede/single.hpp:149–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 }
148 template<class View>
149 Propagator*
150 Single<View>::copy(Space& home) {
151 // Try to eliminate assigned views at the beginning
152 if (alpha > 0) {
153 int i = 0;
154 while ((i < alpha) && x[i].assigned())
155 i++;
156 x.drop_fst(i);
157 for (Advisors<Index> as(c); as(); ++as)
158 as.advisor().i -= i;
159 alpha -= i; beta -= i; gamma -= i;
160 }
161 // Try to eliminate assigned views at the end
162 if (gamma < x.size()) {
163 int i = x.size()-1;
164 while ((i > gamma) && x[i].assigned())
165 i--;
166 x.drop_lst(i);
167 }
168 return new (home) Single<View>(home, *this);
169 }
170
171
172 template<class View>

Callers

nothing calls this directly

Calls 4

drop_fstMethod · 0.80
drop_lstMethod · 0.80
assignedMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected