aGrUM  0.14.2
scheduler.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_SCHEDULER_H
27 #define GUM_SCHEDULER_H
28 
30 #include <utility>
31 
32 namespace gum {
33 
34  template < typename GUM_SCALAR >
35  class Scheduler {
36  public:
37  // ############################################################################
39  // ############################################################################
41 
43  Scheduler();
44 
47 
49  virtual ~Scheduler();
50 
52 
53  virtual Scheduler< GUM_SCALAR >* newFactory() const = 0;
54 
56 
57  // ############################################################################
59  // ############################################################################
61 
63 
64  virtual bool execute(Schedule< GUM_SCALAR >&) = 0;
65 
67 
71  virtual bool execute(Schedule< GUM_SCALAR >&, Size k) = 0;
72 
76  virtual float nbOperations(const Schedule< GUM_SCALAR >&) const = 0;
77 
84  virtual float nbOperations(const Schedule< GUM_SCALAR >&, Size k) const = 0;
85 
87 
94  virtual std::pair< long, long >
95  memoryUsage(const Schedule< GUM_SCALAR >&) const = 0;
96 
109  virtual std::pair< long, long > memoryUsage(const Schedule< GUM_SCALAR >&,
110  Size k) const = 0;
111 
113  };
114 
115 } /* namespace gum */
116 
117 // always include the template implementation
119 
120 #endif /* GUM_SCHEDULER_H */
virtual std::pair< long, long > memoryUsage(const Schedule< GUM_SCALAR > &) const =0
returns the memory consumption used during the execution of a schedule
virtual Scheduler< GUM_SCALAR > * newFactory() const =0
virtual constructor
virtual bool execute(Schedule< GUM_SCALAR > &)=0
execute all the operations of a given schedule
virtual float nbOperations(const Schedule< GUM_SCALAR > &) const =0
returns an estimation of the number of elementary operations needed to perform a given schedule ...
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
virtual ~Scheduler()
destructor
Class containing a schedule of operations to perform on multidims.
Scheduler()
default constructor
Class containing a schedule of operations to perform on multidims.
Definition: schedule.h:65
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:45
the common interface of all the schedulers