aGrUM  0.16.0
DBRowGeneratorWithBN.h
Go to the documentation of this file.
1 
29 #ifndef GUM_LEARNING_DBROW_GENERATOR_WITH_BN_H
30 #define GUM_LEARNING_DBROW_GENERATOR_WITH_BN_H
31 
32 #include <vector>
33 
34 #include <agrum/agrum.h>
35 #include <agrum/core/bijection.h>
36 #include <agrum/BN/BayesNet.h>
39 
40 namespace gum {
41 
42  namespace learning {
43 
81  template < typename GUM_SCALAR = double,
82  template < typename > class ALLOC = std::allocator >
83  class DBRowGeneratorWithBN : public DBRowGenerator< ALLOC > {
84  public:
86  using allocator_type = ALLOC< DBTranslatedValue >;
87 
88  // ##########################################################################
90  // ##########################################################################
91 
93 
96  const std::vector< DBTranslatedValueType, ALLOC< DBTranslatedValueType > >
97  column_types,
98  const BayesNet< GUM_SCALAR >& bn,
100  const Bijection< NodeId, std::size_t, ALLOC< std::size_t > >&
101  nodeId2columns =
102  Bijection< NodeId, std::size_t, ALLOC< std::size_t > >(),
103  const allocator_type& alloc = allocator_type());
104 
107 
110  const allocator_type& alloc);
111 
114 
117  const allocator_type& alloc);
118 
121 
123 
124 
125  // ##########################################################################
127  // ##########################################################################
128 
130 
132  virtual void setBayesNet(const BayesNet< GUM_SCALAR >& new_bn);
133 
135  const BayesNet< GUM_SCALAR >& getBayesNet() const;
136 
139 
141 
142 
143  protected:
146 
149 
150 
154 
158  };
159 
160  } /* namespace learning */
161 
162 } /* namespace gum */
163 
164 
165 // always include the template implementation
167 
168 #endif /* GUM_LEARNING_DBROW_GENERATOR_WITH_BN_H */
ALLOC< DBTranslatedValue > allocator_type
type for the allocators passed in arguments of methods
Class representing a Bayesian Network.
Definition: BayesNet.h:78
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
DBRowGeneratorGoal
the type of things that a DBRowGenerator is designed for
const BayesNet< GUM_SCALAR > * _bn
the Bayesian network used to fill the unobserved values
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
DBRowGeneratorGoal goal() const
returns the goal of the DBRowGenerator
DBTranslatedValueType
The nature of the elements handled by translators (discrete, continuous).
Base class for DBRowGenerator classes that use a BN for computing their outputs.
DBRowGeneratorWithBN< GUM_SCALAR, ALLOC > & operator=(const DBRowGeneratorWithBN< GUM_SCALAR, ALLOC > &from)
copy operator
Bijection< NodeId, std::size_t, ALLOC< std::size_t > > _nodeId2columns
the mapping betwen the BN&#39;s node ids and the database&#39;s columns
Set of pairs of elements with fast search for both elements.
Definition: bijection.h:1805
allocator_type getAllocator() const
returns the allocator used
virtual void setBayesNet(const BayesNet< GUM_SCALAR > &new_bn)
assign a new Bayes net to the generator
DBRowGeneratorWithBN(const std::vector< DBTranslatedValueType, ALLOC< DBTranslatedValueType > > column_types, const BayesNet< GUM_SCALAR > &bn, const DBRowGeneratorGoal goal, const Bijection< NodeId, std::size_t, ALLOC< std::size_t > > &nodeId2columns=Bijection< NodeId, std::size_t, ALLOC< std::size_t > >(), const allocator_type &alloc=allocator_type())
default constructor
const BayesNet< GUM_SCALAR > & getBayesNet() const
returns the Bayes net used by the generator
ALLOC< DBTranslatedValue > allocator_type
type for the allocators passed in arguments of methods
The base class for all DBRow generators.
Size NodeId
Type for node ids.
Definition: graphElements.h:98
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.