aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
aprioriNoApriori_tpl.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright (c) 2005-2021 by 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,
39  const typename AprioriNoApriori< ALLOC >::allocator_type& alloc) :
41  Apriori< ALLOC >::setWeight(0.0);
43  }
44 
45 
46  /// copy constructor with a given allocator
47  template < template < typename > class ALLOC >
49  const AprioriNoApriori< ALLOC >& from,
50  const typename AprioriNoApriori< ALLOC >::allocator_type& alloc) :
51  Apriori< ALLOC >(from, alloc) {
53  }
54 
55 
56  /// copy constructor
57  template < template < typename > class ALLOC >
60 
61 
62  /// move constructor with a given allocator
63  template < template < typename > class ALLOC >
66  const typename AprioriNoApriori< ALLOC >::allocator_type& alloc) :
67  Apriori< ALLOC >(std::move(from), alloc) {
69  }
70 
71 
72  /// move constructor
73  template < template < typename > class ALLOC >
76 
77 
78  /// virtual copy constructor with a given allocator
79  template < template < typename > class ALLOC >
81  const typename AprioriNoApriori< ALLOC >::allocator_type& alloc) const {
84  try {
86  } catch (...) {
88  throw;
89  }
90 
91  return apriori;
92  }
93 
94 
95  /// virtual copy constructor
96  template < template < typename > class ALLOC >
98  return clone(this->getAllocator());
99  }
100 
101 
102  /// destructor
103  template < template < typename > class ALLOC >
106  }
107 
108 
109  /// copy operator
110  template < template < typename > class ALLOC >
113  Apriori< ALLOC >::operator=(from);
114  return *this;
115  }
116 
117 
118  /// move operator
119  template < template < typename > class ALLOC >
122  Apriori< ALLOC >::operator=(std::move(from));
123  return *this;
124  }
125 
126 
127  /// sets the weight of the a priori
128  template < template < typename > class ALLOC >
129  INLINE void AprioriNoApriori< ALLOC >::setWeight(const double) {}
130 
131 
132  /// indicates whether an apriori is of a certain type
133  template < template < typename > class ALLOC >
134  INLINE bool AprioriNoApriori< ALLOC >::isOfType(const std::string& type) {
136  }
137 
138 
139  /// returns the type of the apriori
140  template < template < typename > class ALLOC >
141  INLINE const std::string& AprioriNoApriori< ALLOC >::getType() const {
142  return AprioriNoAprioriType::type;
143  }
144 
145 
146  /// indicates whether the apriori is potentially informative
147  template < template < typename > class ALLOC >
148  INLINE bool AprioriNoApriori< ALLOC >::isInformative() const {
149  return false;
150  }
151 
152 
153  /// returns the apriori vector all the variables in the idset
154  template < template < typename > class ALLOC >
155  INLINE void
157  std::vector< double, ALLOC< double > >& counts) {}
158 
159 
160  /// returns the apriori vector over only the conditioning set of an idset
161  template < template < typename > class ALLOC >
163  const IdCondSet< ALLOC >& idset,
164  std::vector< double, ALLOC< double > >& counts) {}
165 
166 
167  } /* namespace learning */
168 
169 } /* namespace gum */
170 
171 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:643
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)