aGrUM  0.16.0
aprioriNoApriori_tpl.h
Go to the documentation of this file.
1 
28 #ifndef DOXYGEN_SHOULD_SKIP_THIS
29 
30 namespace gum {
31 
32  namespace learning {
33 
34 
36  template < template < typename > class ALLOC >
38  const DatabaseTable< ALLOC >& database,
39  const Bijection< NodeId, std::size_t, ALLOC< std::size_t > >&
40  nodeId2columns,
41  const typename AprioriNoApriori< ALLOC >::allocator_type& alloc) :
42  Apriori< ALLOC >(database, nodeId2columns, alloc) {
44  GUM_CONSTRUCTOR(AprioriNoApriori);
45  }
46 
47 
49  template < template < typename > class ALLOC >
51  const AprioriNoApriori< ALLOC >& from,
52  const typename AprioriNoApriori< ALLOC >::allocator_type& alloc) :
53  Apriori< ALLOC >(from, alloc) {
54  GUM_CONS_CPY(AprioriNoApriori);
55  }
56 
57 
59  template < template < typename > class ALLOC >
61  const AprioriNoApriori< ALLOC >& from) :
62  AprioriNoApriori< ALLOC >(from, from.getAllocator()) {}
63 
64 
66  template < template < typename > class ALLOC >
68  AprioriNoApriori< ALLOC >&& from,
69  const typename AprioriNoApriori< ALLOC >::allocator_type& alloc) :
70  Apriori< ALLOC >(std::move(from), alloc) {
71  GUM_CONS_MOV(AprioriNoApriori);
72  }
73 
74 
76  template < template < typename > class ALLOC >
78  AprioriNoApriori< ALLOC >&& from) :
79  AprioriNoApriori< ALLOC >(std::move(from), from.getAllocator()) {}
80 
81 
83  template < template < typename > class ALLOC >
84  AprioriNoApriori< ALLOC >* AprioriNoApriori< ALLOC >::clone(
85  const typename AprioriNoApriori< ALLOC >::allocator_type& alloc) const {
86  ALLOC< AprioriNoApriori< ALLOC > > allocator(alloc);
87  AprioriNoApriori< ALLOC >* apriori = allocator.allocate(1);
88  try {
89  allocator.construct(apriori, *this, alloc);
90  } catch (...) {
91  allocator.deallocate(apriori, 1);
92  throw;
93  }
94 
95  return apriori;
96  }
97 
98 
100  template < template < typename > class ALLOC >
101  INLINE AprioriNoApriori< ALLOC >* AprioriNoApriori< ALLOC >::clone() const {
102  return clone(this->getAllocator());
103  }
104 
105 
107  template < template < typename > class ALLOC >
109  GUM_DESTRUCTOR(AprioriNoApriori);
110  }
111 
112 
114  template < template < typename > class ALLOC >
115  INLINE AprioriNoApriori< ALLOC >& AprioriNoApriori< ALLOC >::
116  operator=(const AprioriNoApriori< ALLOC >& from) {
118  return *this;
119  }
120 
121 
123  template < template < typename > class ALLOC >
124  INLINE AprioriNoApriori< ALLOC >& AprioriNoApriori< ALLOC >::
125  operator=(AprioriNoApriori< ALLOC >&& from) {
126  Apriori< ALLOC >::operator=(std::move(from));
127  return *this;
128  }
129 
130 
132  template < template < typename > class ALLOC >
133  INLINE void AprioriNoApriori< ALLOC >::setWeight(const double) {}
134 
135 
137  template < template < typename > class ALLOC >
138  INLINE bool AprioriNoApriori< ALLOC >::isOfType(const std::string& type) {
139  return AprioriNoAprioriType::isOfType(type);
140  }
141 
142 
144  template < template < typename > class ALLOC >
145  INLINE const std::string& AprioriNoApriori< ALLOC >::getType() const {
147  }
148 
149 
151  template < template < typename > class ALLOC >
152  INLINE bool AprioriNoApriori< ALLOC >::isInformative() const {
153  return false;
154  }
155 
156 
158  template < template < typename > class ALLOC >
160  const IdSet< ALLOC >& idset,
161  std::vector< double, ALLOC< double > >& counts) {}
162 
163 
165  template < template < typename > class ALLOC >
167  const IdSet< ALLOC >& idset,
168  std::vector< double, ALLOC< double > >& counts) {}
169 
170 
171  } /* namespace learning */
172 
173 } /* namespace gum */
174 
175 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
AprioriNoApriori< ALLOC > & operator=(const AprioriNoApriori< ALLOC > &from)
copy operator
virtual bool isOfType(const std::string &type) final
indicates whether an apriori is of a certain type
virtual void setWeight(const double weight)
sets the weight of the a priori (kind of effective sample size)
AprioriNoApriori(const DatabaseTable< ALLOC > &database, 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
virtual const std::string & getType() const final
returns the type of the apriori
static const std::string type
Definition: aprioriTypes.h:48
static bool isOfType(const std::string &t)
Definition: aprioriTypes.h:49
virtual void addAllApriori(const IdSet< ALLOC > &idset, std::vector< double, ALLOC< double > > &counts) final
adds the apriori to a counting vector corresponding to the idset
STL namespace.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
AprioriNoAprioriType type
the type of the a priori
virtual bool isInformative() const final
indicates whether the apriori is potentially informative
virtual void setWeight(const double weight) final
sets the weight of the a priori (kind of effective sample size)
Apriori< ALLOC > & operator=(const Apriori< ALLOC > &from)
copy operator
allocator_type getAllocator() const
returns the allocator used by the internal apriori
virtual ~AprioriNoApriori()
destructor
virtual AprioriNoApriori< ALLOC > * clone() const
virtual copy constructor
ALLOC< NodeId > allocator_type
type for the allocators passed in arguments of methods
Size NodeId
Type for node ids.
Definition: graphElements.h:98
Apriori(const DatabaseTable< ALLOC > &database, 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
virtual void addConditioningApriori(const IdSet< ALLOC > &idset, std::vector< double, ALLOC< double > > &counts) final
adds the apriori to a counting vectordefined over the right hand side of the idset ...