#include <dai/clustergraph.h>
#include <dai/weightedgraph.h>
#include <dai/enum.h>
+#include <dai/properties.h>
namespace dai {
std::vector<std::vector<Factor> > _mes;
double _logZ;
-
public:
- ENUM2(UpdateType,HUGIN,SHSH)
- UpdateType Updates() const { return GetPropertyAs<UpdateType>("updates"); }
+ struct Properties {
+ size_t verbose;
+ ENUM2(UpdateType,HUGIN,SHSH)
+ UpdateType updates;
+ } props;
- JTree() : DAIAlgRG(), _RTree(), _Qa(), _Qb(), _mes(), _logZ() {};
- JTree( const JTree& x ) : DAIAlgRG(x), _RTree(x._RTree), _Qa(x._Qa), _Qb(x._Qb), _mes(x._mes), _logZ(x._logZ) {};
+ public:
+ JTree() : DAIAlgRG(), _RTree(), _Qa(), _Qb(), _mes(), _logZ(), props() {}
+ JTree( const JTree& x ) : DAIAlgRG(x), _RTree(x._RTree), _Qa(x._Qa), _Qb(x._Qb), _mes(x._mes), _logZ(x._logZ), props(x.props) {}
JTree* clone() const { return new JTree(*this); }
JTree & operator=( const JTree& x ) {
if( this != &x ) {
_Qb = x._Qb;
_mes = x._mes;
_logZ = x._logZ;
+ props = x.props;
}
return *this;
}
- JTree( const FactorGraph &fg, const Properties &opts, bool automatic=true );
+ JTree( const FactorGraph &fg, const PropertySet &opts, bool automatic=true );
void GenerateJT( const std::vector<VarSet> &Cliques );
Factor & message( size_t alpha, size_t _beta ) { return _mes[alpha][_beta]; }
static const char *Name;
std::string identify() const;
- void init() { assert( checkProperties() ); }
+ void init() {}
void runHUGIN();
void runShaferShenoy();
double run();
size_t findEfficientTree( const VarSet& ns, DEdgeVec &Tree, size_t PreviousRoot=(size_t)-1 ) const;
Factor calcMarginal( const VarSet& ns );
- bool checkProperties();
+ void setProperties( const PropertySet &opts );
+ PropertySet getProperties() const;
+ double maxDiff() const { return 0.0; }
};