Use enum class instead of old enum.

As we are relying on c++11x for other stuff too.
This commit is contained in:
Tiago Gomes 2013-03-09 15:39:39 +00:00
parent 7193d2238d
commit 532654baba
6 changed files with 19 additions and 19 deletions

View File

@ -16,7 +16,7 @@ class BeliefProp : public GroundSolver {
class SPNodeInfo;
public:
enum MsgSchedule {
enum class MsgSchedule {
seqFixedSch,
seqRandomSch,
parallelSch,

View File

@ -183,7 +183,7 @@ ElimGraph::getLowestCostNode() const
unsigned minCost = Util::maxUnsigned();
EGNeighs::const_iterator it;
switch (elimHeuristic_) {
case minNeighborsEh: {
case ElimHeuristic::minNeighborsEh: {
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
unsigned cost = getNeighborsCost (*it);
if (cost < minCost) {
@ -192,7 +192,7 @@ ElimGraph::getLowestCostNode() const
}
}}
break;
case minWeightEh: {
case ElimHeuristic::minWeightEh: {
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
unsigned cost = getWeightCost (*it);
if (cost < minCost) {
@ -201,7 +201,7 @@ ElimGraph::getLowestCostNode() const
}
}}
break;
case minFillEh: {
case ElimHeuristic::minFillEh: {
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
unsigned cost = getFillCost (*it);
if (cost < minCost) {
@ -210,7 +210,7 @@ ElimGraph::getLowestCostNode() const
}
}}
break;
case weightedMinFillEh: {
case ElimHeuristic::weightedMinFillEh: {
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
unsigned cost = getWeightedFillCost (*it);
if (cost < minCost) {

View File

@ -15,7 +15,7 @@ namespace Horus {
class ElimGraph {
public:
enum ElimHeuristic {
enum class ElimHeuristic {
sequentialEh,
minNeighborsEh,
minWeightEh,

View File

@ -34,14 +34,14 @@ typedef std::vector<unsigned> Ranges;
typedef unsigned long long ullong;
enum LiftedSolverType {
enum class LiftedSolverType {
lveSolver, // generalized counting first-order variable elimination (GC-FOVE)
lbpSolver, // lifted first-order belief propagation
lkcSolver // lifted first-order knowledge compilation
};
enum GroundSolverType {
enum class GroundSolverType {
veSolver, // variable elimination
bpSolver, // belief propagation
CbpSolver // counting belief propagation

View File

@ -14,7 +14,7 @@
namespace Horus {
enum CircuitNodeType {
enum class CircuitNodeType {
orCnt,
andCnt,
setOrCnt,
@ -1317,7 +1317,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, std::ofstream& os)
switch (getCircuitNodeType (node)) {
case orCnt: {
case CircuitNodeType::orCnt: {
OrNode* casted = dynamic_cast<OrNode*>(node);
printClauses (casted, os);
@ -1342,7 +1342,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, std::ofstream& os)
break;
}
case andCnt: {
case CircuitNodeType::andCnt: {
AndNode* casted = dynamic_cast<AndNode*>(node);
printClauses (casted, os);
@ -1367,7 +1367,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, std::ofstream& os)
break;
}
case setOrCnt: {
case CircuitNodeType::setOrCnt: {
SetOrNode* casted = dynamic_cast<SetOrNode*>(node);
printClauses (casted, os);
@ -1386,7 +1386,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, std::ofstream& os)
break;
}
case setAndCnt: {
case CircuitNodeType::setAndCnt: {
SetAndNode* casted = dynamic_cast<SetAndNode*>(node);
printClauses (casted, os);
@ -1405,7 +1405,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, std::ofstream& os)
break;
}
case incExcCnt: {
case CircuitNodeType::incExcCnt: {
IncExcNode* casted = dynamic_cast<IncExcNode*>(node);
printClauses (casted, os);
@ -1436,24 +1436,24 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, std::ofstream& os)
break;
}
case leafCnt: {
case CircuitNodeType::leafCnt: {
printClauses (node, os, "style=filled,fillcolor=palegreen,");
break;
}
case smoothCnt: {
case CircuitNodeType::smoothCnt: {
printClauses (node, os, "style=filled,fillcolor=lightblue,");
break;
}
case trueCnt: {
case CircuitNodeType::trueCnt: {
os << escapeNode (node);
os << " [shape=box,label=\"\"]" ;
os << std::endl;
break;
}
case compilationFailedCnt: {
case CircuitNodeType::compilationFailedCnt: {
printClauses (node, os, "style=filled,fillcolor=salmon,");
break;
}

View File

@ -15,7 +15,7 @@ namespace Horus {
class ParfactorList;
enum LogVarType {
enum class LogVarType {
fullLvt,
posLvt,
negLvt