145 template <
typename TABLE >
205 const bool are_results_persistent =
false);
223 template <
typename TABLE1,
typename TABLE2,
typename TABLE_RES >
226 TABLE_RES (*combine)(
const TABLE1&,
228 const bool is_result_persistent =
false);
248 template <
typename TABLE >
251 TABLE (*project)(
const TABLE&,
253 const bool is_result_persistent =
false);
264 template <
typename TABLE >
276 template <
typename TABLE,
template <
typename... >
class CONTAINER >
278 CONTAINER< TABLE >& container);
319 std::vector< NodeId >& new_available_nodes,
320 const bool check =
false);
340 std::vector< NodeId >& new_available_nodes,
341 const bool check =
false);
Base classes for directed acyclic graphs.
Set of pairs of elements with fast search for both elements.
Set of pairs of elements with fast search for both elements.
The class for generic Hash Tables.
The Table-agnostic base class of scheduleMultiDim.
the base class for "low-level" operators used to schedule inferences
static std::atomic< Idx > _overall_version_number_
void updateAfterExecution(const NodeId exec_node, std::vector< NodeId > &new_available_nodes, const bool check=false)
updates the schedule after a given operation has been executed
virtual ~Schedule()
destructor
void _copy_(const Schedule &from)
a function to copy the content of a schedule into another one
const ScheduleOperator & operation(const NodeId id) const
returns the scheduleOperation corresponding to an id in the DAG
Idx versionNumber() const
returns the version number of the schedule
void _destroy_()
a function to delete from memory the content of a schedule
const ScheduleOperator & emplaceBinaryCombination(const ScheduleMultiDim< TABLE1 > &table1, const ScheduleMultiDim< TABLE2 > &table2, TABLE_RES(*combine)(const TABLE1 &, const TABLE2 &), const bool is_result_persistent=false)
emplace a new schedule binary combination operation
Schedule(const Size nb_ops=256)
default constructor (construct an empty sequence)
Bijection< const IScheduleMultiDim *, NodeId > _deleted_multidim2node_
A bijection mapping ScheduleMultiDims to be deleted with the operations that will delete them.
void emplaceScheduleMultiDim(const IScheduleMultiDim &multidim)
inserts without copying it a table as a source operation's input, i.e., this table is not computed by...
void clear()
empty the schedule, i.e., remove its content
NodeId nodeId(const ScheduleOperator &) const
returns the id of the node corresponding to a given ScheduleOperator
const DAG & dag() const
returns a DAG indicating in which order the operations can be performed
DAG _fullDAG_() const
returns the graph that would obtain when no operation is performed
bool operator==(const Schedule &) const
operator ==
Bijection< const IScheduleMultiDim *, Idx > _multidim2id_
a bijection between pointers to IScheduleMultiDim and their Ids
const IScheduleMultiDim * insertTable(const TABLE &table, const bool copy, const Idx id=0)
inserts a new table as a source operation's input, i.e., this table is not computed by any ScheduleOp...
Idx _version_number_
a number that identifies the current version of the schedule
const IScheduleMultiDim * scheduleMultiDim(const NodeId id) const
returns the ScheduleMultiDim corresponding to a given id
HashTable< const IScheduleMultiDim *, NodeSet > _multidim2nodes_
maps the multidims to the set of operations that use them
Schedule(const Schedule &from)
copy constructor
bool existsScheduleMultiDim(const NodeId id) const
indicates whether the schedule contains a given ScheduleMultiDim
static Idx _newVersionNumber_()
returns a new distinct version for each schedule
const ScheduleOperator * scheduleMultiDimCreator(const IScheduleMultiDim *multidim) const
returns the operation, if any, that created a given scheduleMultiDim
const ScheduleOperator & emplaceStorage(const IScheduleMultiDim &table, CONTAINER< TABLE > &container)
emplace a new schedule storage operation
Set< const IScheduleMultiDim * > _emplaced_multidims_
indicates which ScheduleMultiDims were emplaced
const IScheduleMultiDim * insertScheduleMultiDim(const IScheduleMultiDim &multidim)
inserts a copy of a table as a source operation's input, i.e., this table is not computed by any Sche...
NodeId scheduleMultiDimId(const IScheduleMultiDim *multidim) const
returns the id of a given IScheduleMultiDim
const ScheduleOperator & emplaceDeletion(const ScheduleMultiDim< TABLE > &table)
emplace a new schedule deletion operation
Bijection< NodeId, ScheduleOperator * > _node2op_
a mapping between the ids of the operations and their pointer
virtual Schedule * clone() const
virtual copy constructor
static std::string _paramString_(Idx i)
returns the adjective corresponding to a parameter index (1st, 2nd, etc.)
NodeId _newId_
the highest node id in the graph
const ScheduleOperator * scheduleMultiDimCreator(const NodeId id) const
returns the operation, if any, that created a given scheduleMultiDim
DAG _dag_
the DAG of the operations to perform
const ScheduleOperator & insertOperation(const ScheduleOperator &op, const bool are_results_persistent=false)
inserts an operation into the schedule
HashTable< const IScheduleMultiDim *, std::pair< ScheduleOperator *, Idx > > _multidim_location_
a structure to indicate precisely where a ScheduleMultiDim comes from
void updateAfterExecution(const ScheduleOperator &exec_op, std::vector< NodeId > &new_available_nodes, const bool check=false)
updates the schedule after executing a given operation
const ScheduleOperator & emplaceProjection(const ScheduleMultiDim< TABLE > &table, const gum::VariableSet &del_vars, TABLE(*project)(const TABLE &, const gum::VariableSet &), const bool is_result_persistent=false)
emplace a new schedule projection operation
NodeSet availableOperations() const
returns the set of ScheduleOperations that are ready to be executed
Schedule & operator=(Schedule &&)
move operator
bool operator!=(const Schedule &) const
operator !=
Schedule & operator=(const Schedule &)
copy operator
Schedule(Schedule &&from)
move constructor
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
Size NodeId
Type for node ids.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
gum is the global namespace for all aGrUM entities
Set< const DiscreteVariable * > VariableSet
a binary Combination operator class used for scheduling inferences
an operator to force a ScheduleMultiDim to be abstract
a Projection operator class used for scheduling inferences
Class for storing multidimensional tables in scheduling inferences.
Class containing a schedule of operations to perform.