aGrUM  0.14.2
scheduleMultiDim.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Pierre-Henri WUILLEMIN et Christophe GONZALES *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
25 #ifndef GUM_SCHEDULE_MULTI_DIM_H
26 #define GUM_SCHEDULE_MULTI_DIM_H
27 
28 #include <string>
29 
30 #include <agrum/agrum.h>
31 
32 #include <agrum/core/hashTable.h>
33 #include <agrum/core/sequence.h>
37 
38 namespace gum {
39 
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41  // we should grant ScheduleDeleteMultiDim the access to the hashtable actually
42  // containing the MultiDimImplementation: thus, when ScheduleDeleteMultiDim
43  // deletes an implementation, it can remove it from the hashtable and, thus,
44  // the ScheduleMultiDims pointing to it will become abstract.
45  template < typename GUM_SCALAR >
46  class ScheduleDeleteMultiDim;
47 #endif
48 
103  template < typename GUM_SCALAR >
105  public:
106  // ############################################################################
108  // ############################################################################
110 
113 
116 
118 
123 
126 
129 
131 
132  // ############################################################################
134  // ############################################################################
135 
137 
141 
143  bool operator==(const ScheduleMultiDim< GUM_SCALAR >&) const;
144 
146  bool operator!=(const ScheduleMultiDim< GUM_SCALAR >&) const;
147 
149 
150  // ############################################################################
152  // ############################################################################
154 
157 
163  bool isAbstract() const;
164 
172 
174  Idx id() const;
175 
178 
180  Size domainSize() const;
181 
183 
187 
189 
192 
194  std::string toString() const;
195 
197 
198  private:
200  friend class ScheduleDeleteMultiDim< GUM_SCALAR >;
201 
204 
206  static Idx __newId();
207 
210  __id2multidim();
211 
213 
216  __multidim2id();
217 
220 
223  __id2vars();
224 
227  };
228 
229 } /* namespace gum */
230 
231 // always include the template implementation
233 
234 #endif /* GUM_SCHEDULE_MULTI_DIM_H */
const Sequence< const DiscreteVariable *> & variablesSequence() const
returns the set of variables involved in the multidim
static HashTable< const MultiDimImplementation< GUM_SCALAR > *, Idx > & __multidim2id()
returns the id corresponding to a given multidim
Base class for discrete random variable.
Header file of gum::Sequence, a class for storing (ordered) sequences of objects. ...
ScheduleMultiDim(const MultiDimImplementation< GUM_SCALAR > &)
constructs a ScheduleMultiDim containing an already built implementation
a MultiDimImplementation Wrapper used for scheduling inferences
std::string toString() const
displays the content of the multidim
bool isAbstract() const
returns whether the ScheduleMultiDim contains a real multiDimImplementation
Idx id() const
returns the id of the ScheduleMultiDim
The generic class for storing (ordered) sequences of objects.
Definition: sequence.h:1019
Size domainSize() const
returns the domain size of the multidim
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
Headers of gum::MultiDimImplementation.
The class for generic Hash Tables.
Definition: hashTable.h:676
bool operator!=(const ScheduleMultiDim< GUM_SCALAR > &) const
checks whether two ScheduleMultiDim are related to different tables
ScheduleMultiDim< GUM_SCALAR > & operator=(const ScheduleMultiDim< GUM_SCALAR > &)
copy operator
~ScheduleMultiDim()
destructor
Headers for MultiDimDecorator.
const MultiDimImplementation< GUM_SCALAR > & multiDim() const
returns the multiDimImplementation actually contained in the ScheduleMultiDim
static HashTable< Idx, const Sequence< const DiscreteVariable *> *> & __id2vars()
returns a table with the variables of the table corresponding to id
Decorator design pattern in order to separate implementations from multidimensional matrix concepts...
static HashTable< Idx, Idx > & __id2refs()
returns a table indicating how many ScheduleMultiDim have the same id
a MultiDimImplementation Wrapper used for scheduling inferences
static Idx __newId()
returns a new distinct ID for each abtract scheduleMultiDim
static HashTable< Idx, Size > & __id2size()
returns a table with the domain size of the table corresponding to id
<agrum/multidim/multiDimImplementation.h>
Size Idx
Type for indexes.
Definition: types.h:50
Idx __id
the unique Id of the ScheduleMultiDim
static HashTable< Idx, const MultiDimImplementation< GUM_SCALAR > *> & __id2multidim()
returns a mapping from id to multidimImplementations
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:45
void setMultiDim(const MultiDimImplementation< GUM_SCALAR > &)
sets a new multiDimImplementation inside the wrapper
bool operator==(const ScheduleMultiDim< GUM_SCALAR > &) const
checks whether two ScheduleMultiDim are related to the same table
Class hash tables iterators.