![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
A generic interface to combine efficiently several MultiDim tables. More...
#include <agrum/base/multidim/multiDimCombination.h>
Public Types | |
| using | value_type = typename TableType< TABLE >::value_type |
| the type of the values contained into TABLE | |
Public Member Functions | |
Constructors / Destructors | |
| MultiDimCombination () | |
| default constructor | |
| MultiDimCombination (const MultiDimCombination< TABLE > &) | |
| copy constructor | |
| virtual | ~MultiDimCombination () |
| destructor | |
| virtual MultiDimCombination< TABLE > * | clone () const =0 |
| virtual constructor | |
Accessors/Modifiers | |
| virtual TABLE(*)(const TABLE &, const TABLE &) | combinationFunction () |
| returns the combination function currently used by the combinator | |
| virtual TABLE * | execute (const Set< const TABLE * > &set) const =0 |
| creates and returns the result of the combination of the tables within set | |
| virtual void | execute (TABLE &container, const Set< const TABLE * > &set) const =0 |
| returns the combination function currently used by the combinator | |
| virtual std::pair< std::vector< ScheduleOperator * >, const IScheduleMultiDim * > | operations (const std::vector< const IScheduleMultiDim * > &set, const bool is_result_persistent=false) const =0 |
| returns the set of operations to perform as well as the result of the combination | |
| virtual std::pair< std::vector< ScheduleOperator * >, const IScheduleMultiDim * > | operations (const Set< const IScheduleMultiDim * > &set, const bool is_result_persistent=false) const =0 |
| returns the combination function currently used by the combinator | |
| const IScheduleMultiDim * | schedule (Schedule &schedule, const Set< const IScheduleMultiDim * > &set, const bool is_result_persistent=false) const |
| add to a given schedule the set of operations needed to perform the combination | |
| const IScheduleMultiDim * | schedule (Schedule &schedule, const std::vector< const IScheduleMultiDim * > &set, const bool is_result_persistent=false) const |
| returns the combination function currently used by the combinator | |
| virtual void | setCombinationFunction (TABLE(*combine)(const TABLE &, const TABLE &))=0 |
| changes the function used for combining two TABLES | |
| virtual double | nbOperations (const Set< const TABLE * > &set) 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 =0 |
| returns the combination function currently used by the combinator | |
| virtual std::pair< double, double > | memoryUsage (const Set< const TABLE * > &set) const =0 |
| Returns the memory consumption used during the combination. | |
| virtual std::pair< double, double > | memoryUsage (const Set< const Sequence< const DiscreteVariable * > * > &set) const =0 |
| returns the combination function currently used by the combinator | |
| MultiDimCombination< TABLE > & | operator= (const MultiDimCombination< TABLE > &) |
| forbid copy operators | |
A generic interface to combine efficiently several MultiDim tables.
MultiDimCombination is a generic interface designed to combine efficiently several multidimensional objects, that is, to compute expressions like T1 op T2 op T3 op .... op Tn, where the Ti's are the multidimensional objects and op is an operator or a function taking in argument two such objects and producing a new (combined) Ti object. By default, the combination operation "op" is assumed to be COMMUTATIVE and ASSOCIATIVE. Note that MultiDimCombinations always produce a new freshly allocated table as the result of the combinations.
By multidimensional objects, we mean of course MultiDimImplementations, but also more complex objects such as, for instance, pairs of MultiDimImplementation the first one of which being a utility function and the second one being a table of instantiations (useful, e.g., for computing MPE's) but this can also be a pair (Utility,Tensor) for the inference in an Influence Diagram. Actually, the important point for a multidimensional object to be eligible to be combined by the MultiDimCombination is:
multidimensional objects and producing a new object of the same type, which is the so-called combined result of these two objects.
To be quite generic, the MultiDimCombination takes in argument the function that produces the result of the combination of two multidimensional objects. The following code gives an example of the usage of MultiDimCombinations:
Definition at line 120 of file multiDimCombination.h.
| using gum::MultiDimCombination< TABLE >::value_type = typename TableType< TABLE >::value_type |
the type of the values contained into TABLE
Definition at line 136 of file multiDimCombination.h.
| gum::MultiDimCombination< TABLE >::MultiDimCombination | ( | ) |
default constructor
Referenced by MultiDimCombination(), clone(), gum::MultiDimCombinationDefault< TABLE >::operations(), and operator=().
| gum::MultiDimCombination< TABLE >::MultiDimCombination | ( | const MultiDimCombination< TABLE > & | ) |
|
virtual |
destructor
|
pure virtual |
virtual constructor
Implemented in gum::MultiDimCombinationDefault< TABLE >.
References MultiDimCombination().
|
pure virtual |
creates and returns the result of the combination of the tables within set
| InvalidArgumentsNumber | exception is thrown if the set passed in argument contains less than two elements. |
Implemented in gum::MultiDimCombinationDefault< TABLE >.
|
pure virtual |
returns the combination function currently used by the combinator
Implemented in gum::MultiDimCombinationDefault< TABLE >.
|
pure virtual |
returns the combination function currently used by the combinator
Implemented in gum::MultiDimCombinationDefault< TABLE >.
|
pure virtual |
Returns the memory consumption used during the combination.
Actually, this function does not return a precise account of the memory used by the multidimCombination but a rough estimate based on the sizes of the tables involved in the combination.
Implemented in gum::MultiDimCombinationDefault< TABLE >.
|
pure virtual |
returns the combination function currently used by the combinator
Implemented in gum::MultiDimCombinationDefault< TABLE >.
|
pure virtual |
returns a rough estimate of the number of operations that will be performed to compute the combination.
Implemented in gum::MultiDimCombinationDefault< TABLE >.
|
pure virtual |
returns the combination function currently used by the combinator
Implemented in gum::MultiDimCombinationDefault< TABLE >.
|
pure virtual |
returns the set of operations to perform as well as the result of the combination
Executing sequentially the set of operations returned is guaranteed to produce the right result. The latter is contained within the IScheduleMultiDim.
Implemented in gum::MultiDimCombinationDefault< TABLE >.
|
private |
| const IScheduleMultiDim * gum::MultiDimCombination< TABLE >::schedule | ( | Schedule & | schedule, |
| const Set< const IScheduleMultiDim * > & | set, | ||
| const bool | is_result_persistent = false ) const |
add to a given schedule the set of operations needed to perform the combination
References schedule().
Referenced by gum::MultiDimCombinationDefault< TABLE >::operations(), schedule(), and schedule().
| const IScheduleMultiDim * gum::MultiDimCombination< TABLE >::schedule | ( | Schedule & | schedule, |
| const std::vector< const IScheduleMultiDim * > & | set, | ||
| const bool | is_result_persistent = false ) const |
returns the combination function currently used by the combinator
References schedule().
|
pure virtual |
changes the function used for combining two TABLES
Implemented in gum::MultiDimCombinationDefault< TABLE >.
|
inline |
returns the combination function currently used by the combinator
Definition at line 209 of file multiDimCombination.h.