}
for(int i=0;i<nvs;i++) {
if(vs[i]->in.empty()) {
- dfsVisit(vs[i],order);
+ dfsVisit(vs[i],*order);
}
}
return order;
}
// Recursive depth first search giving total order by pushing nodes in the DAG
// onto the front of the list when we finish searching them
-void Blocks::dfsVisit(Variable *v, list<Variable*> *order) {
+void Blocks::dfsVisit(Variable *v, list<Variable*> &order) {
v->visited=true;
vector<Constraint*>::iterator it=v->out.begin();
for(;it!=v->out.end();it++) {
ofstream f(LOGFILE,ios::app);
f<<" order="<<*v<<"\n";
}
- order->push_front(v);
+ order.push_front(v);
}
/**
* Processes incoming constraints, most violated to least, merging with the
void cleanup();
double cost();
private:
- void dfsVisit(Variable *v, std::list<Variable*> *order);
+ void dfsVisit(Variable *v, std::list<Variable*> &order);
void removeBlock(Block *doomed);
Variable **vs;
int nvs;