#include <dai/clustergraph.h>
#include <dai/weightedgraph.h>
#include <dai/jtree.h>
+#include <dai/properties.h>
#include <dai/enum.h>
std::map<size_t, TreeEPSubTree> _Q;
public:
- ENUM2(TypeType,ORG,ALT)
- TypeType Type() const { return GetPropertyAs<TypeType>("type"); }
-
- TreeEP() : JTree(), _Q() {};
- TreeEP( const TreeEP& x ) : JTree(x), _Q(x._Q) {
+ struct Properties {
+ size_t verbose;
+ size_t maxiter;
+ double tol;
+ ENUM2(TypeType,ORG,ALT)
+ TypeType type;
+ } props;
+ double maxdiff;
+
+ public:
+ /// Default constructor
+ TreeEP() : JTree(), _Q(), props(), maxdiff() {};
+ /// Copy constructor
+ TreeEP( const TreeEP& x ) : JTree(x), _Q(x._Q), props(x.props), maxdiff(x.maxdiff) {
for( size_t I = 0; I < nrFactors(); I++ )
if( offtree( I ) )
_Q[I].I() = &factor(I);
for( size_t I = 0; I < nrFactors(); I++ )
if( offtree( I ) )
_Q[I].I() = &factor(I);
+ props = x.props;
+ maxdiff = x.maxdiff;
}
return *this;
}
- TreeEP( const FactorGraph &fg, const Properties &opts );
+ TreeEP( const FactorGraph &fg, const PropertySet &opts );
void ConstructRG( const DEdgeVec &tree );
static const char *Name;
void init( const VarSet &/*ns*/ ) { init(); }
void undoProbs( const VarSet &ns ) { RegionGraph::undoProbs( ns ); init( ns ); }
- bool checkProperties();
+
+ void setProperties( const PropertySet &opts );
+ PropertySet getProperties() const;
+ double maxDiff() const { return maxdiff; }
};