aGrUM  0.16.0
DBRowGeneratorWithBN_tpl.h
Go to the documentation of this file.
1 
29 
30 #ifndef DOXYGEN_SHOULD_SKIP_THIS
31 
32 namespace gum {
33 
34  namespace learning {
35 
36 
38  template < typename GUM_SCALAR, template < typename > class ALLOC >
42  }
43 
44 
46  template < typename GUM_SCALAR, template < typename > class ALLOC >
48  const std::vector< DBTranslatedValueType, ALLOC< DBTranslatedValueType > >
49  column_types,
50  const BayesNet< GUM_SCALAR >& bn,
51  const DBRowGeneratorGoal goal,
52  const Bijection< NodeId, std::size_t, ALLOC< std::size_t > >&
53  nodeId2columns,
55  alloc) :
56  DBRowGenerator< ALLOC >(column_types, goal, alloc),
57  _bn(&bn), _nodeId2columns(nodeId2columns) {
58  GUM_CONSTRUCTOR(DBRowGeneratorWithBN);
59  }
60 
61 
63  template < typename GUM_SCALAR, template < typename > class ALLOC >
65  const DBRowGeneratorWithBN< GUM_SCALAR, ALLOC >& from,
67  alloc) :
68  DBRowGenerator< ALLOC >(from, alloc),
69  _bn(from._bn), _nodeId2columns(from._nodeId2columns) {
70  GUM_CONS_CPY(DBRowGeneratorWithBN);
71  }
72 
73 
75  template < typename GUM_SCALAR, template < typename > class ALLOC >
77  const DBRowGeneratorWithBN< GUM_SCALAR, ALLOC >& from) :
78  DBRowGeneratorWithBN< GUM_SCALAR, ALLOC >(from, from.getAllocator()) {}
79 
80 
82  template < typename GUM_SCALAR, template < typename > class ALLOC >
84  DBRowGeneratorWithBN< GUM_SCALAR, ALLOC >&& from,
86  alloc) :
87  DBRowGenerator< ALLOC >(std::move(from), alloc),
88  _bn(from._bn), _nodeId2columns(std::move(from._nodeId2columns)) {
89  GUM_CONS_MOV(DBRowGeneratorWithBN);
90  }
91 
92 
94  template < typename GUM_SCALAR, template < typename > class ALLOC >
96  DBRowGeneratorWithBN< GUM_SCALAR, ALLOC >&& from) :
97  DBRowGeneratorWithBN< GUM_SCALAR, ALLOC >(std::move(from),
98  from.getAllocator()) {}
99 
100 
102  template < typename GUM_SCALAR, template < typename > class ALLOC >
104  GUM_DESTRUCTOR(DBRowGeneratorWithBN);
105  }
106 
107 
109  template < typename GUM_SCALAR, template < typename > class ALLOC >
110  DBRowGeneratorWithBN< GUM_SCALAR, ALLOC >&
112  operator=(const DBRowGeneratorWithBN< GUM_SCALAR, ALLOC >& from) {
113  if (this != &from) {
115  _bn = from._bn;
116  _nodeId2columns = from._nodeId2columns;
117  }
118 
119  return *this;
120  }
121 
122 
124  template < typename GUM_SCALAR, template < typename > class ALLOC >
125  DBRowGeneratorWithBN< GUM_SCALAR, ALLOC >&
127  operator=(DBRowGeneratorWithBN< GUM_SCALAR, ALLOC >&& from) {
128  if (this != &from) {
129  DBRowGenerator< ALLOC >::operator=(std::move(from));
130  _bn = from._bn;
131  _nodeId2columns = std::move(from._nodeId2columns);
132  }
133 
134  return *this;
135  }
136 
137 
139  template < typename GUM_SCALAR, template < typename > class ALLOC >
141  const BayesNet< GUM_SCALAR >& new_bn) {
142  _bn = &new_bn;
143  }
144 
145 
147  template < typename GUM_SCALAR, template < typename > class ALLOC >
148  INLINE const BayesNet< GUM_SCALAR >&
150  return *_bn;
151  }
152 
153 
154  } /* namespace learning */
155 
156 } /* namespace gum */
157 
158 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
DBRowGeneratorGoal
the type of things that a DBRowGenerator is designed for
DBRowGenerator< ALLOC > & operator=(const DBRowGenerator< ALLOC > &)
copy constructor
const BayesNet< GUM_SCALAR > * _bn
the Bayesian network used to fill the unobserved values
STL namespace.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
DBTranslatedValueType
The nature of the elements handled by translators (discrete, continuous).
allocator_type getAllocator() const
returns the allocator used
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
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
DBRowGenerator(const std::vector< DBTranslatedValueType, ALLOC< DBTranslatedValueType > > column_types, const DBRowGeneratorGoal goal, 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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Size NodeId
Type for node ids.
Definition: graphElements.h:98