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

Method print

examples/bacp.cpp:225–241  ·  view source on GitHub ↗

Print solution

Source from the content-addressed store, hash-verified

223 }
224 /// Print solution
225 virtual void
226 print(std::ostream& os) const {
227 std::vector<std::list<int> > period(curr.p);
228 for (int i=x.size(); i--;)
229 period[x[i].val()].push_back(i);
230
231 os << "Solution with load " << u.val() << ":" << std::endl;
232 for (int i=0; i<curr.p; i++) {
233 os << "\tPeriod "<<i+1<<": ";
234 for (std::list<int>::iterator v=period[i].begin();
235 v != period[i].end(); ++v) {
236 os << curr.courses[*v].name << " ";
237 }
238 os << std::endl;
239 }
240 os << std::endl;
241 }
242
243};
244

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
valMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected