aGrUM  0.14.2
multiDimCombineAndProjectDefault.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_COMBINE_AND_PROJECT_DEFAULT_H
27 #define GUM_MULTI_DIM_COMBINE_AND_PROJECT_DEFAULT_H
28 
32 
33 namespace gum {
34 
35  // clang-format off
43  // clang-format on
44  template < typename GUM_SCALAR, template < typename > class TABLE >
46  : public MultiDimCombineAndProject< GUM_SCALAR, TABLE > {
47  public:
48  // ========================================================================
50  // ========================================================================
52 
55  TABLE< GUM_SCALAR >* (*combine)(const TABLE< GUM_SCALAR >&,
56  const TABLE< GUM_SCALAR >&),
57  TABLE< GUM_SCALAR >* (*project)(const TABLE< GUM_SCALAR >&,
59 
63 
66 
74  newFactory() const;
75 
77  // ========================================================================
79  // ========================================================================
81 
93  combineAndProject(Set< const TABLE< GUM_SCALAR >* > set,
95 
97  virtual void setCombineFunction(TABLE< GUM_SCALAR >* (*combine)(
98  const TABLE< GUM_SCALAR >&, const TABLE< GUM_SCALAR >&));
99 
114  virtual void setCombinationClass(
115  const MultiDimCombination< GUM_SCALAR, TABLE >& comb_class);
116 
118  virtual TABLE< GUM_SCALAR >* (*combineFunction())(const TABLE< GUM_SCALAR >&,
119  const TABLE< GUM_SCALAR >&);
120 
122  virtual void setProjectFunction(TABLE< GUM_SCALAR >* (*proj)(
123  const TABLE< GUM_SCALAR >&, const Set< const DiscreteVariable* >&));
124 
131  virtual void setProjectionClass(
132  const MultiDimProjection< GUM_SCALAR, TABLE >& proj_class);
133 
135  virtual TABLE< GUM_SCALAR >* (*projectFunction())(
136  const TABLE< GUM_SCALAR >&, const Set< const DiscreteVariable* >&);
137 
142  virtual float
143  nbOperations(const Set< const TABLE< GUM_SCALAR >* >& set,
144  const Set< const DiscreteVariable* >& del_vars) const;
145 
150  virtual float
152  Set< const DiscreteVariable* > del_vars) const;
153 
167  virtual std::pair< long, long >
168  memoryUsage(const Set< const TABLE< GUM_SCALAR >* >& set,
169  const Set< const DiscreteVariable* >& del_vars) const;
170 
184  virtual std::pair< long, long >
186  Set< const DiscreteVariable* > del_vars) const;
187 
189 
190  private:
193 
196  };
197 
198 } /* namespace gum */
199 
200 // always include the template implementation
202 
203 #endif /* GUM_MULTI_DIM_COMBINE_AND_PROJECT_DEFAULT_H */
An efficient class for combining and projecting MultiDim tables.
virtual ~MultiDimCombineAndProjectDefault()
Destructor.
virtual void setCombineFunction(TABLE< GUM_SCALAR > *(*combine)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &))
changes the function used for combining two TABLES
A generic interface to combine and project efficiently MultiDim tables.
The generic class for storing (ordered) sequences of objects.
Definition: sequence.h:1019
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
MultiDimProjection< GUM_SCALAR, TABLE > * __projection
the class used for the projections
An efficient class for combining and projecting MultiDim tables.
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:162
virtual float nbOperations(const Set< const TABLE< GUM_SCALAR > * > &set, const Set< const DiscreteVariable * > &del_vars) const
returns a rough estimate of the number of operations that will be performed to compute the combinatio...
virtual TABLE< GUM_SCALAR > *(*)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &) combineFunction()
Returns the current combination function.
virtual TABLE< GUM_SCALAR > *(*)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable *> &) projectFunction()
returns the current projection function
virtual void setProjectionClass(const MultiDimProjection< GUM_SCALAR, TABLE > &proj_class)
Changes the class that performs the projections.
virtual void setCombinationClass(const MultiDimCombination< GUM_SCALAR, TABLE > &comb_class)
changes the class that performs the combinations
MultiDimCombination< GUM_SCALAR, TABLE > * __combination
the class used for the combinations
MultiDimCombineAndProjectDefault(TABLE< GUM_SCALAR > *(*combine)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &), TABLE< GUM_SCALAR > *(*project)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable * > &))
Default constructor.
A generic interface to combine efficiently several MultiDim tables.
A generic class to project efficiently a MultiDim table over a subset of its variables.
virtual MultiDimCombineAndProjectDefault< GUM_SCALAR, TABLE > * newFactory() const
virtual constructor
virtual std::pair< long, long > memoryUsage(const Set< const TABLE< GUM_SCALAR > * > &set, const Set< const DiscreteVariable * > &del_vars) const
returns the memory consumption used during the combinations and projections
virtual void setProjectFunction(TABLE< GUM_SCALAR > *(*proj)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable * > &))
Changes the function used for projecting TABLES.
virtual Set< const TABLE< GUM_SCALAR > *> combineAndProject(Set< const TABLE< GUM_SCALAR > * > set, Set< const DiscreteVariable * > del_vars)
creates and returns the result of the projection over the variables not in del_vars of the combinatio...