aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::ScheduleStorage< TABLE, CONTAINER > Class Template Reference

Class for storing multidimensional tables into containers (sets, etc.). More...

#include <scheduleStorage.h>

Inheritance diagram for gum::ScheduleStorage< TABLE, CONTAINER >:
Collaboration diagram for gum::ScheduleStorage< TABLE, CONTAINER >:

Public Types

using SCHED_TABLE = typename std::remove_pointer< TABLE >::type

Public Member Functions

Constructors / Destructors
 ScheduleStorage (const IScheduleMultiDim &table, CONTAINER< TABLE > &container)
 default constructor
 ScheduleStorage (const ScheduleStorage< TABLE, CONTAINER > &from)
 copy constructor
 ScheduleStorage (ScheduleStorage< TABLE, CONTAINER > &&from)
 move constructor
ScheduleStorage< TABLE, CONTAINER > * clone () const final
 virtual copy constructor
virtual ~ScheduleStorage ()
 destructor
Operators
ScheduleStorage< TABLE, CONTAINER > & operator= (const ScheduleStorage< TABLE, CONTAINER > &)
 copy operator
ScheduleStorage< TABLE, CONTAINER > & operator= (ScheduleStorage< TABLE, CONTAINER > &&)
 move operator
bool operator== (const ScheduleOperator &) const final
 operator ==
bool operator!= (const ScheduleOperator &) const final
 operator !=
virtual bool operator== (const ScheduleStorage< TABLE, CONTAINER > &) const
 operator ==
virtual bool operator!= (const ScheduleStorage< TABLE, CONTAINER > &) const
 operator !=
Accessors/Modifiers
bool hasSameArguments (const ScheduleOperator &) const final
 checks whether two ScheduleStorage have the same parameters (same variables and same content, and same container)
bool hasSameArguments (const ScheduleStorage< TABLE, CONTAINER > &) const
 checks whether two ScheduleDeletion have the same parameters (same variables and same content, and same container)
bool hasSimilarArguments (const ScheduleOperator &) const final
 checks whether two ScheduleProjection have similar parameters (same variables but not necessarily the same content)
bool hasSimilarArguments (const ScheduleStorage< TABLE, CONTAINER > &) const
 checks whether two ScheduleProjection have similar parameters (same variables but not necessarily the same content)
bool isSameOperator (const ScheduleOperator &) const final
 checks whether two ScheduleOperator perform the same operation
bool isSameOperator (const ScheduleStorage< TABLE, CONTAINER > &) const
 checks whether two ScheduleOperator perform the same operation
const ScheduleMultiDim< SCHED_TABLE > & arg () const
 returns the argument of the storing function
const Sequence< const IScheduleMultiDim * > & args () const final
 returns the sequence of arguments passed to the operator
const Sequence< const IScheduleMultiDim * > & results () const final
 returns the sequence of ScheduleMultidim output by the operator
void execute () final
 really executes the operator
bool isExecuted () const final
 indicates whether the operator has been executed
void undo () final
 undo a previous execution, if any
void updateArgs (const Sequence< const IScheduleMultiDim * > &new_args) final
 modifies the arguments of the operator
double nbOperations () const final
 returns an estimation of the number of elementary operations needed to perform the ScheduleOperator
std::pair< double, doublememoryUsage () const final
 returns the memory consumption used during the execution of the operator
std::string toString () const final
 displays the content of the operator
Accessors/Modifiers
ScheduleOperatorType type () const
 returns the type of the operator
bool implyDeletion () const
 indicates whether the operator deletes some of its arguments
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

Private Attributes

ScheduleMultiDim< SCHED_TABLE > * _arg_
 the table to store
Sequence< const IScheduleMultiDim * > _args_
 the sequence of arguments passed to the operator
Sequence< const IScheduleMultiDim * > _results_
 the sequence of ScheduleMultidim output by the operator
CONTAINER< TABLE > * _container_
 the container into which the table is stored
bool _is_executed_ {false}
 indicates whether the operator has been performed or not
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

template<typename TABLE, template< typename... > class CONTAINER>
class gum::ScheduleStorage< TABLE, CONTAINER >

Class for storing multidimensional tables into containers (sets, etc.).

Definition at line 110 of file scheduleStorage.h.

Member Typedef Documentation

◆ SCHED_TABLE

template<typename TABLE, template< typename... > class CONTAINER>
using gum::ScheduleStorage< TABLE, CONTAINER >::SCHED_TABLE = typename std::remove_pointer< TABLE >::type

Definition at line 115 of file scheduleStorage.h.

Constructor & Destructor Documentation

◆ ScheduleStorage() [1/3]

template<typename TABLE, template< typename... > class CONTAINER>
gum::ScheduleStorage< TABLE, CONTAINER >::ScheduleStorage ( const IScheduleMultiDim & table,
CONTAINER< TABLE > & container )
explicit

default constructor

Parameters
tablethe ScheduleMultiDim containing the table that will eventually be stored.
Warning
table is stored only by reference within the ScheduleStorage.

Referenced by ScheduleStorage(), ScheduleStorage(), ~ScheduleStorage(), clone(), hasSameArguments(), hasSimilarArguments(), isSameOperator(), operator!=(), operator=(), operator=(), and operator==().

Here is the caller graph for this function:

◆ ScheduleStorage() [2/3]

template<typename TABLE, template< typename... > class CONTAINER>
gum::ScheduleStorage< TABLE, CONTAINER >::ScheduleStorage ( const ScheduleStorage< TABLE, CONTAINER > & from)

copy constructor

References ScheduleStorage().

Here is the call graph for this function:

◆ ScheduleStorage() [3/3]

template<typename TABLE, template< typename... > class CONTAINER>
gum::ScheduleStorage< TABLE, CONTAINER >::ScheduleStorage ( ScheduleStorage< TABLE, CONTAINER > && from)

move constructor

References ScheduleStorage().

Here is the call graph for this function:

◆ ~ScheduleStorage()

template<typename TABLE, template< typename... > class CONTAINER>
virtual gum::ScheduleStorage< TABLE, CONTAINER >::~ScheduleStorage ( )
virtual

destructor

References ScheduleStorage().

Here is the call graph for this function:

Member Function Documentation

◆ arg()

template<typename TABLE, template< typename... > class CONTAINER>
const ScheduleMultiDim< SCHED_TABLE > & gum::ScheduleStorage< TABLE, CONTAINER >::arg ( ) const

returns the argument of the storing function

References arg().

Referenced by arg().

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

◆ args()

template<typename TABLE, template< typename... > class CONTAINER>
const Sequence< const IScheduleMultiDim * > & gum::ScheduleStorage< TABLE, CONTAINER >::args ( ) const
finalvirtual

returns the sequence of arguments passed to the operator

Implements gum::ScheduleOperator.

References args().

Referenced by args().

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

◆ clone()

template<typename TABLE, template< typename... > class CONTAINER>
ScheduleStorage< TABLE, CONTAINER > * gum::ScheduleStorage< TABLE, CONTAINER >::clone ( ) const
finalvirtual

virtual copy constructor

Implements gum::ScheduleOperator.

References ScheduleStorage().

Here is the call graph for this function:

◆ execute()

template<typename TABLE, template< typename... > class CONTAINER>
void gum::ScheduleStorage< TABLE, CONTAINER >::execute ( )
finalvirtual

really executes the operator

Implements gum::ScheduleOperator.

References execute().

Referenced by execute().

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

◆ hasPersistentResults()

bool gum::ScheduleOperator::hasPersistentResults ( ) const
inherited

shows whether the operator has persistent results

◆ hasSameArguments() [1/2]

template<typename TABLE, template< typename... > class CONTAINER>
bool gum::ScheduleStorage< TABLE, CONTAINER >::hasSameArguments ( const ScheduleOperator & ) const
finalvirtual

checks whether two ScheduleStorage have the same parameters (same variables and same content, and same container)

ScheduleMultiDim Parameters having the same variables and the same content are essentially identical but they may have different Ids (so that they may not be ==).

Implements gum::ScheduleOperator.

References gum::ScheduleOperator::ScheduleOperator(), and hasSameArguments().

Referenced by hasSameArguments(), and hasSameArguments().

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

◆ hasSameArguments() [2/2]

template<typename TABLE, template< typename... > class CONTAINER>
bool gum::ScheduleStorage< TABLE, CONTAINER >::hasSameArguments ( const ScheduleStorage< TABLE, CONTAINER > & ) const

checks whether two ScheduleDeletion have the same parameters (same variables and same content, and same container)

ScheduleMultiDim Parameters having the same variables and the same content are essentially identical but they may have different Ids (so that they may not be ==).

References ScheduleStorage(), and hasSameArguments().

Here is the call graph for this function:

◆ hasSimilarArguments() [1/2]

template<typename TABLE, template< typename... > class CONTAINER>
bool gum::ScheduleStorage< TABLE, CONTAINER >::hasSimilarArguments ( const ScheduleOperator & ) const
finalvirtual

checks whether two ScheduleProjection have similar parameters (same variables but not necessarily the same content)

Implements gum::ScheduleOperator.

References gum::ScheduleOperator::ScheduleOperator(), and hasSimilarArguments().

Referenced by hasSimilarArguments(), and hasSimilarArguments().

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

◆ hasSimilarArguments() [2/2]

template<typename TABLE, template< typename... > class CONTAINER>
bool gum::ScheduleStorage< TABLE, CONTAINER >::hasSimilarArguments ( const ScheduleStorage< TABLE, CONTAINER > & ) const

checks whether two ScheduleProjection have similar parameters (same variables but not necessarily the same content)

References ScheduleStorage(), and hasSimilarArguments().

Here is the call graph for this function:

◆ implyDeletion()

bool gum::ScheduleOperator::implyDeletion ( ) const
inherited

indicates whether the operator deletes some of its arguments

◆ isExecuted()

template<typename TABLE, template< typename... > class CONTAINER>
bool gum::ScheduleStorage< TABLE, CONTAINER >::isExecuted ( ) const
finalvirtual

indicates whether the operator has been executed

Implements gum::ScheduleOperator.

References isExecuted().

Referenced by isExecuted().

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

◆ isSameOperator() [1/2]

template<typename TABLE, template< typename... > class CONTAINER>
bool gum::ScheduleStorage< TABLE, CONTAINER >::isSameOperator ( const ScheduleOperator & ) const
finalvirtual

checks whether two ScheduleOperator perform the same operation

Reimplemented from gum::ScheduleOperator.

References gum::ScheduleOperator::ScheduleOperator(), and isSameOperator().

Referenced by isSameOperator(), and isSameOperator().

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

◆ isSameOperator() [2/2]

template<typename TABLE, template< typename... > class CONTAINER>
bool gum::ScheduleStorage< TABLE, CONTAINER >::isSameOperator ( const ScheduleStorage< TABLE, CONTAINER > & ) const

checks whether two ScheduleOperator perform the same operation

References ScheduleStorage(), and isSameOperator().

Here is the call graph for this function:

◆ makeResultsPersistent()

void gum::ScheduleOperator::makeResultsPersistent ( const bool is_persistent)
inherited

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()

template<typename TABLE, template< typename... > class CONTAINER>
std::pair< double, double > gum::ScheduleStorage< TABLE, CONTAINER >::memoryUsage ( ) const
finalvirtual

returns the memory consumption used during the execution of 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 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)
Warning
This method does not checks whether the ScheduleMultiDim to be deleted is abstract or not: it assumes that it is not when the Store is performed. This enables to take into account the memory usage of a whole Schedule tree before performing any operation within it.

Implements gum::ScheduleOperator.

References memoryUsage().

Referenced by memoryUsage().

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

◆ nbOperations()

template<typename TABLE, template< typename... > class CONTAINER>
double gum::ScheduleStorage< TABLE, CONTAINER >::nbOperations ( ) const
finalvirtual

returns an estimation of the number of elementary operations needed to perform the ScheduleOperator

Implements gum::ScheduleOperator.

References nbOperations().

Referenced by nbOperations().

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

◆ operator!=() [1/2]

template<typename TABLE, template< typename... > class CONTAINER>
bool gum::ScheduleStorage< TABLE, CONTAINER >::operator!= ( const ScheduleOperator & ) const
finalvirtual

operator !=

Two ScheduleStorage are identical if and only if they have equal (==) ScheduleMultiDim arguments and the same containers to store their tables into. By Equal arguments, we stress that we mean that these ScheduleMultiDims have the same IDs

Reimplemented from gum::ScheduleOperator.

References gum::ScheduleOperator::ScheduleOperator().

Here is the call graph for this function:

◆ operator!=() [2/2]

template<typename TABLE, template< typename... > class CONTAINER>
virtual bool gum::ScheduleStorage< TABLE, CONTAINER >::operator!= ( const ScheduleStorage< TABLE, CONTAINER > & ) const
virtual

operator !=

Two ScheduleStorage are identical if and only if they have equal (==) ScheduleMultiDim arguments and the same containers to store their tables into. By Equal arguments, we stress that we mean that these ScheduleMultiDims have the same IDs

References ScheduleStorage().

Here is the call graph for this function:

◆ operator=() [1/2]

template<typename TABLE, template< typename... > class CONTAINER>
ScheduleStorage< TABLE, CONTAINER > & gum::ScheduleStorage< TABLE, CONTAINER >::operator= ( const ScheduleStorage< TABLE, CONTAINER > & )

copy operator

References ScheduleStorage().

Here is the call graph for this function:

◆ operator=() [2/2]

template<typename TABLE, template< typename... > class CONTAINER>
ScheduleStorage< TABLE, CONTAINER > & gum::ScheduleStorage< TABLE, CONTAINER >::operator= ( ScheduleStorage< TABLE, CONTAINER > && )

move operator

References ScheduleStorage().

Here is the call graph for this function:

◆ operator==() [1/2]

template<typename TABLE, template< typename... > class CONTAINER>
bool gum::ScheduleStorage< TABLE, CONTAINER >::operator== ( const ScheduleOperator & ) const
finalvirtual

operator ==

Two ScheduleStorage are identical if and only if they have equal (==) ScheduleMultiDim arguments and the same containers to store their tables into. By Equal arguments, we stress that we mean that these ScheduleMultiDims have the same IDs

Reimplemented from gum::ScheduleOperator.

References gum::ScheduleOperator::ScheduleOperator().

Here is the call graph for this function:

◆ operator==() [2/2]

template<typename TABLE, template< typename... > class CONTAINER>
virtual bool gum::ScheduleStorage< TABLE, CONTAINER >::operator== ( const ScheduleStorage< TABLE, CONTAINER > & ) const
virtual

operator ==

Two ScheduleStorage are identical if and only if they have equal (==) ScheduleMultiDim arguments and the same containers to store their tables into. By Equal arguments, we stress that we mean that these ScheduleMultiDims have the same IDs

References ScheduleStorage().

Here is the call graph for this function:

◆ results()

template<typename TABLE, template< typename... > class CONTAINER>
const Sequence< const IScheduleMultiDim * > & gum::ScheduleStorage< TABLE, CONTAINER >::results ( ) const
finalvirtual

returns the sequence of ScheduleMultidim output by the operator

Implements gum::ScheduleOperator.

References results().

Referenced by results().

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

◆ toString()

template<typename TABLE, template< typename... > class CONTAINER>
std::string gum::ScheduleStorage< TABLE, CONTAINER >::toString ( ) const
finalvirtual

displays the content of the operator

Implements gum::ScheduleOperator.

References toString().

Referenced by toString().

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

◆ type()

ScheduleOperatorType gum::ScheduleOperator::type ( ) const
inherited

returns the type of the operator

Referenced by ScheduleOperator().

Here is the caller graph for this function:

◆ undo()

template<typename TABLE, template< typename... > class CONTAINER>
void gum::ScheduleStorage< TABLE, CONTAINER >::undo ( )
finalvirtual

undo a previous execution, if any

throws OperationNotAllowed is raised if the operator is unable to perform undo

Implements gum::ScheduleOperator.

References undo().

Referenced by undo().

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

◆ updateArgs()

template<typename TABLE, template< typename... > class CONTAINER>
void gum::ScheduleStorage< TABLE, CONTAINER >::updateArgs ( const Sequence< const IScheduleMultiDim * > & new_args)
finalvirtual

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.

Implements gum::ScheduleOperator.

References updateArgs().

Referenced by updateArgs().

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

Member Data Documentation

◆ _arg_

template<typename TABLE, template< typename... > class CONTAINER>
ScheduleMultiDim< SCHED_TABLE >* gum::ScheduleStorage< TABLE, CONTAINER >::_arg_
private

the table to store

Definition at line 281 of file scheduleStorage.h.

◆ _args_

template<typename TABLE, template< typename... > class CONTAINER>
Sequence< const IScheduleMultiDim* > gum::ScheduleStorage< TABLE, CONTAINER >::_args_
private

the sequence of arguments passed to the operator

This method is convenient when using ScheduleOperator rather than directly using ScheduleBinaryCombination

Definition at line 286 of file scheduleStorage.h.

◆ _container_

template<typename TABLE, template< typename... > class CONTAINER>
CONTAINER< TABLE >* gum::ScheduleStorage< TABLE, CONTAINER >::_container_
private

the container into which the table is stored

Definition at line 296 of file scheduleStorage.h.

◆ _imply_deletion_

bool gum::ScheduleOperator::_imply_deletion_
privateinherited

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

Definition at line 246 of file scheduleOperator.h.

◆ _is_executed_

template<typename TABLE, template< typename... > class CONTAINER>
bool gum::ScheduleStorage< TABLE, CONTAINER >::_is_executed_ {false}
private

indicates whether the operator has been performed or not

Definition at line 299 of file scheduleStorage.h.

299{false};

◆ _op_type_

ScheduleOperatorType gum::ScheduleOperator::_op_type_
privateinherited

the name of the operator to perform

Definition at line 242 of file scheduleOperator.h.

◆ _result_persistent_

bool gum::ScheduleOperator::_result_persistent_
privateinherited

is the result persistent

Definition at line 249 of file scheduleOperator.h.

◆ _results_

template<typename TABLE, template< typename... > class CONTAINER>
Sequence< const IScheduleMultiDim* > gum::ScheduleStorage< TABLE, CONTAINER >::_results_
private

the sequence of ScheduleMultidim output by the operator

Warning
Note that the Operator has always some output, even if it has not been executed. In this case, the outputs are abstract ScheduleMultiDim.

Definition at line 293 of file scheduleStorage.h.


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