aGrUM  0.16.0
multiDimCombineAndProjectDefault.h
Go to the documentation of this file.
1 
29 #ifndef GUM_MULTI_DIM_COMBINE_AND_PROJECT_DEFAULT_H
30 #define GUM_MULTI_DIM_COMBINE_AND_PROJECT_DEFAULT_H
31 
35 
36 namespace gum {
37 
38  // clang-format off
46  // clang-format on
47  template < typename GUM_SCALAR, template < typename > class TABLE >
49  : public MultiDimCombineAndProject< GUM_SCALAR, TABLE > {
50  public:
51  // ========================================================================
53  // ========================================================================
55 
58  TABLE< GUM_SCALAR >* (*combine)(const TABLE< GUM_SCALAR >&,
59  const TABLE< GUM_SCALAR >&),
60  TABLE< GUM_SCALAR >* (*project)(const TABLE< GUM_SCALAR >&,
62 
66 
69 
77  newFactory() const;
78 
80  // ========================================================================
82  // ========================================================================
84 
96  combineAndProject(Set< const TABLE< GUM_SCALAR >* > set,
98 
100  virtual void setCombineFunction(TABLE< GUM_SCALAR >* (*combine)(
101  const TABLE< GUM_SCALAR >&, const TABLE< GUM_SCALAR >&));
102 
117  virtual void setCombinationClass(
118  const MultiDimCombination< GUM_SCALAR, TABLE >& comb_class);
119 
121  virtual TABLE< GUM_SCALAR >* (*combineFunction())(const TABLE< GUM_SCALAR >&,
122  const TABLE< GUM_SCALAR >&);
123 
125  virtual void setProjectFunction(TABLE< GUM_SCALAR >* (*proj)(
126  const TABLE< GUM_SCALAR >&, const Set< const DiscreteVariable* >&));
127 
134  virtual void setProjectionClass(
135  const MultiDimProjection< GUM_SCALAR, TABLE >& proj_class);
136 
138  virtual TABLE< GUM_SCALAR >* (*projectFunction())(
139  const TABLE< GUM_SCALAR >&, const Set< const DiscreteVariable* >&);
140 
145  virtual float
146  nbOperations(const Set< const TABLE< GUM_SCALAR >* >& set,
147  const Set< const DiscreteVariable* >& del_vars) const;
148 
153  virtual float
155  Set< const DiscreteVariable* > del_vars) const;
156 
170  virtual std::pair< long, long >
171  memoryUsage(const Set< const TABLE< GUM_SCALAR >* >& set,
172  const Set< const DiscreteVariable* >& del_vars) const;
173 
187  virtual std::pair< long, long >
189  Set< const DiscreteVariable* > del_vars) const;
190 
192 
193  private:
196 
199  };
200 
201 } /* namespace gum */
202 
203 // always include the template implementation
205 
206 #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:1022
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
MultiDimProjection< GUM_SCALAR, TABLE > * __projection
the class used for the projections
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 Set< const DiscreteVariable * > &del_vars) const
returns a rough estimate of the number of operations that will be performed to compute the combinatio...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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
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 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...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.