aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::MultiDimCombineAndProject< TABLE > Class Template Referenceabstract

A generic interface to combine and project efficiently MultiDim tables. More...

#include <agrum/base/multidim/operators/multiDimCombineAndProject.h>

Inheritance diagram for gum::MultiDimCombineAndProject< TABLE >:
Collaboration diagram for gum::MultiDimCombineAndProject< TABLE >:

Public Types

using value_type = typename TableType< TABLE >::value_type
 the type of the values contained into TABLE

Public Member Functions

Constructors / Destructors
 MultiDimCombineAndProject ()
 default constructor
 MultiDimCombineAndProject (const MultiDimCombineAndProject< TABLE > &)
 copy constructor
virtual ~MultiDimCombineAndProject ()
 destructor
virtual MultiDimCombineAndProject< TABLE > * clone () const =0
 virtual constructor

Private Member Functions

MultiDimCombineAndProject< TABLE > & operator= (const MultiDimCombineAndProject< TABLE > &)
 forbid copy operators

Accessors/Modifiers

virtual TABLE(*)(const TABLE &, const TABLE &) combinationFunction ()
 returns the current combination function
virtual TABLE(*)(const TABLE &, const gum::VariableSet &) projectionFunction ()
 returns the current projection function
virtual Set< const TABLE * > execute (const Set< const TABLE * > &set, const gum::VariableSet &del_vars)=0
 creates and returns the result of the projection over the variables not in del_vars of the combination of the tables within set
virtual std::pair< std::vector< ScheduleOperator * >, Set< const IScheduleMultiDim * > > operations (const Set< const IScheduleMultiDim * > &original_tables, const gum::VariableSet &del_vars, const bool is_result_persistent=false) const =0
 returns the set of operations to perform to make all the combinations and projections
virtual std::pair< std::vector< ScheduleOperator * >, Set< const IScheduleMultiDim * > > operations (const std::vector< const IScheduleMultiDim * > &original_tables, const gum::VariableSet &del_vars, const bool is_result_persistent=false) const =0
 returns the current combination function
Set< const IScheduleMultiDim * > schedule (Schedule &schedule, const Set< const IScheduleMultiDim * > &original_tables, const gum::VariableSet &del_vars, const bool is_result_persistent=false) const
 add to a given schedule the set of operations needed to perform all the combinations and projections
virtual void setCombinationFunction (TABLE(*combine)(const TABLE &, const TABLE &))=0
 changes the function used for combining two TABLES
virtual void setCombinationClass (const MultiDimCombination< TABLE > &comb_class)=0
 f
virtual void setProjectionFunction (TABLE(*proj)(const TABLE &, const gum::VariableSet &))=0
 changes the function used for projecting TABLES
virtual void setProjectionClass (const MultiDimProjection< TABLE > &proj_class)=0
 Changes the class that performs the projections.
virtual double nbOperations (const Set< const TABLE * > &set, const gum::VariableSet &del_vars) const =0
 returns a rough estimate of the number of operations that will be performed to compute the combination.
virtual double nbOperations (const Set< const Sequence< const DiscreteVariable * > * > &set, const gum::VariableSet &del_vars) const =0
 returns a rough estimate of the number of operations that will be performed to compute the combination.
virtual std::pair< double, doublememoryUsage (const Set< const TABLE * > &set, const gum::VariableSet &del_vars) const =0
 returns the memory consumption used during the combinations and projections
virtual std::pair< double, doublememoryUsage (const Set< const Sequence< const DiscreteVariable * > * > &set, const gum::VariableSet &del_vars) const =0
 returns the memory consumption used during the combinations and projections

Detailed Description

template<class TABLE>
class gum::MultiDimCombineAndProject< TABLE >

A generic interface to combine and project efficiently MultiDim tables.

Definition at line 69 of file multiDimCombineAndProject.h.

Member Typedef Documentation

◆ value_type

template<class TABLE>
using gum::MultiDimCombineAndProject< TABLE >::value_type = typename TableType< TABLE >::value_type

the type of the values contained into TABLE

Definition at line 85 of file multiDimCombineAndProject.h.

Constructor & Destructor Documentation

◆ MultiDimCombineAndProject() [1/2]

template<class TABLE>
gum::MultiDimCombineAndProject< TABLE >::MultiDimCombineAndProject ( )
explicit

default constructor

Referenced by MultiDimCombineAndProject(), clone(), gum::MultiDimCombineAndProjectDefault< TABLE >::operations(), and operator=().

Here is the caller graph for this function:

◆ MultiDimCombineAndProject() [2/2]

template<class TABLE>
gum::MultiDimCombineAndProject< TABLE >::MultiDimCombineAndProject ( const MultiDimCombineAndProject< TABLE > & )

copy constructor

References MultiDimCombineAndProject().

Here is the call graph for this function:

◆ ~MultiDimCombineAndProject()

template<class TABLE>
virtual gum::MultiDimCombineAndProject< TABLE >::~MultiDimCombineAndProject ( )
virtual

destructor

Member Function Documentation

◆ clone()

template<class TABLE>
virtual MultiDimCombineAndProject< TABLE > * gum::MultiDimCombineAndProject< TABLE >::clone ( ) const
pure virtual

virtual constructor

Returns
a new fresh MultiDimCombineAndProject with the same combination and projection functions.

Implemented in gum::MultiDimCombineAndProjectDefault< TABLE >.

References MultiDimCombineAndProject().

Here is the call graph for this function:

◆ execute()

template<class TABLE>
virtual Set< const TABLE * > gum::MultiDimCombineAndProject< TABLE >::execute ( const Set< const TABLE * > & set,
const gum::VariableSet & del_vars )
pure virtual

creates and returns the result of the projection over the variables not in del_vars of the combination of the tables within set

Returns
a new freshly created TABLE which is the result of the projection of the combination of all the TABLES passed in argument
Exceptions
InvalidArgumentsNumberexception is thrown if the set passed in argument contains less than two elements

Implemented in gum::MultiDimCombineAndProjectDefault< TABLE >.

◆ memoryUsage() [1/2]

template<class TABLE>
virtual std::pair< double, double > gum::MultiDimCombineAndProject< TABLE >::memoryUsage ( const Set< const Sequence< const DiscreteVariable * > * > & set,
const gum::VariableSet & del_vars ) const
pure virtual

returns the memory consumption used during the combinations and projections

Actually, this function does not return a precise account of the memory used by the MultiDimCombineAndProject but a rough estimate based on the size of the tables involved in the combinations and projections.

Returns
a pair of memory consumption: the first one is the maximum amount of memory used during the set of combinations and projections performed, and the second one is the amount of memory still used at the end of the function ( the memory used by the resulting tables )

Implemented in gum::MultiDimCombineAndProjectDefault< TABLE >.

◆ memoryUsage() [2/2]

template<class TABLE>
virtual std::pair< double, double > gum::MultiDimCombineAndProject< TABLE >::memoryUsage ( const Set< const TABLE * > & set,
const gum::VariableSet & del_vars ) const
pure virtual

returns the memory consumption used during the combinations and projections

Actually, this function does not return a precise account of the memory used by the MultiDimCombineAndProject but a rough estimate based on the size of the tables involved in the combinations and projections.

Returns
a pair of memory consumption: the first one is the maximum amount of memory used during the set of combinations and projections performed, and the second one is the amount of memory still used at the end of the function ( the memory used by the resulting tables )

Implemented in gum::MultiDimCombineAndProjectDefault< TABLE >.

◆ nbOperations() [1/2]

template<class TABLE>
virtual double gum::MultiDimCombineAndProject< TABLE >::nbOperations ( const Set< const Sequence< const DiscreteVariable * > * > & set,
const gum::VariableSet & del_vars ) const
pure virtual

returns a rough estimate of the number of operations that will be performed to compute the combination.

Implemented in gum::MultiDimCombineAndProjectDefault< TABLE >.

◆ nbOperations() [2/2]

template<class TABLE>
virtual double gum::MultiDimCombineAndProject< TABLE >::nbOperations ( const Set< const TABLE * > & set,
const gum::VariableSet & del_vars ) const
pure virtual

returns a rough estimate of the number of operations that will be performed to compute the combination.

Implemented in gum::MultiDimCombineAndProjectDefault< TABLE >.

◆ operations() [1/2]

template<class TABLE>
virtual std::pair< std::vector< ScheduleOperator * >, Set< const IScheduleMultiDim * > > gum::MultiDimCombineAndProject< TABLE >::operations ( const Set< const IScheduleMultiDim * > & original_tables,
const gum::VariableSet & del_vars,
const bool is_result_persistent = false ) const
pure virtual

returns the set of operations to perform to make all the combinations and projections

Implemented in gum::MultiDimCombineAndProjectDefault< TABLE >.

◆ operations() [2/2]

template<class TABLE>
virtual std::pair< std::vector< ScheduleOperator * >, Set< const IScheduleMultiDim * > > gum::MultiDimCombineAndProject< TABLE >::operations ( const std::vector< const IScheduleMultiDim * > & original_tables,
const gum::VariableSet & del_vars,
const bool is_result_persistent = false ) const
pure virtual

returns the current combination function

Implemented in gum::MultiDimCombineAndProjectDefault< TABLE >.

◆ operator=()

template<class TABLE>
MultiDimCombineAndProject< TABLE > & gum::MultiDimCombineAndProject< TABLE >::operator= ( const MultiDimCombineAndProject< TABLE > & )
private

forbid copy operators

References MultiDimCombineAndProject().

Here is the call graph for this function:

◆ schedule()

template<class TABLE>
Set< const IScheduleMultiDim * > gum::MultiDimCombineAndProject< TABLE >::schedule ( Schedule & schedule,
const Set< const IScheduleMultiDim * > & original_tables,
const gum::VariableSet & del_vars,
const bool is_result_persistent = false ) const

add to a given schedule the set of operations needed to perform all the combinations and projections

References schedule().

Referenced by gum::MultiDimCombineAndProjectDefault< TABLE >::operations(), and schedule().

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

◆ setCombinationClass()

template<class TABLE>
virtual void gum::MultiDimCombineAndProject< TABLE >::setCombinationClass ( const MultiDimCombination< TABLE > & comb_class)
pure virtual

f

changes the class that performs the combinations

Combinations are performed by pair, the CombineFunction being the function used to combine 2 tables, thus producing a new one. Of course, when we have to combine, say T1 * T2 * T3 * T4, there are several ways to do this computation. For instance, we might first compute T1 * T2, then T3 * T4, and finally compute the product of the resulting two tables. Or we might compute T1 * T2, then combine the result with T3, and then combine the last result with T4. The CombinationClass is responsible for determining which of these possibilities will actually be used. Function setCombinationClass allows to change the combinationClass and, thus, the way all those tables will be combined.

Implemented in gum::MultiDimCombineAndProjectDefault< TABLE >.

◆ setCombinationFunction()

template<class TABLE>
virtual void gum::MultiDimCombineAndProject< TABLE >::setCombinationFunction ( TABLE(* combine )(const TABLE &, const TABLE &))
pure virtual

changes the function used for combining two TABLES

Implemented in gum::MultiDimCombineAndProjectDefault< TABLE >.

◆ setProjectionClass()

template<class TABLE>
virtual void gum::MultiDimCombineAndProject< TABLE >::setProjectionClass ( const MultiDimProjection< TABLE > & proj_class)
pure virtual

Changes the class that performs the projections.

As for the combination class, it is possible to change the projection class, thus defining a new projection behaviour.

Implemented in gum::MultiDimCombineAndProjectDefault< TABLE >.

◆ setProjectionFunction()

template<class TABLE>
virtual void gum::MultiDimCombineAndProject< TABLE >::setProjectionFunction ( TABLE(* proj )(const TABLE &, const gum::VariableSet &))
pure virtual

changes the function used for projecting TABLES

Implemented in gum::MultiDimCombineAndProjectDefault< TABLE >.

Member Data Documentation

◆ combinationFunction

template<class TABLE>
virtual TABLE(*)(const TABLE &, const TABLE &) gum::MultiDimCombineAndProject< TABLE >::combinationFunction()
inline

returns the current combination function

Definition at line 171 of file multiDimCombineAndProject.h.

◆ projectionFunction

template<class TABLE>
virtual TABLE(*)(const TABLE &, const gum::VariableSet &) gum::MultiDimCombineAndProject< TABLE >::projectionFunction()
inline

returns the current projection function

Definition at line 177 of file multiDimCombineAndProject.h.


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