![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
A class to combine efficiently several MultiDim tablesMultiDimCombinationDefault is a class designed to combine efficiently several multidimensional objects, that is, to compute expressions like T1 op T2 op T3 op .... More...
#include <agrum/tools/multidim/operators/multiDimCombinationDefault.h>
Public Member Functions | |
Constructors / Destructors | |
MultiDimCombinationDefault (TABLE< GUM_SCALAR > *(*combine)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &)) | |
Default constructor. More... | |
MultiDimCombinationDefault (const MultiDimCombinationDefault< GUM_SCALAR, TABLE > &) | |
Copy constructor. More... | |
virtual | ~MultiDimCombinationDefault () |
Destructor. More... | |
virtual MultiDimCombinationDefault< GUM_SCALAR, TABLE > * | newFactory () const |
virtual constructor More... | |
Accessors/Modifiers | |
virtual TABLE< GUM_SCALAR > * | combine (const Set< const TABLE< GUM_SCALAR > * > &set) |
Creates and returns the result of the combination of the tables within set. More... | |
virtual void | combine (TABLE< GUM_SCALAR > &container, const Set< const TABLE< GUM_SCALAR > * > &set) |
Creates and returns the result of the combination of the tables within set. More... | |
virtual void | setCombineFunction (TABLE< GUM_SCALAR > *(*combine)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &)) |
Changes the function used for combining two TABLES. More... | |
virtual TABLE< GUM_SCALAR > *(*)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &) | combineFunction () |
Returns the combination function currently used by the combinator. More... | |
virtual float | nbOperations (const Set< const TABLE< GUM_SCALAR > * > &set) const |
returns a rough estimate of the number of operations that will be performed to compute the combination. More... | |
virtual float | nbOperations (const Set< const Sequence< const DiscreteVariable * > * > &set) const |
Creates and returns the result of the combination of the tables within set. More... | |
virtual std::pair< long, long > | memoryUsage (const Set< const TABLE< GUM_SCALAR > * > &set) const |
Returns the additional memory consumption used during the combination. More... | |
virtual std::pair< long, long > | memoryUsage (const Set< const Sequence< const DiscreteVariable * > * > &set) const |
Creates and returns the result of the combination of the tables within set. More... | |
Protected Attributes | |
TABLE< GUM_SCALAR > *(* | combine_ )(const TABLE< GUM_SCALAR > &t1, const TABLE< GUM_SCALAR > &t2) |
The function used to combine two tables. More... | |
Protected Member Functions | |
Size | combinedSize_ (const Sequence< const DiscreteVariable * > &seq1, const Sequence< const DiscreteVariable * > &seq2) const |
returns the domain size of the Cartesian product of the union of all the variables in seq1 and seq2. More... | |
A class to combine efficiently several MultiDim tables
MultiDimCombinationDefault is a class 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. Note that the MultiDimCombinationDefault determines itself in which order the objects should be combined. As such, the combination operation to perform should thus be COMMUTATIVE and ASSOCIATIVE.
By multidimensional objects, we mean of course MultiDimImplementations, but also more complex objects such as, for instance, pairs of MultiDimImplementations 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,Potential) for the inference in an Influence Diagram. Actually, the important point for a multidimensional object to be eligible to be combined by the MultiDimCombinationDefault is:
sequence of Discrete variables that represent the dimensions of the multidimensional object
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 MultiDimCombinationDefault 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 101 of file multiDimCombinationDefault.h.
gum::MultiDimCombinationDefault< GUM_SCALAR, TABLE >::MultiDimCombinationDefault | ( | TABLE< GUM_SCALAR > *(*)(const TABLE< GUM_SCALAR > &, const TABLE< GUM_SCALAR > &) | combine | ) |
Default constructor.
combine | a function that takes two tables in input and produces a new table which is the result of the combination of the two tables passed in argument. |
gum::MultiDimCombinationDefault< GUM_SCALAR, TABLE >::MultiDimCombinationDefault | ( | const MultiDimCombinationDefault< GUM_SCALAR, TABLE > & | ) |
Copy constructor.
|
virtual |
Destructor.
|
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. |
Implements gum::MultiDimCombination< GUM_SCALAR, TABLE >.
|
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. |
Implements gum::MultiDimCombination< GUM_SCALAR, TABLE >.
|
protected |
returns the domain size of the Cartesian product of the union of all the variables in seq1 and seq2.
|
virtual |
Returns the combination function currently used by the combinator.
Reimplemented from gum::MultiDimCombination< GUM_SCALAR, TABLE >.
|
virtual |
Returns the additional 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.
Implements gum::MultiDimCombination< GUM_SCALAR, TABLE >.
|
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. |
Implements gum::MultiDimCombination< GUM_SCALAR, TABLE >.
|
virtual |
returns a rough estimate of the number of operations that will be performed to compute the combination.
Implements gum::MultiDimCombination< GUM_SCALAR, TABLE >.
|
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. |
Implements gum::MultiDimCombination< GUM_SCALAR, TABLE >.
|
virtual |
virtual constructor
Implements gum::MultiDimCombination< GUM_SCALAR, TABLE >.
|
virtual |
Changes the function used for combining two TABLES.
Implements gum::MultiDimCombination< GUM_SCALAR, TABLE >.
|
protected |
The function used to combine two tables.
Definition at line 186 of file multiDimCombinationDefault.h.