27 #ifndef GUM_SCHEDULE_H 28 #define GUM_SCHEDULE_H 32 #include <agrum/agrum.h> 34 #include <agrum/tools/core/hashTable.h> 35 #include <agrum/tools/core/set.h> 36 #include <agrum/tools/graphs/DAG.h> 37 #include <agrum/tools/graphs/graphElements.h> 39 #include <agrum/tools/graphicalModels/inference/scheduler/scheduleCliqueStoreMultiDim.h> 40 #include <agrum/tools/graphicalModels/inference/scheduler/scheduleCombine.h> 41 #include <agrum/tools/graphicalModels/inference/scheduler/scheduleDeleteMultiDim.h> 42 #include <agrum/tools/graphicalModels/inference/scheduler/scheduleOperation.h> 43 #include <agrum/tools/graphicalModels/inference/scheduler/scheduleProject.h> 44 #include <agrum/tools/graphicalModels/inference/scheduler/scheduleSeparatorStoreMultiDim.h> 66 template <
typename GUM_SCALAR >
116 void forceAfter(
const ScheduleOperation< GUM_SCALAR >& op_to_force,
117 const ScheduleOperation< GUM_SCALAR >& op_before);
118 void forceAfter(NodeId op_to_force, NodeId op_before);
124 forceAfter(
const ScheduleOperation< GUM_SCALAR >& op_to_force,
125 const Set<
const ScheduleOperation< GUM_SCALAR >* >& ops_before);
126 void forceAfter(NodeId op_to_force,
const NodeSet& ops_before);
130 void forceBefore(
const ScheduleOperation< GUM_SCALAR >& op_to_force,
131 const ScheduleOperation< GUM_SCALAR >& op_after);
132 void forceBefore(NodeId op_to_force, NodeId op_after);
137 forceBefore(
const ScheduleOperation< GUM_SCALAR >& op_to_force,
138 const Set<
const ScheduleOperation< GUM_SCALAR >* >& ops_after);
139 void forceBefore(NodeId op_to_force,
const NodeSet& ops_after);
243 #include <agrum/tools/graphicalModels/inference/scheduler/schedule_tpl.h> float nbOperations(ScheduleOperation< GUM_SCALAR > &) const
inserts an operation to be scheduled
void forceBefore(NodeId op_to_force, const NodeSet &ops_after)
inserts an operation to be scheduled
void execute(NodeId)
executes a given operation (if this one is available)
INLINE void emplace(Args &&... args)
void execute(const ScheduleOperation< GUM_SCALAR > &)
inserts an operation to be scheduled
void forceAfter(NodeId op_to_force, NodeId op_before)
inserts an operation to be scheduled
NodeId nodeId(const ScheduleOperation< GUM_SCALAR > &) const
returns the id of the node corresponding to a given ScheduleOperation
Schedule(const Schedule< GUM_SCALAR > &)
copy constructor
NodeProperty< ScheduleOperation< GUM_SCALAR > *> node2operation__
a hashtable assigning to each node of the DAG an operation
std::pair< long, long > memoryUsage(ScheduleOperation< GUM_SCALAR > &) const
inserts an operation to be scheduled
void forceAfter(const ScheduleOperation< GUM_SCALAR > &op_to_force, const Set< const ScheduleOperation< GUM_SCALAR > * > &ops_before)
adds a constraint indicating that an operation cannot be performed before a set of operations ...
NodeId insert(const ScheduleOperation< GUM_SCALAR > &)
inserts an operation to be scheduled
const NodeSet & operationsInvolving(const ScheduleMultiDim< GUM_SCALAR > &table) const
returns the set of operations involving a given multidim table
const DAG & scheduling_dag() const
returns a DAG indicating in which order the operations can be performed
const NodeSet & availableOperations() const
returns the set of ScheduleOperations that can be executed at once
Schedule< GUM_SCALAR > & operator=(const Schedule< GUM_SCALAR > &)
copy operator
HashTable< OperationId, NodeId > operation2node__
a hashtable assigning to each operation id a node id in the DAG
std::pair< long, long > memoryUsage(NodeId) const
returns the memory consumption used during the execution of an operation
const NodeSet & operationsInvolving(MultiDimId table_id) const
inserts an operation to be scheduled
HashTable< MultiDimId, NodeSet *> multidim2operations__
for each multidim, store the set of operations involving it
NodeSet operations_available__
the set of operations that can be executed at once
const ScheduleOperation< GUM_SCALAR > & operation(NodeId) const
returns the scheduleOperation corresponding to an id in the DAG
Schedule()
default constructor (construct an empty sequence)
void forceBefore(const ScheduleOperation< GUM_SCALAR > &op_to_force, const Set< const ScheduleOperation< GUM_SCALAR > * > &ops_after)
adds a constraint indicating that an operation must be performed before a set of operations ...
HashTable< MultiDimId, NodeId > created_multidims__
a hashtable assigning to each ScheduleMultiDim resulting from a computation the MultiDimOperation nod...
DAG dag__
the DAG of the operations to perform
void forceAfter(NodeId op_to_force, const NodeSet &ops_before)
inserts an operation to be scheduled
void forceBefore(NodeId op_to_force, NodeId op_after)
inserts an operation to be scheduled
void updateWrongParents__() const
updates the set of parents for the nodes whoses parents are not correct yet and update accordingly th...
float nbOperations(NodeId) const
returns an estimation of the number of elementary operations needed to perform a given ScheduleOperat...
const NodeProperty< const ScheduleOperation< GUM_SCALAR > *> & operations() const
resturns the association between operations anf nodeIds
NodeSet operations_with_wrong_parents__
a list of operations whose parents are not properly set