aGrUM  0.16.0
CNMonteCarloSampling.h
Go to the documentation of this file.
1 
30 #ifndef __CN_MC_SAMPLING__H__
31 #define __CN_MC_SAMPLING__H__
32 
34 #include <limits>
35 
37 
38 namespace gum {
39  namespace credal {
40 
60  template < typename GUM_SCALAR,
61  class BNInferenceEngine = LazyPropagation< GUM_SCALAR > >
63  : public MultipleInferenceEngine< GUM_SCALAR, BNInferenceEngine > {
64  private:
69 
72 
75  void __mcThreadDataCopy();
77 
80 
81  inline void __verticesSampling();
82 
84  inline void __insertEvidence();
85 
88  inline void __threadInference();
89 
91  inline void __threadUpdate();
92 
100  inline void __binaryRep(std::vector< bool >& toFill, const Idx value) const;
101 
103 
104  protected:
105  public:
108 
114  virtual ~CNMonteCarloSampling();
116 
119 
121  void makeInference();
122 
124 
126 
127  virtual void insertEvidenceFile(const std::string& path) {
129  };
130 
131  protected:
132  bool _repetitiveInd;
133  };
134 
135 
136 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
138 
139  extern template class CNMonteCarloSampling< double,
141 #endif
142 
143 
144  } // namespace credal
145 } // namespace gum
146 
148 
149 #endif
void __mcThreadDataCopy()
Initialize threads data.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void __insertEvidence()
Insert CredalNet evidence into a thread BNInferenceEngine.
virtual void insertEvidenceFile(const std::string &path)
Insert evidence from file.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
void __threadInference()
Thread performs an inference using BNInferenceEngine.
CNMonteCarloSampling(const CredalNet< GUM_SCALAR > &credalNet)
Constructor.
Class template representing a Credal Network.
Definition: credalNet.h:89
void __threadUpdate()
Update thread data after a IBayesNet inference.
void makeInference()
Starts the inference.
void __mcInitApproximationScheme()
Initialize approximation Scheme.
void __verticesSampling()
Thread samples a IBayesNet from the CredalNet.
<agrum/CN/CNMonteCarloSampling.h>
const CredalNet< GUM_SCALAR > & credalNet()
Get this creadal network.
<agrum/BN/inference/lazyPropagation.h>
virtual void insertEvidenceFile(const std::string &path)
unsigned int notOptDelete;
Size Idx
Type for indexes.
Definition: types.h:53
Class template representing a CredalNet inference engine using one or more IBayesNet inference engine...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void __binaryRep(std::vector< bool > &toFill, const Idx value) const
Get the binary representation of a given value.