rename some enums

This commit is contained in:
Tiago Gomes 2012-06-12 21:27:17 +01:00
parent af11dbb445
commit 89725dffbb
4 changed files with 19 additions and 19 deletions

View File

@ -28,14 +28,14 @@ typedef vector<unsigned> Ranges;
typedef unsigned long long ullong; typedef unsigned long long ullong;
enum LiftedSolvers enum LiftedSolver
{ {
FOVE, // first order variable elimination FOVE, // first order variable elimination
LBP, // lifted belief propagation LBP, // lifted belief propagation
}; };
enum GroundSolvers enum GroundSolver
{ {
VE, // variable elimination VE, // variable elimination
BP, // belief propagation BP, // belief propagation
@ -50,8 +50,8 @@ extern bool logDomain;
// level of debug information // level of debug information
extern unsigned verbosity; extern unsigned verbosity;
extern LiftedSolvers liftedSolver; extern LiftedSolver liftedSolver;
extern GroundSolvers groundSolver; extern GroundSolver groundSolver;
}; };

View File

@ -162,13 +162,13 @@ runSolver (const FactorGraph& fg, const VarIds& queryIds)
{ {
Solver* solver = 0; Solver* solver = 0;
switch (Globals::groundSolver) { switch (Globals::groundSolver) {
case GroundSolvers::VE: case GroundSolver::VE:
solver = new VarElim (fg); solver = new VarElim (fg);
break; break;
case GroundSolvers::BP: case GroundSolver::BP:
solver = new BeliefProp (fg); solver = new BeliefProp (fg);
break; break;
case GroundSolvers::CBP: case GroundSolver::CBP:
solver = new CountingBp (fg); solver = new CountingBp (fg);
break; break;
default: default:

View File

@ -311,14 +311,14 @@ runLiftedSolver (void)
} }
jointList = YAP_TailOfTerm (jointList); jointList = YAP_TailOfTerm (jointList);
} }
if (Globals::liftedSolver == LiftedSolvers::FOVE) { if (Globals::liftedSolver == LiftedSolver::FOVE) {
LiftedVe solver (pfListCopy); LiftedVe solver (pfListCopy);
if (Globals::verbosity > 0 && taskList == YAP_ARG2) { if (Globals::verbosity > 0 && taskList == YAP_ARG2) {
solver.printSolverFlags(); solver.printSolverFlags();
cout << endl; cout << endl;
} }
results.push_back (solver.solveQuery (queryVars)); results.push_back (solver.solveQuery (queryVars));
} else if (Globals::liftedSolver == LiftedSolvers::LBP) { } else if (Globals::liftedSolver == LiftedSolver::LBP) {
LiftedBp solver (pfListCopy); LiftedBp solver (pfListCopy);
if (Globals::verbosity > 0 && taskList == YAP_ARG2) { if (Globals::verbosity > 0 && taskList == YAP_ARG2) {
solver.printSolverFlags(); solver.printSolverFlags();
@ -362,7 +362,7 @@ runGroundSolver (void)
} }
vector<Params> results; vector<Params> results;
if (Globals::groundSolver == GroundSolvers::VE) { if (Globals::groundSolver == GroundSolver::VE) {
runVeSolver (fg, tasks, results); runVeSolver (fg, tasks, results);
} else { } else {
runBeliefProp (fg, tasks, results); runBeliefProp (fg, tasks, results);
@ -427,9 +427,9 @@ void runBeliefProp (
//mfg = BayesBall::getMinimalFactorGraph ( //mfg = BayesBall::getMinimalFactorGraph (
// *fg, VarIds (vids.begin(),vids.end())); // *fg, VarIds (vids.begin(),vids.end()));
} }
if (Globals::groundSolver == GroundSolvers::BP) { if (Globals::groundSolver == GroundSolver::BP) {
solver = new BeliefProp (*fg); // FIXME solver = new BeliefProp (*fg); // FIXME
} else if (Globals::groundSolver == GroundSolvers::CBP) { } else if (Globals::groundSolver == GroundSolver::CBP) {
CountingBp::checkForIdenticalFactors = false; CountingBp::checkForIdenticalFactors = false;
solver = new CountingBp (*fg); // FIXME solver = new CountingBp (*fg); // FIXME
} else { } else {

View File

@ -13,9 +13,9 @@ bool logDomain = false;
unsigned verbosity = 0; unsigned verbosity = 0;
LiftedSolvers liftedSolver = LiftedSolvers::FOVE; LiftedSolver liftedSolver = LiftedSolver::FOVE;
GroundSolvers groundSolver = GroundSolvers::VE; GroundSolver groundSolver = GroundSolver::VE;
}; };
@ -211,9 +211,9 @@ setHorusFlag (string key, string value)
ss >> Globals::verbosity; ss >> Globals::verbosity;
} else if (key == "lifted_solver") { } else if (key == "lifted_solver") {
if ( value == "fove") { if ( value == "fove") {
Globals::liftedSolver = LiftedSolvers::FOVE; Globals::liftedSolver = LiftedSolver::FOVE;
} else if (value == "lbp") { } else if (value == "lbp") {
Globals::liftedSolver = LiftedSolvers::LBP; Globals::liftedSolver = LiftedSolver::LBP;
} else { } else {
cerr << "warning: invalid value `" << value << "' " ; cerr << "warning: invalid value `" << value << "' " ;
cerr << "for `" << key << "'" << endl; cerr << "for `" << key << "'" << endl;
@ -221,11 +221,11 @@ setHorusFlag (string key, string value)
} }
} else if (key == "ground_solver") { } else if (key == "ground_solver") {
if ( value == "ve") { if ( value == "ve") {
Globals::groundSolver = GroundSolvers::VE; Globals::groundSolver = GroundSolver::VE;
} else if (value == "bp") { } else if (value == "bp") {
Globals::groundSolver = GroundSolvers::BP; Globals::groundSolver = GroundSolver::BP;
} else if (value == "cbp") { } else if (value == "cbp") {
Globals::groundSolver = GroundSolvers::CBP; Globals::groundSolver = GroundSolver::CBP;
} else { } else {
cerr << "warning: invalid value `" << value << "' " ; cerr << "warning: invalid value `" << value << "' " ;
cerr << "for `" << key << "'" << endl; cerr << "for `" << key << "'" << endl;