aGrUM  0.16.0
scheduleMultiDim.h
Go to the documentation of this file.
1 
28 #ifndef GUM_SCHEDULE_MULTI_DIM_H
29 #define GUM_SCHEDULE_MULTI_DIM_H
30 
31 #include <string>
32 
33 #include <agrum/agrum.h>
34 
35 #include <agrum/core/hashTable.h>
36 #include <agrum/core/sequence.h>
40 
41 namespace gum {
42 
43 #ifndef DOXYGEN_SHOULD_SKIP_THIS
44  // we should grant ScheduleDeleteMultiDim the access to the hashtable actually
45  // containing the MultiDimImplementation: thus, when ScheduleDeleteMultiDim
46  // deletes an implementation, it can remove it from the hashtable and, thus,
47  // the ScheduleMultiDims pointing to it will become abstract.
48  template < typename GUM_SCALAR >
49  class ScheduleDeleteMultiDim;
50 #endif
51 
106  template < typename GUM_SCALAR >
108  public:
109  // ############################################################################
111  // ############################################################################
113 
116 
119 
121 
126 
129 
132 
134 
135  // ############################################################################
137  // ############################################################################
138 
140 
144 
146  bool operator==(const ScheduleMultiDim< GUM_SCALAR >&) const;
147 
149  bool operator!=(const ScheduleMultiDim< GUM_SCALAR >&) const;
150 
152 
153  // ############################################################################
155  // ############################################################################
157 
160 
166  bool isAbstract() const;
167 
175 
177  Idx id() const;
178 
181 
183  Size domainSize() const;
184 
186 
190 
192 
195 
197  std::string toString() const;
198 
200 
201  private:
203  friend class ScheduleDeleteMultiDim< GUM_SCALAR >;
204 
207 
209  static Idx __newId();
210 
213  __id2multidim();
214 
216 
219  __multidim2id();
220 
223 
226  __id2vars();
227 
230  };
231 
232 } /* namespace gum */
233 
234 // always include the template implementation
236 
237 #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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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:1022
Size domainSize() const
returns the domain size of the multidim
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
The class for generic Hash Tables.
Definition: hashTable.h:679
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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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:53
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:48
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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.