![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
the base class for "low-level" operators used to schedule inferences More...
#include <agrum/base/graphicalModels/inference/scheduler/scheduleOperator.h>
Public Member Functions | |
Constructors / Destructors | |
| ScheduleOperator (const ScheduleOperatorType type, const bool imply_deletion, const bool are_results_persistent) | |
| default constructor | |
| virtual ScheduleOperator * | clone () const =0 |
| virtual copy constructor | |
| virtual | ~ScheduleOperator () |
| destructor | |
Operators | |
| virtual bool | operator== (const ScheduleOperator &) const |
| operator == | |
| virtual bool | operator!= (const ScheduleOperator &) const |
| operator != | |
Accessors/Modifiers | |
| virtual bool | hasSameArguments (const ScheduleOperator &) const =0 |
| checks whether two ScheduleOperator have similar parameters (same variables and same content) | |
| virtual bool | hasSimilarArguments (const ScheduleOperator &) const =0 |
| checks whether two ScheduleOperator have similar parameters (same variables) | |
| virtual bool | isSameOperator (const ScheduleOperator &) const |
| checks whether two ScheduleOperator perform the same operator | |
| ScheduleOperatorType | type () const |
| returns the type of the operator | |
| bool | implyDeletion () const |
| indicates whether the operator deletes some of its arguments | |
| virtual void | execute ()=0 |
| really executes the operator | |
| virtual bool | isExecuted () const =0 |
| indicates whether the operator has been executed | |
| virtual void | undo ()=0 |
| undo a previous execution, if any | |
| virtual void | updateArgs (const Sequence< const IScheduleMultiDim * > &new_args)=0 |
| modifies the arguments of the operator | |
| virtual const Sequence< const IScheduleMultiDim * > & | args () const =0 |
| returns the sequence of arguments passed to the operator | |
| virtual const Sequence< const IScheduleMultiDim * > & | results () const =0 |
| returns the sequence of ScheduleMultidim output by the operator | |
| void | makeResultsPersistent (const bool is_persistent) |
| makes the results of the operator persistent or not | |
| bool | hasPersistentResults () const |
| shows whether the operator has persistent results | |
| virtual double | nbOperations () const =0 |
| returns an estimation of the number of elementary operations needed to perform the ScheduleOperator | |
| virtual std::pair< double, double > | memoryUsage () const =0 |
| returns the memory consumption used by the operator | |
| virtual std::string | toString () const =0 |
| displays the content of the operator | |
Protected Member Functions | |
| ScheduleOperator (const ScheduleOperator &from) | |
| copy constructor | |
| ScheduleOperator (ScheduleOperator &&from) | |
| move constructor | |
| ScheduleOperator & | operator= (const ScheduleOperator &from) |
| copy operator | |
| ScheduleOperator & | operator= (ScheduleOperator &&from) |
| move operator | |
Private Attributes | |
| ScheduleOperatorType | _op_type_ |
| the name of the operator to perform | |
| bool | _imply_deletion_ |
| indicates whether the operator will delete some of the ScheduleMultiDim passed as its arguments | |
| bool | _result_persistent_ |
| is the result persistent | |
the base class for "low-level" operators used to schedule inferences
Definition at line 84 of file scheduleOperator.h.
|
explicit |
default constructor
| type | The type of operator to be scheduled (projection, etc) |
| imply_deletion | A Boolean indicating whether the operator, when performed, will delete some ScheduleMultiDims passed as its arguments |
| are_results_persistent | if the operator produces some ScheduleMultiDims, this boolean indicates whether these results are persistent, i.e., whether they should be kept in memory when the operator itself is deleted from memory. |
References type().
Referenced by ScheduleOperator(), ScheduleOperator(), clone(), gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >::hasSameArguments(), hasSameArguments(), gum::ScheduleProjection< TABLE >::hasSameArguments(), gum::ScheduleStorage< TABLE, CONTAINER >::hasSameArguments(), gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >::hasSimilarArguments(), hasSimilarArguments(), gum::ScheduleProjection< TABLE >::hasSimilarArguments(), gum::ScheduleStorage< TABLE, CONTAINER >::hasSimilarArguments(), gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >::isSameOperator(), isSameOperator(), gum::ScheduleProjection< TABLE >::isSameOperator(), gum::ScheduleStorage< TABLE, CONTAINER >::isSameOperator(), gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >::operator!=(), operator!=(), gum::ScheduleProjection< TABLE >::operator!=(), gum::ScheduleStorage< TABLE, CONTAINER >::operator!=(), operator=(), operator=(), gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >::operator==(), operator==(), gum::ScheduleProjection< TABLE >::operator==(), and gum::ScheduleStorage< TABLE, CONTAINER >::operator==().
|
virtual |
destructor
|
protected |
|
protected |
|
pure virtual |
returns the sequence of arguments passed to the operator
Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
|
pure virtual |
virtual copy constructor
Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
References ScheduleOperator().
|
pure virtual |
really executes the operator
Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
| bool gum::ScheduleOperator::hasPersistentResults | ( | ) | const |
shows whether the operator has persistent results
|
pure virtual |
checks whether two ScheduleOperator have similar parameters (same variables and same content)
Parameters having the same variables and the same content are essentially identical but they may have different Ids (so that they may not be ==).
Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
References ScheduleOperator().
|
pure virtual |
checks whether two ScheduleOperator have similar parameters (same variables)
Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
References ScheduleOperator().
| bool gum::ScheduleOperator::implyDeletion | ( | ) | const |
indicates whether the operator deletes some of its arguments
|
pure virtual |
indicates whether the operator has been executed
Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
|
virtual |
checks whether two ScheduleOperator perform the same operator
Reimplemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
References ScheduleOperator().
| void gum::ScheduleOperator::makeResultsPersistent | ( | const bool | is_persistent | ) |
makes the results of the operator persistent or not
Unlike non-persistent results, a persistent one is not destroyed when the operator itself is destroyed
returns the memory consumption used by the operator
Actually, this function does not return a precise account of the memory used by the ScheduleOperator but a rough estimate based on the sizes of the tables involved in the execution of the operator.
Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
|
pure virtual |
returns an estimation of the number of elementary operations needed to perform the ScheduleOperator
Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
|
virtual |
operator !=
Two operators are identical if and only if they have the same arguments and they perform the same operations. By Equal arguments, we mean that these ScheduleMultiDims have the same IDs
Reimplemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
References ScheduleOperator().
|
protected |
copy operator
References ScheduleOperator().
|
protected |
move operator
References ScheduleOperator().
|
virtual |
operator ==
Two operators are identical if and only if they have equal arguments and they perform the same operations. By Equal arguments, we mean that these ScheduleMultiDims have the same IDs
Reimplemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
References ScheduleOperator().
|
pure virtual |
returns the sequence of ScheduleMultidim output by the operator
Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
|
pure virtual |
displays the content of the operator
Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
| ScheduleOperatorType gum::ScheduleOperator::type | ( | ) | const |
returns the type of the operator
Referenced by ScheduleOperator().
|
pure virtual |
undo a previous execution, if any
throws OperationNotAllowed is raised if the operator is unable to perform undo
Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
|
pure virtual |
modifies the arguments of the operator
| SizeError | is raised if the number of elements in new_args does not correspond to the number of arguments expected by the ScheduleOperator. |
| TypeError | is raised if at least one element of new_args does not have a type compatible with what the ScheduleOperator expects. |
Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.
|
private |
indicates whether the operator will delete some of the ScheduleMultiDim passed as its arguments
Definition at line 246 of file scheduleOperator.h.
|
private |
the name of the operator to perform
Definition at line 242 of file scheduleOperator.h.
|
private |
is the result persistent
Definition at line 249 of file scheduleOperator.h.