aGrUM  0.14.2
multiDimCombination.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  ***************************************************************************/
26 #ifndef GUM_MULTI_DIM_COMBINATION_H
27 #define GUM_MULTI_DIM_COMBINATION_H
28 
29 #include <agrum/core/sequence.h>
30 #include <agrum/core/set.h>
32 #include <utility>
33 
34 namespace gum {
35 
93  template < typename GUM_SCALAR, template < typename > class TABLE >
95  public:
96  // =========================================================================
98  // =========================================================================
100 
103 
106 
108  virtual ~MultiDimCombination();
109 
117 
119  // =========================================================================
121  // =========================================================================
123 
134  virtual TABLE< GUM_SCALAR >*
135  combine(const Set< const TABLE< GUM_SCALAR >* >& set) = 0;
136  virtual void combine(TABLE< GUM_SCALAR >& container,
137  const Set< const TABLE< GUM_SCALAR >* >& set) = 0;
138 
140  virtual void setCombineFunction(TABLE< GUM_SCALAR >* (*combine)(
141  const TABLE< GUM_SCALAR >&, const TABLE< GUM_SCALAR >&)) = 0;
142 
144  virtual TABLE< GUM_SCALAR >* (*combineFunction())(
145  const TABLE< GUM_SCALAR >&, const TABLE< GUM_SCALAR >&) = 0;
146 
151  virtual float
152  nbOperations(const Set< const TABLE< GUM_SCALAR >* >& set) const = 0;
153  virtual float nbOperations(
154  const Set< const Sequence< const DiscreteVariable* >* >& set) const = 0;
155 
168  virtual std::pair< long, long >
169  memoryUsage(const Set< const TABLE< GUM_SCALAR >* >& set) const = 0;
170  virtual std::pair< long, long > memoryUsage(
171  const Set< const Sequence< const DiscreteVariable* >* >& set) const = 0;
172 
173  private:
177 
179  };
180 
181 } /* namespace gum */
182 
183 // always include the template implementation
185 
186 #endif /* GUM_MULTI_DIM_COMBINATION_H */
virtual TABLE< GUM_SCALAR > * combine(const Set< const TABLE< GUM_SCALAR > * > &set)=0
creates and returns the result of the combination of the tables within set
Base class for discrete random variable.
Header file of gum::Sequence, a class for storing (ordered) sequences of objects. ...
Sets of elements (i.e.
virtual void setCombineFunction(TABLE< GUM_SCALAR > *(*combine)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &))=0
changes the function used for combining two TABLES
A generic class to combine efficiently several MultiDim tables.
The generic class for storing (ordered) sequences of objects.
Definition: sequence.h:1019
MultiDimCombination()
default constructor
virtual TABLE< GUM_SCALAR > *(*)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &) combineFunction()
returns the combination function currently used by the combinator
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:162
virtual std::pair< long, long > memoryUsage(const Set< const TABLE< GUM_SCALAR > * > &set) const =0
Returns the memory consumption used during the combination.
virtual MultiDimCombination< GUM_SCALAR, TABLE > * newFactory() const =0
virtual constructor
MultiDimCombination< GUM_SCALAR, TABLE > & operator=(const MultiDimCombination< GUM_SCALAR, TABLE > &)
forbid copy operators
virtual ~MultiDimCombination()
destructor
A generic interface to combine efficiently several MultiDim tables.
virtual float nbOperations(const Set< const TABLE< GUM_SCALAR > * > &set) const =0
returns a rough estimate of the number of operations that will be performed to compute the combinatio...