re-enable all elimination heuristics

This commit is contained in:
Tiago Gomes 2012-07-02 22:53:44 +01:00
parent 7a3d39551b
commit 4af5a90b8b
2 changed files with 28 additions and 11 deletions

View File

@ -184,26 +184,43 @@ ElimGraph::getLowestCostNode (void) const
{ {
EgNode* bestNode = 0; EgNode* bestNode = 0;
unsigned minCost = std::numeric_limits<unsigned>::max(); unsigned minCost = std::numeric_limits<unsigned>::max();
unsigned cost = 0;
EGNeighs::const_iterator it; EGNeighs::const_iterator it;
switch (elimHeuristic) { switch (elimHeuristic) {
case MIN_NEIGHBORS: { case MIN_NEIGHBORS: {
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) { for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
cost = getNeighborsCost (*it); unsigned cost = getNeighborsCost (*it);
if (cost < minCost) { if (cost < minCost) {
bestNode = *it; bestNode = *it;
minCost = cost; minCost = cost;
} }
}} }}
break; break;
case MIN_WEIGHT: case MIN_WEIGHT: {
//cost = getWeightCost (unmarked_[i]); for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
unsigned cost = getWeightCost (*it);
if (cost < minCost) {
bestNode = *it;
minCost = cost;
}
}}
break; break;
case MIN_FILL: case MIN_FILL: {
//cost = getFillCost (unmarked_[i]); for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
unsigned cost = getFillCost (*it);
if (cost < minCost) {
bestNode = *it;
minCost = cost;
}
}}
break; break;
case WEIGHTED_MIN_FILL: case WEIGHTED_MIN_FILL: {
//cost = getWeightedFillCost (unmarked_[i]); for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
unsigned cost = getWeightedFillCost (*it);
if (cost < minCost) {
bestNode = *it;
minCost = cost;
}
}}
break; break;
default: default:
assert (false); assert (false);