aGrUM  0.14.2
multiDimCombineAndProject.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_H
27 #define GUM_MULTI_DIM_COMBINE_AND_PROJECT_H
28 
29 #include <utility>
30 
31 #include <agrum/core/sequence.h>
32 #include <agrum/core/set.h>
34 
35 namespace gum {
36 
37  // clang-format off
45  // clang-format on
46  template < typename GUM_SCALAR, template < typename > class TABLE >
48  public:
49  // ========================================================================
51  // ========================================================================
53 
56 
60 
63 
71 
73  // ========================================================================
75  // ========================================================================
77 
89  combineAndProject(Set< const TABLE< GUM_SCALAR >* > set,
90  Set< const DiscreteVariable* > del_vars) = 0;
91 
93  virtual void setCombineFunction(TABLE< GUM_SCALAR >* (*combine)(
94  const TABLE< GUM_SCALAR >&, const TABLE< GUM_SCALAR >&)) = 0;
95 
97  virtual TABLE< GUM_SCALAR >* (*combineFunction())(
98  const TABLE< GUM_SCALAR >&, const TABLE< GUM_SCALAR >&) = 0;
99 
101  virtual void setProjectFunction(TABLE< GUM_SCALAR >* (*proj)(
102  const TABLE< GUM_SCALAR >&, const Set< const DiscreteVariable* >&)) = 0;
103 
105  virtual TABLE< GUM_SCALAR >* (*projectFunction())(
106  const TABLE< GUM_SCALAR >&, const Set< const DiscreteVariable* >&) = 0;
107 
112  virtual float
113  nbOperations(const Set< const TABLE< GUM_SCALAR >* >& set,
114  const Set< const DiscreteVariable* >& del_vars) const = 0;
115  virtual std::pair< long, long >
117  Set< const DiscreteVariable* > del_vars) const = 0;
118 
120 
121  private:
125  };
126 
127 } /* namespace gum */
128 
129 // always include the template implementation
131 
132 #endif /* GUM_MULTI_DIM_COMBINE_AND_PROJECT_H */
virtual std::pair< long, long > memoryUsage(const Set< const Sequence< const DiscreteVariable * > * > &set, Set< const DiscreteVariable * > del_vars) const =0
creates and returns the result of the projection over the variables not in del_vars of the combinatio...
virtual TABLE< GUM_SCALAR > *(*)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &) combineFunction()
returns the current combination function
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 setProjectFunction(TABLE< GUM_SCALAR > *(*proj)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable * > &))=0
changes the function used for projecting TABLES
A generic interface to combine and project efficiently MultiDim tables.
The generic class for storing (ordered) sequences of objects.
Definition: sequence.h:1019
virtual void setCombineFunction(TABLE< GUM_SCALAR > *(*combine)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &))=0
changes the function used for combining two TABLES
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 TABLE< GUM_SCALAR > *(*)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable *> &) projectFunction()
returns the current projection function
virtual Set< const TABLE< GUM_SCALAR > *> combineAndProject(Set< const TABLE< GUM_SCALAR > * > set, Set< const DiscreteVariable * > del_vars)=0
creates and returns the result of the projection over the variables not in del_vars of the combinatio...
MultiDimCombineAndProject< GUM_SCALAR, TABLE > & operator=(const MultiDimCombineAndProject< GUM_SCALAR, TABLE > &)
forbid copy operators
virtual ~MultiDimCombineAndProject()
destructor
virtual MultiDimCombineAndProject< GUM_SCALAR, TABLE > * newFactory() const =0
virtual constructor
MultiDimCombineAndProject()
default constructor
virtual float nbOperations(const Set< const TABLE< GUM_SCALAR > * > &set, const Set< const DiscreteVariable * > &del_vars) const =0
returns a rough estimate of the number of operations that will be performed to compute the combinatio...
A generic interface to combine and project efficiently MultiDim tables.