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

Method copy

gecode/int/precede/single.hpp:135–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 }
134 template<class View>
135 Propagator*
136 Single<View>::copy(Space& home) {
137 // Try to eliminate assigned views at the beginning
138 if (alpha > 0) {
139 int i = 0;
140 while ((i < alpha) && x[i].assigned())
141 i++;
142 x.drop_fst(i);
143 for (Advisors<Index> as(c); as(); ++as)
144 as.advisor().i -= i;
145 alpha -= i; beta -= i; gamma -= i;
146 }
147 // Try to eliminate assigned views at the end
148 if (gamma < x.size()) {
149 int i = x.size()-1;
150 while ((i > gamma) && x[i].assigned())
151 i--;
152 x.drop_lst(i);
153 }
154 return new (home) Single<View>(home, *this);
155 }
156
157
158 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