Move ElimHeuristic enum to inside of ElimGraph class
This commit is contained in:
parent
8de22f4f0b
commit
8ca379c74a
@ -6,7 +6,8 @@
|
||||
|
||||
namespace Horus {
|
||||
|
||||
ElimHeuristic ElimGraph::elimHeuristic_ = minNeighborsEh;
|
||||
ElimGraph::ElimHeuristic ElimGraph::elimHeuristic_ =
|
||||
ElimHeuristic::minNeighborsEh;
|
||||
|
||||
|
||||
ElimGraph::ElimGraph (const std::vector<Factor*>& factors)
|
||||
|
@ -18,15 +18,6 @@ class EGNode;
|
||||
typedef TinySet<EGNode*> EGNeighs;
|
||||
|
||||
|
||||
enum ElimHeuristic {
|
||||
sequentialEh,
|
||||
minNeighborsEh,
|
||||
minWeightEh,
|
||||
minFillEh,
|
||||
weightedMinFillEh
|
||||
};
|
||||
|
||||
|
||||
class EGNode : public Var {
|
||||
public:
|
||||
EGNode (VarId vid, unsigned range) : Var (vid, range) { }
|
||||
@ -46,6 +37,14 @@ class EGNode : public Var {
|
||||
|
||||
class ElimGraph {
|
||||
public:
|
||||
enum ElimHeuristic {
|
||||
sequentialEh,
|
||||
minNeighborsEh,
|
||||
minWeightEh,
|
||||
minFillEh,
|
||||
weightedMinFillEh
|
||||
};
|
||||
|
||||
ElimGraph (const Factors&);
|
||||
|
||||
~ElimGraph (void);
|
||||
|
@ -226,15 +226,15 @@ setHorusFlag (std::string option, std::string value)
|
||||
|
||||
} else if (option == "hve_elim_heuristic") {
|
||||
if (value == "sequential")
|
||||
ElimGraph::setElimHeuristic (ElimHeuristic::sequentialEh);
|
||||
ElimGraph::setElimHeuristic (ElimGraph::ElimHeuristic::sequentialEh);
|
||||
else if (value == "min_neighbors")
|
||||
ElimGraph::setElimHeuristic (ElimHeuristic::minNeighborsEh);
|
||||
ElimGraph::setElimHeuristic (ElimGraph::ElimHeuristic::minNeighborsEh);
|
||||
else if (value == "min_weight")
|
||||
ElimGraph::setElimHeuristic (ElimHeuristic::minWeightEh);
|
||||
ElimGraph::setElimHeuristic (ElimGraph::ElimHeuristic::minWeightEh);
|
||||
else if (value == "min_fill")
|
||||
ElimGraph::setElimHeuristic (ElimHeuristic::minFillEh);
|
||||
ElimGraph::setElimHeuristic (ElimGraph::ElimHeuristic::minFillEh);
|
||||
else if (value == "weighted_min_fill")
|
||||
ElimGraph::setElimHeuristic (ElimHeuristic::weightedMinFillEh);
|
||||
ElimGraph::setElimHeuristic (ElimGraph::ElimHeuristic::weightedMinFillEh);
|
||||
else
|
||||
returnVal = invalidValue (option, value);
|
||||
|
||||
|
@ -42,12 +42,13 @@ VarElim::printSolverFlags (void) const
|
||||
std::stringstream ss;
|
||||
ss << "variable elimination [" ;
|
||||
ss << "elim_heuristic=" ;
|
||||
typedef ElimGraph::ElimHeuristic EGEH;
|
||||
switch (ElimGraph::elimHeuristic()) {
|
||||
case ElimHeuristic::sequentialEh: ss << "sequential"; break;
|
||||
case ElimHeuristic::minNeighborsEh: ss << "min_neighbors"; break;
|
||||
case ElimHeuristic::minWeightEh: ss << "min_weight"; break;
|
||||
case ElimHeuristic::minFillEh: ss << "min_fill"; break;
|
||||
case ElimHeuristic::weightedMinFillEh: ss << "weighted_min_fill"; break;
|
||||
case EGEH::sequentialEh: ss << "sequential"; break;
|
||||
case EGEH::minNeighborsEh: ss << "min_neighbors"; break;
|
||||
case EGEH::minWeightEh: ss << "min_weight"; break;
|
||||
case EGEH::minFillEh: ss << "min_fill"; break;
|
||||
case EGEH::weightedMinFillEh: ss << "weighted_min_fill"; break;
|
||||
}
|
||||
ss << ",log_domain=" << Util::toString (Globals::logDomain);
|
||||
ss << "]" ;
|
||||
|
Reference in New Issue
Block a user