aGrUM  0.16.0
multiDimCombinationDefault.h
Go to the documentation of this file.
1 
29 #ifndef GUM_MULTI_DIM_COMBINATION_DEFAULT_H
30 #define GUM_MULTI_DIM_COMBINATION_DEFAULT_H
31 
32 #include <agrum/core/sequence.h>
35 
36 namespace gum {
37 
38  // clang-format off
100  // clang-format on
101  template < typename GUM_SCALAR, template < typename > class TABLE >
103  : public MultiDimCombination< GUM_SCALAR, TABLE > {
104  public:
105  // ========================================================================
107  // ========================================================================
109 
117  MultiDimCombinationDefault(TABLE< GUM_SCALAR >* (*combine)(
118  const TABLE< GUM_SCALAR >&, const TABLE< GUM_SCALAR >&));
119 
123 
125  virtual ~MultiDimCombinationDefault();
126 
134 
136  // ========================================================================
138  // ========================================================================
140 
151  virtual TABLE< GUM_SCALAR >*
152  combine(const Set< const TABLE< GUM_SCALAR >* >& set);
153  virtual void combine(TABLE< GUM_SCALAR >& container,
154  const Set< const TABLE< GUM_SCALAR >* >& set);
155 
157  virtual void setCombineFunction(TABLE< GUM_SCALAR >* (*combine)(
158  const TABLE< GUM_SCALAR >&, const TABLE< GUM_SCALAR >&));
159 
161  virtual TABLE< GUM_SCALAR >* (*combineFunction())(const TABLE< GUM_SCALAR >&,
162  const TABLE< GUM_SCALAR >&);
163 
168  virtual float nbOperations(const Set< const TABLE< GUM_SCALAR >* >& set) const;
169  virtual float nbOperations(
170  const Set< const Sequence< const DiscreteVariable* >* >& set) const;
171 
183  virtual std::pair< long, long >
184  memoryUsage(const Set< const TABLE< GUM_SCALAR >* >& set) const;
185  virtual std::pair< long, long > memoryUsage(
186  const Set< const Sequence< const DiscreteVariable* >* >& set) const;
187 
189 
190  protected:
192  TABLE< GUM_SCALAR >* (*_combine)(const TABLE< GUM_SCALAR >& t1,
193  const TABLE< GUM_SCALAR >& t2);
194 
200  const Sequence< const DiscreteVariable* >& seq2) const;
201  };
202 
203 } /* namespace gum */
204 
205 // always include the template implementation
207 
208 #endif /* GUM_MULTI_DIM_COMBINATION_DEFAULT_H */
A class to combine efficiently several MultiDim tablesMultiDimCombinationDefault is a class designed ...
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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual std::pair< long, long > memoryUsage(const Set< const TABLE< GUM_SCALAR > * > &set) const
Returns the additional memory consumption used during the combination.
The generic class for storing (ordered) sequences of objects.
Definition: sequence.h:1022
virtual TABLE< GUM_SCALAR > *(*)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &) combineFunction()
Returns the combination function currently used by the combinator.
virtual void setCombineFunction(TABLE< GUM_SCALAR > *(*combine)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &))
Changes the function used for combining two TABLES.
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.
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:165
virtual float nbOperations(const Set< const TABLE< GUM_SCALAR > * > &set) const
returns a rough estimate of the number of operations that will be performed to compute the combinatio...
Size _combinedSize(const Sequence< const DiscreteVariable * > &seq1, const Sequence< const DiscreteVariable * > &seq2) const
returns the domain size of the Cartesian product of the union of all the variables in seq1 and seq2...
virtual MultiDimCombinationDefault< GUM_SCALAR, TABLE > * newFactory() const
virtual constructor
A generic interface to combine efficiently several MultiDim tables.
MultiDimCombinationDefault(TABLE< GUM_SCALAR > *(*combine)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &))
Default constructor.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
virtual ~MultiDimCombinationDefault()
Destructor.
virtual TABLE< GUM_SCALAR > * combine(const Set< const TABLE< GUM_SCALAR > * > &set)
Creates and returns the result of the combination of the tables within set.