From c2297c3f704679fee1d6c1235988366a463bda83 Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Thu, 31 May 2012 12:45:09 +0100 Subject: [PATCH] add lbp flag --- packages/CLPBN/clpbn/horus.yap | 12 +++++------- packages/CLPBN/horus/Util.cpp | 12 +++++++++++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/packages/CLPBN/clpbn/horus.yap b/packages/CLPBN/clpbn/horus.yap index 9ce8c4ceb..36cac593e 100644 --- a/packages/CLPBN/clpbn/horus.yap +++ b/packages/CLPBN/clpbn/horus.yap @@ -39,18 +39,16 @@ warning :- set_solver(ve) :- set_pfl_flag(solver,ve). set_solver(jt) :- set_pfl_flag(solver,jt). set_solver(gibbs) :- set_pfl_flag(solver,gibbs). -set_solver(fove) :- set_pfl_flag(solver,fove). -set_solver(hve) :- set_pfl_flag(solver,bp), cpp_set_horus_flag(inf_alg, ve). -set_solver(bp) :- set_pfl_flag(solver,bp), cpp_set_horus_flag(inf_alg, bp). -set_solver(cbp) :- set_pfl_flag(solver,bp), cpp_set_horus_flag(inf_alg, cbp). +set_solver(fove) :- set_pfl_flag(solver,fove), set_horus_flag(lifted_solver, fove). +set_solver(lbp) :- set_pfl_flag(solver,fove), set_horus_flag(lifted_solver, lbp). +set_solver(hve) :- set_pfl_flag(solver,bp), set_horus_flag(ground_solver, ve). +set_solver(bp) :- set_pfl_flag(solver,bp), set_horus_flag(ground_solver, bp). +set_solver(cbp) :- set_pfl_flag(solver,bp), set_horus_flag(ground_solver, cbp). set_solver(S) :- throw(error('unknow solver ', S)). set_horus_flag(K,V) :- cpp_set_horus_flag(K,V). -%:- cpp_set_horus_flag(inf_alg, ve). -%:- cpp_set_horus_flag(inf_alg, bp). -%: -cpp_set_horus_flag(inf_alg, cbp). :- cpp_set_horus_flag(schedule, seq_fixed). %:- cpp_set_horus_flag(schedule, seq_random). diff --git a/packages/CLPBN/horus/Util.cpp b/packages/CLPBN/horus/Util.cpp index 072d004b8..0c8b99f2f 100644 --- a/packages/CLPBN/horus/Util.cpp +++ b/packages/CLPBN/horus/Util.cpp @@ -209,7 +209,17 @@ setHorusFlag (string key, string value) stringstream ss; ss << value; ss >> Globals::verbosity; - } else if (key == "inf_alg") { + } else if (key == "lifted_solver") { + if ( value == "fove") { + Globals::liftedSolver = LiftedSolvers::FOVE; + } else if (value == "lbp") { + Globals::liftedSolver = LiftedSolvers::LBP; + } else { + cerr << "warning: invalid value `" << value << "' " ; + cerr << "for `" << key << "'" << endl; + returnVal = false; + } + } else if (key == "ground_solver") { if ( value == "ve") { Globals::groundSolver = GroundSolvers::VE; } else if (value == "bp") {