1 #ifndef OPENGM_LIBDAI_JUNCTION_TREE_HXX
2 #define OPENGM_LIBDAI_JUNCTION_TREE_HXX
25 template<
class GM,
class ACC>
28 typedef ACC AccumulationType;
29 typedef GM GraphicalModelType;
45 std::string name()
const {
46 return "libDAI-Junction-Tree";
51 UpdateRule updateRule= HUGIN,
52 Heuristic heuristic=MINWEIGHT,
54 ) :updateRule_(updateRule),
55 heuristic_(heuristic),
58 std::string toString()
const{
62 if(updateRule_==HUGIN)ur =
"HUGIN";
63 else if(updateRule_==SHSH)ur =
"SHSH";
65 if(heuristic_==MINFILL)hr=
"MINFILL";
66 else if(heuristic_==WEIGHTEDMINFILL)hr =
"WEIGHTEDMINFILL";
67 else if(heuristic_==MINWEIGHT)hr =
"MINWEIGHT";
68 else if(heuristic_==MINNEIGHBORS)hr =
"MINNEIGHBORS";
72 <<
"heuristic="<<hr<<
","
73 <<
"inference="<< std::string(::opengm::meta::Compare<ACC,::opengm::Integrator>::value==
true ? std::string(
"SUMPROD") : std::string(
"MAXPROD") ) <<
","
74 <<
"verbose="<<verbose_<<
"]";
77 UpdateRule updateRule_;
81 JunctionTree(
const GM & gm,
const Parameter param=Parameter())
86 virtual const GraphicalModelType& graphicalModel()
const{
87 return this->graphicalModel_impl();
91 return this->reset_impl();
95 return this->infer_impl();
98 template<
class VISITOR>
100 visitor.begin(*
this);
107 return this->arg_impl(v,argnr);
110 return this->marginal_impl(v,m);
113 return this->factorMarginal_impl(f,m);
124 #endif // OPENGM_LIBDAI_JUNCTION_TREE_HXX
Inference algorithm interface.
#define OPENGM_GM_TYPE_TYPEDEFS