aGrUM  0.20.2
a C++ library for (probabilistic) graphical models
aprioriNoApriori_tpl.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright 2005-2020 Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
4  * info_at_agrum_dot_org
5  *
6  * This library is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 
22 /** @file
23  * @brief the no a priori class: corresponds to 0 weight-sample
24  *
25  * @author Christophe GONZALES(@AMU) and Pierre-Henri WUILLEMIN(@LIP6)
26  */
27 #ifndef DOXYGEN_SHOULD_SKIP_THIS
28 
29 namespace gum {
30 
31  namespace learning {
32 
33 
34  /// default constructor
35  template < template < typename > class ALLOC >
36  INLINE AprioriNoApriori< ALLOC >::AprioriNoApriori(
37  const DatabaseTable< ALLOC >& database,
38  const Bijection< NodeId, std::size_t, ALLOC< std::size_t > >&
40  const typename AprioriNoApriori< ALLOC >::allocator_type& alloc) :
42  Apriori< ALLOC >::setWeight(0.0);
44  }
45 
46 
47  /// copy constructor with a given allocator
48  template < template < typename > class ALLOC >
50  const AprioriNoApriori< ALLOC >& from,
51  const typename AprioriNoApriori< ALLOC >::allocator_type& alloc) :
52  Apriori< ALLOC >(from, alloc) {
54  }
55 
56 
57  /// copy constructor
58  template < template < typename > class ALLOC >
60  const AprioriNoApriori< ALLOC >& from) :
62 
63 
64  /// move constructor with a given allocator
65  template < template < typename > class ALLOC >
68  const typename AprioriNoApriori< ALLOC >::allocator_type& alloc) :
69  Apriori< ALLOC >(std::move(from), alloc) {
71  }
72 
73 
74  /// move constructor
75  template < template < typename > class ALLOC >
79 
80 
81  /// virtual copy constructor with a given allocator
82  template < template < typename > class ALLOC >
84  const typename AprioriNoApriori< ALLOC >::allocator_type& alloc) const {
87  try {
89  } catch (...) {
91  throw;
92  }
93 
94  return apriori;
95  }
96 
97 
98  /// virtual copy constructor
99  template < template < typename > class ALLOC >
101  return clone(this->getAllocator());
102  }
103 
104 
105  /// destructor
106  template < template < typename > class ALLOC >
109  }
110 
111 
112  /// copy operator
113  template < template < typename > class ALLOC >
115  const AprioriNoApriori< ALLOC >& from) {
116  Apriori< ALLOC >::operator=(from);
117  return *this;
118  }
119 
120 
121  /// move operator
122  template < template < typename > class ALLOC >
125  Apriori< ALLOC >::operator=(std::move(from));
126  return *this;
127  }
128 
129 
130  /// sets the weight of the a priori
131  template < template < typename > class ALLOC >
132  INLINE void AprioriNoApriori< ALLOC >::setWeight(const double) {}
133 
134 
135  /// indicates whether an apriori is of a certain type
136  template < template < typename > class ALLOC >
137  INLINE bool AprioriNoApriori< ALLOC >::isOfType(const std::string& type) {
139  }
140 
141 
142  /// returns the type of the apriori
143  template < template < typename > class ALLOC >
144  INLINE const std::string& AprioriNoApriori< ALLOC >::getType() const {
145  return AprioriNoAprioriType::type;
146  }
147 
148 
149  /// indicates whether the apriori is potentially informative
150  template < template < typename > class ALLOC >
151  INLINE bool AprioriNoApriori< ALLOC >::isInformative() const {
152  return false;
153  }
154 
155 
156  /// returns the apriori vector all the variables in the idset
157  template < template < typename > class ALLOC >
159  const IdCondSet< ALLOC >& idset,
160  std::vector< double, ALLOC< double > >& counts) {}
161 
162 
163  /// returns the apriori vector over only the conditioning set of an idset
164  template < template < typename > class ALLOC >
166  const IdCondSet< ALLOC >& idset,
167  std::vector< double, ALLOC< double > >& counts) {}
168 
169 
170  } /* namespace learning */
171 
172 } /* namespace gum */
173 
174 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:669
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)