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

Method trash

contribs/qecode/WorkManager.cc:51–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void WorkPool::trash(vector<int> prefix) {
52 // cout<<" WPT called on ";
53 //if (prefix.empty()) cout<<"empty";
54 //for (int i=0;i< prefix.size();i++) cout<<prefix[i]<<" ";
55 //cout<<endl;
56 // cout<<"debug "<<l.size()<<endl;
57
58 list<QWork>::iterator i=l.begin();
59 while (!(i == l.end())) {
60 // cout<<"| ";
61 // cout.flush();
62 bool avance=true;
63 vector<int> root = (*i).root();
64 if (isPrefix(prefix,root)) {
65 (*i).clean();
66 i=l.erase(i);
67 avance = false;
68 // cout<<"erased";
69 }
70 if (avance) i++;
71 }
72 //cout<<endl;
73
74 //for (list<QWork>::iterator i=l.begin();i != l.end();i++) {
75 //vector<int> root = (*i).root();
76 //if (isPrefix(prefix,root)) {
77 // cout<<" trashing ";
78 // if (root.empty()) cout<<"empty";
79 // for (int j=0;j< root.size();j++) cout<<root[j]<<" ";
80 // cout<<endl;
81 //(*i).clean();
82 //l.erase(i);
83 //i--;
84 //}
85 // }
86}
87
88
89void WorkManager::getNewWorks() {

Callers 1

trashWorksMethod · 0.80

Calls 3

isPrefixFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected