aGrUM  0.16.0
scheduleOperation.h
Go to the documentation of this file.
1 
28 #ifndef GUM_SCHEDULE_OPERATION_H
29 #define GUM_SCHEDULE_OPERATION_H
30 
31 #include <string>
32 #include <utility>
33 
34 #include <agrum/agrum.h>
35 
36 #include <agrum/core/sequence.h>
38 
39 namespace gum {
40 
41  template < typename GUM_SCALAR >
43  public:
45  enum class Type : char {
56  };
57 
58  // ############################################################################
60  // ############################################################################
62 
64  virtual ScheduleOperation< GUM_SCALAR >* newFactory() const = 0;
65 
67  virtual ~ScheduleOperation();
68 
70 
71  // ############################################################################
73  // ############################################################################
75 
77 
79  virtual bool operator==(const ScheduleOperation< GUM_SCALAR >&) const = 0;
80 
82 
84  virtual bool operator!=(const ScheduleOperation< GUM_SCALAR >&) const = 0;
85 
87 
88  // ############################################################################
90  // ############################################################################
92 
94  Type type() const;
95 
97  Idx id() const;
98 
101  multiDimArgs() const = 0;
102 
105  multiDimResults() const = 0;
106 
108  virtual void execute() = 0;
109 
112  virtual float nbOperations() const = 0;
113 
115 
123  virtual std::pair< long, long > memoryUsage() const = 0;
124 
126  virtual std::string toString() const = 0;
127 
129 
130  protected:
132  explicit ScheduleOperation(Type t);
133 
136 
140 
141  private:
144 
147 
149  static Idx __newId();
150  };
151 
152 } /* namespace gum */
153 
154 // always include the template implementation
156 
157 #endif /* GUM_SCHEDULE_OPERATION_H */
virtual const Sequence< const ScheduleMultiDim< GUM_SCALAR > *> & multiDimResults() const =0
returns the set of multidims that should be the result of the operation
project a ScheduleMultiDim over a subset of its variables
virtual float nbOperations() const =0
returns an estimation of the number of elementary operations needed to perform the ScheduleOperation ...
Type type() const
returns the name of the operation
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.
Idx __id
the id corresponding to the operation
The generic class for storing (ordered) sequences of objects.
Definition: sequence.h:1022
Type __type
the name of the operation to perform
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
virtual const Sequence< const ScheduleMultiDim< GUM_SCALAR > *> & multiDimArgs() const =0
returns the set of multidims passed in argument to the operation
virtual bool operator!=(const ScheduleOperation< GUM_SCALAR > &) const =0
operator !=
Idx id() const
returns the id of the operation
virtual bool operator==(const ScheduleOperation< GUM_SCALAR > &) const =0
operator ==
virtual void execute()=0
executes the operation
Type
the currently supported types of operations
static Idx __newId()
returns a new distinct ID for each operation
ScheduleOperation(Type t)
default constructor
virtual std::string toString() const =0
displays the content of the operation
virtual ~ScheduleOperation()
destructor
ScheduleOperation< GUM_SCALAR > & operator=(const ScheduleOperation< GUM_SCALAR > &)
copy operator
Size Idx
Type for indexes.
Definition: types.h:53
virtual ScheduleOperation< GUM_SCALAR > * newFactory() const =0
virtual copy constructor: creates a clone of the operation
virtual std::pair< long, long > memoryUsage() const =0
returns the memory consumption used during the operation
delete a MultiDim from memory