aGrUM  0.16.0
multiDimProjection.h
Go to the documentation of this file.
1 
28 #ifndef GUM_MULTI_DIM_PROJECTION_H
29 #define GUM_MULTI_DIM_PROJECTION_H
30 
31 #include <utility>
32 
33 #include <agrum/core/sequence.h>
34 #include <agrum/core/set.h>
36 
37 namespace gum {
38 
39  // clang-format off
87  // clang-format on
88  template < typename GUM_SCALAR, template < typename > class TABLE >
90  public:
91  // ========================================================================
93  // ========================================================================
95 
97  MultiDimProjection(TABLE< GUM_SCALAR >* (*proj)(
98  const TABLE< GUM_SCALAR >&, const Set< const DiscreteVariable* >&));
99 
102 
104  virtual ~MultiDimProjection();
105 
113 
115  // ========================================================================
117  // ========================================================================
119 
131  TABLE< GUM_SCALAR >* project(const TABLE< GUM_SCALAR >& table,
132  const Set< const DiscreteVariable* >& del_vars);
133 
134  void project(TABLE< GUM_SCALAR >& container,
135  const TABLE< GUM_SCALAR >& table,
136  const Set< const TABLE< GUM_SCALAR >* >& del_vars);
137 
139  void setProjectFunction(TABLE< GUM_SCALAR >* (*proj)(
140  const TABLE< GUM_SCALAR >&, const Set< const DiscreteVariable* >&));
141 
143  TABLE< GUM_SCALAR >* (*projectFunction())(
144  const TABLE< GUM_SCALAR >&, const Set< const DiscreteVariable* >&);
145 
150  float nbOperations(const TABLE< GUM_SCALAR >& table,
151  const Set< const DiscreteVariable* >& del_vars) const;
152 
158  const Set< const DiscreteVariable* >& del_vars) const;
159 
172  std::pair< long, long >
173  memoryUsage(const TABLE< GUM_SCALAR >& table,
174  const Set< const DiscreteVariable* >& del_vars) const;
175 
188  std::pair< long, long >
190  const Set< const DiscreteVariable* >& del_vars) const;
191 
193 
194  protected:
196  TABLE< GUM_SCALAR >* (*_proj)(const TABLE< GUM_SCALAR >&,
198 
199  private:
203  };
204 
205 } /* namespace gum */
206 
207 // always include the template implementation
209 
210 #endif /* GUM_MULTI_DIM_PROJECTION_H */
TABLE< GUM_SCALAR > *(*)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable *> &) projectFunction()
Returns the projection function currently used by the projector.
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.
The generic class for storing (ordered) sequences of objects.
Definition: sequence.h:1022
MultiDimProjection(TABLE< GUM_SCALAR > *(*proj)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable * > &))
Default constructor.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:165
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::pair< long, long > memoryUsage(const TABLE< GUM_SCALAR > &table, const Set< const DiscreteVariable * > &del_vars) const
Returns the memory consumption used during the projection.
virtual MultiDimProjection< GUM_SCALAR, TABLE > * newFactory() const
virtual constructor
virtual ~MultiDimProjection()
Destructor.
MultiDimProjection< GUM_SCALAR, TABLE > & operator=(const MultiDimProjection< GUM_SCALAR, TABLE > &)
Forbid copy operators.
float nbOperations(const TABLE< GUM_SCALAR > &table, const Set< const DiscreteVariable * > &del_vars) const
returns a rough estimate of the number of operations that will be performed to compute the projection...
A generic class to project efficiently a MultiDim table over a subset of its variables.
void setProjectFunction(TABLE< GUM_SCALAR > *(*proj)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable * > &))
Changes the function used for projecting TABLES.
TABLE< GUM_SCALAR > * project(const TABLE< GUM_SCALAR > &table, const Set< const DiscreteVariable * > &del_vars)
Creates and returns the projection of the table over a subset of its vars.