aGrUM  0.14.2
scheduleCombination.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  ***************************************************************************/
74 #ifndef GUM_SCHEDULE_COMBINATION_H
75 #define GUM_SCHEDULE_COMBINATION_H
76 
77 #include <agrum/core/set.h>
81 #include <utility>
82 
83 namespace gum {
84 
85  template < typename GUM_SCALAR >
87  public:
88  // ############################################################################
90  // ############################################################################
92 
95 
98 
100  virtual ~ScheduleCombination();
101 
103 
105  virtual ScheduleCombination< GUM_SCALAR >* newFactory() const = 0;
106 
108 
109  // ############################################################################
111  // ############################################################################
113 
114  // adds operations to an already created schedule
119  combine(const Set< const ScheduleMultiDim< GUM_SCALAR >* >& set,
120  Schedule< GUM_SCALAR >& schedule) = 0;
122  combine(const Set< const MultiDimImplementation< GUM_SCALAR >* >& set,
123  Schedule< GUM_SCALAR >& schedule);
124  template < template < typename > class TABLE >
126  combine(const Set< const TABLE< GUM_SCALAR >* >& set,
127  Schedule< GUM_SCALAR >& schedule);
128 
131  *combine)(const MultiDimImplementation< GUM_SCALAR >&,
133 
138 
141  virtual float
142  nbOperations(const Set< const ScheduleMultiDim< GUM_SCALAR >* >& set,
143  const Schedule< GUM_SCALAR >& schedule) = 0;
144  float
146  const Schedule< GUM_SCALAR >& schedule);
147  template < template < typename > class TABLE >
148  float nbOperations(const Set< const TABLE< GUM_SCALAR >* >& set,
149  const Schedule< GUM_SCALAR >& schedule);
150 
152 
160  virtual std::pair< long, long >
161  memoryUsage(const Set< const ScheduleMultiDim< GUM_SCALAR >* >& set,
162  const Schedule< GUM_SCALAR >& schedule) = 0;
163  std::pair< long, long >
165  const Schedule< GUM_SCALAR >& schedule);
166  template < template < typename > class TABLE >
167  std::pair< long, long >
168  memoryUsage(const Set< const TABLE< GUM_SCALAR >* >& set,
169  const Schedule< GUM_SCALAR >& schedule);
170 
172 
173  private:
177  };
178 
179 } /* namespace gum */
180 
181 // always include the template implementation
183 
184 #endif /* GUM_SCHEDULE_COMBINATION_H */
virtual float nbOperations(const Set< const ScheduleMultiDim< GUM_SCALAR > * > &set, const Schedule< GUM_SCALAR > &schedule)=0
returns a rough estimate of the number of operations that will be performed to compute the combinatio...
ScheduleCombination()
default constructor
a MultiDimImplementation Wrapper used for scheduling inferences
a MultiDimImplementation Wrapper used for scheduling inferences
Sets of elements (i.e.
virtual std::pair< long, long > memoryUsage(const Set< const ScheduleMultiDim< GUM_SCALAR > * > &set, const Schedule< GUM_SCALAR > &schedule)=0
returns the memory consumption used during the combination
ScheduleCombination< GUM_SCALAR > & operator=(const ScheduleCombination< GUM_SCALAR > &)
forbid copy operators
virtual ScheduleMultiDim< GUM_SCALAR > combine(const Set< const ScheduleMultiDim< GUM_SCALAR > * > &set, Schedule< GUM_SCALAR > &schedule)=0
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
Headers of gum::MultiDimImplementation.
virtual void setCombineFunction(MultiDimImplementation< GUM_SCALAR > *(*combine)(const MultiDimImplementation< GUM_SCALAR > &, const MultiDimImplementation< GUM_SCALAR > &))=0
changes the function used for combining two TABLES
virtual ScheduleCombination< GUM_SCALAR > * newFactory() const =0
virtual constructor
virtual ~ScheduleCombination()
destructor
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:162
Class containing a schedule of operations to perform on multidims.
Class containing a schedule of operations to perform on multidims.
Definition: schedule.h:65
<agrum/multidim/multiDimImplementation.h>
virtual MultiDimImplementation< GUM_SCALAR > *(*)(const MultiDimImplementation< GUM_SCALAR > &, const MultiDimImplementation< GUM_SCALAR > &) combineFunction()
returns the combination function currently used by the combinator
A generic class to combine efficiently several ScheduleMultiDims.