22 #ifndef __MULTIPLE_INFERENCE_ENGINES__H__ 23 #define __MULTIPLE_INFERENCE_ENGINES__H__ 34 #include <agrum/BN/inference/lazyPropagation.h> 35 #include <agrum/CN/inference/inferenceEngine.h> 53 template <
typename GUM_SCALAR,
class BNInferenceEngine >
70 typedef typename std::vector<
88 const std::vector< GUM_SCALAR >& vertex,
89 const bool& elimRedund);
138 const bool storeVertices__,
139 const bool storeBNOpt__);
158 const std::vector< GUM_SCALAR >& vertex,
159 const bool& elimRedund =
false);
231 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 243 #include <agrum/CN/inference/multipleInferenceEngine_tpl.h>
expes__ l_expectationMax_
Threads upper expectations, one per thread.
credalSets__ l_marginalSets_
Threads vertices.
clusters__ l_clusters_
Threads clusters.
expes__ l_expectationMin_
Threads lower expectations, one per thread.
margis__ l_evidence_
Threads evidence.
modals__ l_modal_
Threads modalities.
IBayesNet< GUM_SCALAR > bnet__
INLINE void emplace(Args &&... args)
virtual void makeInference()=0
To be redefined by each credal net algorithm.
void initThreadsData_(const Size &num_threads, const bool storeVertices__, const bool storeBNOpt__)
Initialize threads data.
margis__ l_marginalMin_
Threads lower marginals, one per thread.
std::vector< margi__ > margis__
std::vector< credalSet__ > credalSets__
MultipleInferenceEngine(const CredalNet< GUM_SCALAR > &credalNet)
Constructor.
virtual void eraseAllEvidence()
Erase all inference related data to perform another one.
void updateThreadCredalSets__(const NodeId &id, const std::vector< GUM_SCALAR > &vertex, const bool &elimRedund)
Ask for redundancy elimination of a node credal set of a calling thread.
bool updateThread_(const NodeId &id, const std::vector< GUM_SCALAR > &vertex, const bool &elimRedund=false)
Update thread information (marginals, expectations, IBayesNet, vertices) for a given node id...
void expFusion_()
Fusion of threads expectations.
std::vector< expe__ > expes__
std::vector< VarMod2BNsMap< GUM_SCALAR > *> l_optimalNet_
Threads optimal IBayesNet.
void updateMarginals_()
Fusion of threads marginals.
void optFusion_()
Fusion of threads optimal IBayesNet.
const GUM_SCALAR computeEpsilon_()
Compute epsilon and update old marginals.
virtual ~MultipleInferenceEngine()
Destructor.
NodeProperty< GUM_SCALAR > expe__
void updateOldMarginals_()
Update old marginals (from current marginals).
InferenceEngine< GUM_SCALAR > infE__
To easily access InferenceEngine< GUM_SCALAR > methods.
margis__ l_marginalMax_
Threads upper marginals, one per thread.
namespace for all credal networks entities