Use enum class instead of old enum.
As we are relying on c++11x for other stuff too.
This commit is contained in:
parent
7193d2238d
commit
532654baba
@ -16,7 +16,7 @@ class BeliefProp : public GroundSolver {
|
|||||||
class SPNodeInfo;
|
class SPNodeInfo;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum MsgSchedule {
|
enum class MsgSchedule {
|
||||||
seqFixedSch,
|
seqFixedSch,
|
||||||
seqRandomSch,
|
seqRandomSch,
|
||||||
parallelSch,
|
parallelSch,
|
||||||
|
@ -183,7 +183,7 @@ ElimGraph::getLowestCostNode() const
|
|||||||
unsigned minCost = Util::maxUnsigned();
|
unsigned minCost = Util::maxUnsigned();
|
||||||
EGNeighs::const_iterator it;
|
EGNeighs::const_iterator it;
|
||||||
switch (elimHeuristic_) {
|
switch (elimHeuristic_) {
|
||||||
case minNeighborsEh: {
|
case ElimHeuristic::minNeighborsEh: {
|
||||||
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
||||||
unsigned cost = getNeighborsCost (*it);
|
unsigned cost = getNeighborsCost (*it);
|
||||||
if (cost < minCost) {
|
if (cost < minCost) {
|
||||||
@ -192,7 +192,7 @@ ElimGraph::getLowestCostNode() const
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
break;
|
break;
|
||||||
case minWeightEh: {
|
case ElimHeuristic::minWeightEh: {
|
||||||
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
||||||
unsigned cost = getWeightCost (*it);
|
unsigned cost = getWeightCost (*it);
|
||||||
if (cost < minCost) {
|
if (cost < minCost) {
|
||||||
@ -201,7 +201,7 @@ ElimGraph::getLowestCostNode() const
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
break;
|
break;
|
||||||
case minFillEh: {
|
case ElimHeuristic::minFillEh: {
|
||||||
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
||||||
unsigned cost = getFillCost (*it);
|
unsigned cost = getFillCost (*it);
|
||||||
if (cost < minCost) {
|
if (cost < minCost) {
|
||||||
@ -210,7 +210,7 @@ ElimGraph::getLowestCostNode() const
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
break;
|
break;
|
||||||
case weightedMinFillEh: {
|
case ElimHeuristic::weightedMinFillEh: {
|
||||||
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
||||||
unsigned cost = getWeightedFillCost (*it);
|
unsigned cost = getWeightedFillCost (*it);
|
||||||
if (cost < minCost) {
|
if (cost < minCost) {
|
||||||
|
@ -15,7 +15,7 @@ namespace Horus {
|
|||||||
|
|
||||||
class ElimGraph {
|
class ElimGraph {
|
||||||
public:
|
public:
|
||||||
enum ElimHeuristic {
|
enum class ElimHeuristic {
|
||||||
sequentialEh,
|
sequentialEh,
|
||||||
minNeighborsEh,
|
minNeighborsEh,
|
||||||
minWeightEh,
|
minWeightEh,
|
||||||
|
@ -34,14 +34,14 @@ typedef std::vector<unsigned> Ranges;
|
|||||||
typedef unsigned long long ullong;
|
typedef unsigned long long ullong;
|
||||||
|
|
||||||
|
|
||||||
enum LiftedSolverType {
|
enum class LiftedSolverType {
|
||||||
lveSolver, // generalized counting first-order variable elimination (GC-FOVE)
|
lveSolver, // generalized counting first-order variable elimination (GC-FOVE)
|
||||||
lbpSolver, // lifted first-order belief propagation
|
lbpSolver, // lifted first-order belief propagation
|
||||||
lkcSolver // lifted first-order knowledge compilation
|
lkcSolver // lifted first-order knowledge compilation
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
enum GroundSolverType {
|
enum class GroundSolverType {
|
||||||
veSolver, // variable elimination
|
veSolver, // variable elimination
|
||||||
bpSolver, // belief propagation
|
bpSolver, // belief propagation
|
||||||
CbpSolver // counting belief propagation
|
CbpSolver // counting belief propagation
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace Horus {
|
namespace Horus {
|
||||||
|
|
||||||
enum CircuitNodeType {
|
enum class CircuitNodeType {
|
||||||
orCnt,
|
orCnt,
|
||||||
andCnt,
|
andCnt,
|
||||||
setOrCnt,
|
setOrCnt,
|
||||||
@ -1317,7 +1317,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, std::ofstream& os)
|
|||||||
|
|
||||||
switch (getCircuitNodeType (node)) {
|
switch (getCircuitNodeType (node)) {
|
||||||
|
|
||||||
case orCnt: {
|
case CircuitNodeType::orCnt: {
|
||||||
OrNode* casted = dynamic_cast<OrNode*>(node);
|
OrNode* casted = dynamic_cast<OrNode*>(node);
|
||||||
printClauses (casted, os);
|
printClauses (casted, os);
|
||||||
|
|
||||||
@ -1342,7 +1342,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, std::ofstream& os)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case andCnt: {
|
case CircuitNodeType::andCnt: {
|
||||||
AndNode* casted = dynamic_cast<AndNode*>(node);
|
AndNode* casted = dynamic_cast<AndNode*>(node);
|
||||||
printClauses (casted, os);
|
printClauses (casted, os);
|
||||||
|
|
||||||
@ -1367,7 +1367,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, std::ofstream& os)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case setOrCnt: {
|
case CircuitNodeType::setOrCnt: {
|
||||||
SetOrNode* casted = dynamic_cast<SetOrNode*>(node);
|
SetOrNode* casted = dynamic_cast<SetOrNode*>(node);
|
||||||
printClauses (casted, os);
|
printClauses (casted, os);
|
||||||
|
|
||||||
@ -1386,7 +1386,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, std::ofstream& os)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case setAndCnt: {
|
case CircuitNodeType::setAndCnt: {
|
||||||
SetAndNode* casted = dynamic_cast<SetAndNode*>(node);
|
SetAndNode* casted = dynamic_cast<SetAndNode*>(node);
|
||||||
printClauses (casted, os);
|
printClauses (casted, os);
|
||||||
|
|
||||||
@ -1405,7 +1405,7 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, std::ofstream& os)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case incExcCnt: {
|
case CircuitNodeType::incExcCnt: {
|
||||||
IncExcNode* casted = dynamic_cast<IncExcNode*>(node);
|
IncExcNode* casted = dynamic_cast<IncExcNode*>(node);
|
||||||
printClauses (casted, os);
|
printClauses (casted, os);
|
||||||
|
|
||||||
@ -1436,24 +1436,24 @@ LiftedCircuit::exportToGraphViz (CircuitNode* node, std::ofstream& os)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case leafCnt: {
|
case CircuitNodeType::leafCnt: {
|
||||||
printClauses (node, os, "style=filled,fillcolor=palegreen,");
|
printClauses (node, os, "style=filled,fillcolor=palegreen,");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case smoothCnt: {
|
case CircuitNodeType::smoothCnt: {
|
||||||
printClauses (node, os, "style=filled,fillcolor=lightblue,");
|
printClauses (node, os, "style=filled,fillcolor=lightblue,");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case trueCnt: {
|
case CircuitNodeType::trueCnt: {
|
||||||
os << escapeNode (node);
|
os << escapeNode (node);
|
||||||
os << " [shape=box,label=\"⊤\"]" ;
|
os << " [shape=box,label=\"⊤\"]" ;
|
||||||
os << std::endl;
|
os << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case compilationFailedCnt: {
|
case CircuitNodeType::compilationFailedCnt: {
|
||||||
printClauses (node, os, "style=filled,fillcolor=salmon,");
|
printClauses (node, os, "style=filled,fillcolor=salmon,");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ namespace Horus {
|
|||||||
|
|
||||||
class ParfactorList;
|
class ParfactorList;
|
||||||
|
|
||||||
enum LogVarType {
|
enum class LogVarType {
|
||||||
fullLvt,
|
fullLvt,
|
||||||
posLvt,
|
posLvt,
|
||||||
negLvt
|
negLvt
|
||||||
|
Reference in New Issue
Block a user