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

The Table-agnostic base class of scheduleMultiDim. More...

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

Inheritance diagram for gum::IScheduleMultiDim:

Public Member Functions

Constructors / Destructors
 IScheduleMultiDim (const Idx id=0)
 constructs a IScheduleMultiDim
virtual IScheduleMultiDimclone () const =0
 virtual copy constructor
virtual IScheduleMultiDimclone (bool force_copy) const =0
 virtual copy constructor enabling to force a copy of the content
virtual ~IScheduleMultiDim ()
 destructor
Operators
virtual bool operator== (const IScheduleMultiDim &) const
 checks whether two IScheduleMultiDim have exactly the same ID
virtual bool operator!= (const IScheduleMultiDim &) const
 checks whether two IScheduleMultiDim have different IDs

Protected Member Functions

IScheduleMultiDimoperator= (const IScheduleMultiDim &from)
 copy operator
IScheduleMultiDimoperator= (IScheduleMultiDim &&from)
 move operator
 IScheduleMultiDim (const IScheduleMultiDim &from)
 copy constructor
 IScheduleMultiDim (IScheduleMultiDim &&from)
 move constructor

Protected Attributes

Idx id_
 the unique Id of the ScheduleMultiDim

Static Private Member Functions

static Idx _newId_ ()
 returns a new distinct ID for each abstract scheduleMultiDim

Static Private Attributes

static std::atomic< Idx_multidim_id_

Accessors/Modifiers

virtual bool hasSameVariables (const IScheduleMultiDim &m) const =0
 checks whether two IScheduleMultiDim have the same variables
virtual bool hasSameContent (const IScheduleMultiDim &) const =0
 checks whether two IScheduleMultiDim contain precisely the same table
virtual bool isAbstract () const =0
 returns whether the ScheduleMultiDim contains a real table or not
virtual bool containsMultiDim () const =0
 indicates whether the ScheduleMultiDim contains a table and possesses it
virtual void makeAbstract ()=0
 if the ScheduleMultiDim is not abstract, make it abstract again
Idx id () const
 returns the id of the ScheduleMultiDim
virtual const Sequence< const DiscreteVariable * > & variablesSequence () const =0
 returns the set of variables involved in the ScheduleMultiDim
virtual Size domainSize () const =0
 returns the domain size the table would have after its creation
virtual double sizeOfContent () const =0
 returns the sizeof of the elements stored into the ScheduleMultiDim
virtual std::string toString () const =0
 displays the content of the ScheduleMultiDim
static void resetIdGenerator ()
 reset the id generator to 0

Detailed Description

The Table-agnostic base class of scheduleMultiDim.

Definition at line 67 of file IScheduleMultiDim.h.

Constructor & Destructor Documentation

◆ IScheduleMultiDim() [1/3]

gum::IScheduleMultiDim::IScheduleMultiDim ( const Idx id = 0)
explicit

constructs a IScheduleMultiDim

Parameters
idif specified and different from 0, the id of the constructed ScheduleMultiDim, else an Id is automatically provided to the ScheduleMultiDim.

Referenced by IScheduleMultiDim(), IScheduleMultiDim(), clone(), clone(), hasSameContent(), gum::ScheduleMultiDim< TABLE >::hasSameContent(), hasSameVariables(), gum::ScheduleMultiDim< TABLE >::hasSameVariables(), operator!=(), gum::ScheduleMultiDim< TABLE >::operator!=(), operator=(), operator=(), operator==(), and gum::ScheduleMultiDim< TABLE >::operator==().

Here is the caller graph for this function:

◆ ~IScheduleMultiDim()

virtual gum::IScheduleMultiDim::~IScheduleMultiDim ( )
virtual

destructor

◆ IScheduleMultiDim() [2/3]

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

copy constructor

References IScheduleMultiDim().

Here is the call graph for this function:

◆ IScheduleMultiDim() [3/3]

gum::IScheduleMultiDim::IScheduleMultiDim ( IScheduleMultiDim && from)
protected

move constructor

References IScheduleMultiDim().

Here is the call graph for this function:

Member Function Documentation

◆ _newId_()

Idx gum::IScheduleMultiDim::_newId_ ( )
staticprivate

returns a new distinct ID for each abstract scheduleMultiDim

◆ clone() [1/2]

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

virtual copy constructor

Implemented in gum::ScheduleMultiDim< TABLE >, gum::ScheduleMultiDim< SCHED_TABLE >, gum::ScheduleMultiDim< TABLE1 >, gum::ScheduleMultiDim< TABLE2 >, and gum::ScheduleMultiDim< TABLE_RES >.

References IScheduleMultiDim().

Here is the call graph for this function:

◆ clone() [2/2]

virtual IScheduleMultiDim * gum::IScheduleMultiDim::clone ( bool force_copy) const
pure virtual

virtual copy constructor enabling to force a copy of the content

Implemented in gum::ScheduleMultiDim< TABLE >.

References IScheduleMultiDim().

Here is the call graph for this function:

◆ containsMultiDim()

virtual bool gum::IScheduleMultiDim::containsMultiDim ( ) const
pure virtual

indicates whether the ScheduleMultiDim contains a table and possesses it

Non-abstract ScheduleMultiDim can either contain a multidimensional table or they can reference an external table. This method indicates whether we are in the first or the second case described above.

Implemented in gum::ScheduleMultiDim< TABLE >, gum::ScheduleMultiDim< SCHED_TABLE >, gum::ScheduleMultiDim< TABLE1 >, gum::ScheduleMultiDim< TABLE2 >, and gum::ScheduleMultiDim< TABLE_RES >.

◆ domainSize()

virtual Size gum::IScheduleMultiDim::domainSize ( ) const
pure virtual

◆ hasSameContent()

virtual bool gum::IScheduleMultiDim::hasSameContent ( const IScheduleMultiDim & ) const
pure virtual

checks whether two IScheduleMultiDim contain precisely the same table

By "contain precisely the same table", we mean that the actual tables pointed to by the IScheduleMultiDim are the same (i.e., either they are both not yet allocated but have the same sequences of variables or they have the same content)

Implemented in gum::ScheduleMultiDim< TABLE >, gum::ScheduleMultiDim< SCHED_TABLE >, gum::ScheduleMultiDim< TABLE1 >, gum::ScheduleMultiDim< TABLE2 >, and gum::ScheduleMultiDim< TABLE_RES >.

References IScheduleMultiDim().

Here is the call graph for this function:

◆ hasSameVariables()

virtual bool gum::IScheduleMultiDim::hasSameVariables ( const IScheduleMultiDim & m) const
pure virtual

checks whether two IScheduleMultiDim have the same variables

Method hasSameVariables tests whether two IScheduleMultiDim contain the same sequences of variables. It is weaker than operator== in the sense that we do not check for the IScheduleMultiDim's ID nor for the content of the table stored into the IScheduleMultiDim, if any.

Parameters
mthe IScheduleMultiDim with which we test similarity.

Implemented in gum::ScheduleMultiDim< TABLE >, gum::ScheduleMultiDim< SCHED_TABLE >, gum::ScheduleMultiDim< TABLE1 >, gum::ScheduleMultiDim< TABLE2 >, and gum::ScheduleMultiDim< TABLE_RES >.

References IScheduleMultiDim().

Here is the call graph for this function:

◆ id()

Idx gum::IScheduleMultiDim::id ( ) const

returns the id of the ScheduleMultiDim

Each ScheduleMultiDim has an Id that enables to find it easily. This is especially useful when copying schedule trees.

Warning
Note that different schedule trees may contain ScheduleMultiDim with the same ids. However, within a given tree, no two ScheduleMultiDim should have the same id.

◆ isAbstract()

virtual bool gum::IScheduleMultiDim::isAbstract ( ) const
pure virtual

returns whether the ScheduleMultiDim contains a real table or not

Returns
true if the ScheduleMultiDim is abstract, i.e., it does not actually contains an allocated multidimensional table.

Implemented in gum::ScheduleMultiDim< TABLE >, gum::ScheduleMultiDim< SCHED_TABLE >, gum::ScheduleMultiDim< TABLE1 >, gum::ScheduleMultiDim< TABLE2 >, and gum::ScheduleMultiDim< TABLE_RES >.

◆ makeAbstract()

virtual void gum::IScheduleMultiDim::makeAbstract ( )
pure virtual

if the ScheduleMultiDim is not abstract, make it abstract again

When a ScheduleMultiDim contains a multidimensional table, making it abstract is equivalent to freeing the table from memory and saying that the ScheduleMultiDim contains a null pointer. If the ScheduleMultiDim contains only a reference on an external table, then this table is kept untouched, but the ScheduleMultiDim now points toward a null pointer. Of course, if the ScheduleMultiDim was already abstract, then nothing is executed.

Implemented in gum::ScheduleMultiDim< TABLE >, gum::ScheduleMultiDim< SCHED_TABLE >, gum::ScheduleMultiDim< TABLE1 >, gum::ScheduleMultiDim< TABLE2 >, and gum::ScheduleMultiDim< TABLE_RES >.

◆ operator!=()

virtual bool gum::IScheduleMultiDim::operator!= ( const IScheduleMultiDim & ) const
virtual

checks whether two IScheduleMultiDim have different IDs

Two IScheduleMultiDim having different IDs should mean that they either contain the different sequences of variables and/or different tables.

Reimplemented in gum::ScheduleMultiDim< TABLE >.

References IScheduleMultiDim().

Here is the call graph for this function:

◆ operator=() [1/2]

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

copy operator

References IScheduleMultiDim().

Here is the call graph for this function:

◆ operator=() [2/2]

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

move operator

References IScheduleMultiDim().

Here is the call graph for this function:

◆ operator==()

virtual bool gum::IScheduleMultiDim::operator== ( const IScheduleMultiDim & ) const
virtual

checks whether two IScheduleMultiDim have exactly the same ID

Two IScheduleMultiDim having the same ID should imply that they also contain the same sequences of variables and the same tables.

Reimplemented in gum::ScheduleMultiDim< TABLE >.

References IScheduleMultiDim().

Here is the call graph for this function:

◆ resetIdGenerator()

void gum::IScheduleMultiDim::resetIdGenerator ( )
static

reset the id generator to 0

This method is essentially useful for performing aGrUM's testunits (depending on the order in which they are executed, the results could be difficult to predict without ensuring that, at the beginning of a testunit, the id of the first ScheduleMultiDim is always 1).

◆ sizeOfContent()

virtual double gum::IScheduleMultiDim::sizeOfContent ( ) const
pure virtual

returns the sizeof of the elements stored into the ScheduleMultiDim

This method is useful for determining schedules' memory usage: this is actually equal to the number of elements times the sizeof of these elements. The goal of sizeOfContent is to return this sizeof

Implemented in gum::ScheduleMultiDim< TABLE >, gum::ScheduleMultiDim< SCHED_TABLE >, gum::ScheduleMultiDim< TABLE1 >, gum::ScheduleMultiDim< TABLE2 >, and gum::ScheduleMultiDim< TABLE_RES >.

◆ toString()

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

◆ variablesSequence()

virtual const Sequence< const DiscreteVariable * > & gum::IScheduleMultiDim::variablesSequence ( ) const
pure virtual

Member Data Documentation

◆ _multidim_id_

std::atomic< Idx > gum::IScheduleMultiDim::_multidim_id_
staticprivate

Definition at line 208 of file IScheduleMultiDim.h.

◆ id_

Idx gum::IScheduleMultiDim::id_
protected

the unique Id of the ScheduleMultiDim

Definition at line 200 of file IScheduleMultiDim.h.


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