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);
123 void forceAfter(
const ScheduleOperation< GUM_SCALAR >& op_to_force,
124 const Set<
const ScheduleOperation< GUM_SCALAR >* >& ops_before);
125 void forceAfter(NodeId op_to_force,
const NodeSet& ops_before);
129 void forceBefore(
const ScheduleOperation< GUM_SCALAR >& op_to_force,
130 const ScheduleOperation< GUM_SCALAR >& op_after);
131 void forceBefore(NodeId op_to_force, NodeId op_after);
135 void forceBefore(
const ScheduleOperation< GUM_SCALAR >& op_to_force,
136 const Set<
const ScheduleOperation< GUM_SCALAR >* >& ops_after);
137 void forceBefore(NodeId op_to_force,
const NodeSet& ops_after);
239 #include <agrum/tools/graphicalModels/inference/scheduler/schedule_tpl.h> DAG _dag_
the DAG of the operations to perform
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)
void _updateWrongParents_() const
updates the set of parents for the nodes whoses parents are not correct yet and update accordingly th...
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
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
HashTable< MultiDimId, NodeSet *> _multidim2operations_
for each multidim, store the set of operations involving it
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
NodeSet _operations_available_
the set of operations that can be executed at once
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, NodeId > _created_multidims_
a hashtable assigning to each ScheduleMultiDim resulting from a computation the MultiDimOperation nod...
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 ...
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
float nbOperations(NodeId) const
returns an estimation of the number of elementary operations needed to perform a given ScheduleOperat...
NodeProperty< ScheduleOperation< GUM_SCALAR > *> _node2operation_
a hashtable assigning to each node of the DAG an operation
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