aGrUM  0.14.2
scheduleCombinationBasic.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_BASIC_H
75 #define GUM_SCHEDULE_COMBINATION_BASIC_H
76 
77 #include <agrum/agrum.h>
78 
80 #include <agrum/core/sequence.h>
83 
84 namespace gum {
85 
86  template < typename GUM_SCALAR >
87  class ScheduleCombinationBasic : public ScheduleCombination< GUM_SCALAR > {
88  public:
89  // ############################################################################
91  // ############################################################################
93 
98 
101 
103  virtual ~ScheduleCombinationBasic();
104 
106 
109 
111 
112  // ############################################################################
114  // ############################################################################
116 
117  // adds to a given schedule the operations necessary to perform a
118  // combination
123  combine(const Set< const ScheduleMultiDim< GUM_SCALAR >* >& set,
126  combine(const Set< const MultiDimImplementation< GUM_SCALAR >* >& set,
128  template < template < typename > class TABLE >
130  combine(const Set< const TABLE< GUM_SCALAR >* >& set,
132 
135  *combine)(const MultiDimImplementation< GUM_SCALAR >&,
137 
142 
145  virtual float
146  nbOperations(const Set< const ScheduleMultiDim< GUM_SCALAR >* >& set,
147  const Schedule< GUM_SCALAR >& schedule);
148  float
150  const Schedule< GUM_SCALAR >& schedule);
151  template < template < typename > class TABLE >
152  float nbOperations(const Set< const TABLE< GUM_SCALAR >* >& set,
153  const Schedule< GUM_SCALAR >& schedule);
154 
156 
164  virtual std::pair< long, long >
165  memoryUsage(const Set< const ScheduleMultiDim< GUM_SCALAR >* >& set,
166  const Schedule< GUM_SCALAR >& schedule);
167  std::pair< long, long >
169  const Schedule< GUM_SCALAR >& schedule);
170  template < template < typename > class TABLE >
171  std::pair< long, long >
172  memoryUsage(const Set< const TABLE< GUM_SCALAR >* >& set,
173  const Schedule< GUM_SCALAR >& schedule);
174 
176 
177  protected:
182 
186  const Sequence< const DiscreteVariable* >& seq2) const;
187  };
188 
189 } /* namespace gum */
190 
191 // always include the template implementation
193 
194 #endif /* GUM_SCHEDULE_COMBINATION_BASIC_H */
A class to combine efficiently several ScheduleMultiDims.
Base class for discrete random variable.
Header file of gum::Sequence, a class for storing (ordered) sequences of objects. ...
a MultiDimImplementation Wrapper used for scheduling inferences
virtual ~ScheduleCombinationBasic()
destructor
virtual float nbOperations(const Set< const ScheduleMultiDim< GUM_SCALAR > * > &set, const Schedule< GUM_SCALAR > &schedule)
returns a rough estimate of the number of operations that will be performed to compute the combinatio...
The generic class for storing (ordered) sequences of objects.
Definition: sequence.h:1019
Size _combinedSize(const Sequence< const DiscreteVariable * > &seq1, const Sequence< const DiscreteVariable * > &seq2) const
returns the domain size of the Cartesian product of the union of all the variables in seq1 and seq2 ...
virtual ScheduleCombinationBasic< GUM_SCALAR > * newFactory() const
virtual constructor
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
virtual MultiDimImplementation< GUM_SCALAR > *(*)(const MultiDimImplementation< GUM_SCALAR > &, const MultiDimImplementation< GUM_SCALAR > &) combineFunction()
returns the combination function currently used by the combinator
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:162
virtual std::pair< long, long > memoryUsage(const Set< const ScheduleMultiDim< GUM_SCALAR > * > &set, const Schedule< GUM_SCALAR > &schedule)
returns the memory consumption used during the combination
ScheduleCombinationBasic(MultiDimImplementation< GUM_SCALAR > *(*combine)(const MultiDimImplementation< GUM_SCALAR > &, const MultiDimImplementation< GUM_SCALAR > &))
default constructor
virtual ScheduleMultiDim< GUM_SCALAR > combine(const Set< const ScheduleMultiDim< GUM_SCALAR > * > &set, Schedule< GUM_SCALAR > &)
priority queues (in which an element cannot appear more than once)
virtual void setCombineFunction(MultiDimImplementation< GUM_SCALAR > *(*combine)(const MultiDimImplementation< GUM_SCALAR > &, const MultiDimImplementation< GUM_SCALAR > &))
changes the function used for combining two TABLES
Class containing a schedule of operations to perform on multidims.
Definition: schedule.h:65
<agrum/multidim/multiDimImplementation.h>
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:45
A generic interface to combine efficiently several ScheduleMultiDims.