aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::ScheduleOperator Class Referenceabstract

the base class for "low-level" operators used to schedule inferences More...

#include <agrum/base/graphicalModels/inference/scheduler/scheduleOperator.h>

Inheritance diagram for gum::ScheduleOperator:
Collaboration diagram for gum::ScheduleOperator:

Public Member Functions

Constructors / Destructors
 ScheduleOperator (const ScheduleOperatorType type, const bool imply_deletion, const bool are_results_persistent)
 default constructor
virtual ScheduleOperatorclone () 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, doublememoryUsage () 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
ScheduleOperatoroperator= (const ScheduleOperator &from)
 copy operator
ScheduleOperatoroperator= (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

Detailed Description

the base class for "low-level" operators used to schedule inferences

Definition at line 84 of file scheduleOperator.h.

Constructor & Destructor Documentation

◆ ScheduleOperator() [1/3]

gum::ScheduleOperator::ScheduleOperator ( const ScheduleOperatorType type,
const bool imply_deletion,
const bool are_results_persistent )
explicit

default constructor

Parameters
typeThe type of operator to be scheduled (projection, etc)
imply_deletionA Boolean indicating whether the operator, when performed, will delete some ScheduleMultiDims passed as its arguments
are_results_persistentif 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==().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~ScheduleOperator()

virtual gum::ScheduleOperator::~ScheduleOperator ( )
virtual

destructor

Warning
If the ScheduleOperator has created an output ScheduleMultiDim, upon destruction, this one is removed from memory

◆ ScheduleOperator() [2/3]

gum::ScheduleOperator::ScheduleOperator ( const ScheduleOperator & from)
protected

copy constructor

References ScheduleOperator().

Here is the call graph for this function:

◆ ScheduleOperator() [3/3]

gum::ScheduleOperator::ScheduleOperator ( ScheduleOperator && from)
protected

move constructor

References ScheduleOperator().

Here is the call graph for this function:

Member Function Documentation

◆ args()

virtual const Sequence< const IScheduleMultiDim * > & gum::ScheduleOperator::args ( ) const
pure virtual

◆ clone()

virtual ScheduleOperator * gum::ScheduleOperator::clone ( ) const
pure virtual

virtual copy constructor

Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.

References ScheduleOperator().

Here is the call graph for this function:

◆ execute()

virtual void gum::ScheduleOperator::execute ( )
pure virtual

◆ hasPersistentResults()

bool gum::ScheduleOperator::hasPersistentResults ( ) const

shows whether the operator has persistent results

◆ hasSameArguments()

virtual bool gum::ScheduleOperator::hasSameArguments ( const ScheduleOperator & ) const
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().

Here is the call graph for this function:

◆ hasSimilarArguments()

virtual bool gum::ScheduleOperator::hasSimilarArguments ( const ScheduleOperator & ) const
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().

Here is the call graph for this function:

◆ implyDeletion()

bool gum::ScheduleOperator::implyDeletion ( ) const

indicates whether the operator deletes some of its arguments

◆ isExecuted()

virtual bool gum::ScheduleOperator::isExecuted ( ) const
pure virtual

◆ isSameOperator()

virtual bool gum::ScheduleOperator::isSameOperator ( const ScheduleOperator & ) const
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().

Here is the call graph for this function:

◆ makeResultsPersistent()

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

◆ memoryUsage()

virtual std::pair< double, double > gum::ScheduleOperator::memoryUsage ( ) const
pure virtual

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.

Returns
a pair of memory consumption: the first one is the maximum amount of memory used during the execution of the operator and the second one is the amount of memory still used at the end of the function (the memory used by the resulting table)

Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.

◆ nbOperations()

virtual double gum::ScheduleOperator::nbOperations ( ) const
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 >.

◆ operator!=()

virtual bool gum::ScheduleOperator::operator!= ( const ScheduleOperator & ) const
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().

Here is the call graph for this function:

◆ operator=() [1/2]

ScheduleOperator & gum::ScheduleOperator::operator= ( const ScheduleOperator & from)
protected

copy operator

Warning
if the operator contained some output ScheduleMultiDims, then those are removed from memory before assigning the content of from

References ScheduleOperator().

Here is the call graph for this function:

◆ operator=() [2/2]

ScheduleOperator & gum::ScheduleOperator::operator= ( ScheduleOperator && from)
protected

move operator

Warning
if the operator contained some output ScheduleMultiDims, then those are removed from memory before assigning the content of from

References ScheduleOperator().

Here is the call graph for this function:

◆ operator==()

virtual bool gum::ScheduleOperator::operator== ( const ScheduleOperator & ) const
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().

Here is the call graph for this function:

◆ results()

virtual const Sequence< const IScheduleMultiDim * > & gum::ScheduleOperator::results ( ) const
pure virtual

returns the sequence of ScheduleMultidim output by the operator

Warning
Note that the Operator always returns its outputs, even if it has not been executed. In this case, the outputs are abstract ScheduleMultiDim.
Returns
the sequence of ScheduleMultiDim resulting from the operator. Those can be abstract if the operator has not been performed yet.

Implemented in gum::ScheduleBinaryCombination< TABLE1, TABLE2, TABLE_RES >, gum::ScheduleProjection< TABLE >, and gum::ScheduleStorage< TABLE, CONTAINER >.

◆ toString()

virtual std::string gum::ScheduleOperator::toString ( ) const
pure virtual

◆ type()

ScheduleOperatorType gum::ScheduleOperator::type ( ) const

returns the type of the operator

Referenced by ScheduleOperator().

Here is the caller graph for this function:

◆ undo()

virtual void gum::ScheduleOperator::undo ( )
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 >.

◆ updateArgs()

virtual void gum::ScheduleOperator::updateArgs ( const Sequence< const IScheduleMultiDim * > & new_args)
pure virtual

modifies the arguments of the operator

Exceptions
SizeErroris raised if the number of elements in new_args does not correspond to the number of arguments expected by the ScheduleOperator.
TypeErroris 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 >.

Member Data Documentation

◆ _imply_deletion_

bool gum::ScheduleOperator::_imply_deletion_
private

indicates whether the operator will delete some of the ScheduleMultiDim passed as its arguments

Definition at line 246 of file scheduleOperator.h.

◆ _op_type_

ScheduleOperatorType gum::ScheduleOperator::_op_type_
private

the name of the operator to perform

Definition at line 242 of file scheduleOperator.h.

◆ _result_persistent_

bool gum::ScheduleOperator::_result_persistent_
private

is the result persistent

Definition at line 249 of file scheduleOperator.h.


The documentation for this class was generated from the following file: