![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
A generic class to project efficiently a MultiDim table over a subset of its variables. More...
#include <agrum/tools/multidim/operators/multiDimProjection.h>
Public Member Functions | |
Constructors / Destructors | |
MultiDimProjection (TABLE< GUM_SCALAR > *(*proj)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable * > &)) | |
Default constructor. More... | |
MultiDimProjection (const MultiDimProjection< GUM_SCALAR, TABLE > &) | |
Copy constructor. More... | |
virtual | ~MultiDimProjection () |
Destructor. More... | |
virtual MultiDimProjection< GUM_SCALAR, TABLE > * | newFactory () const |
virtual constructor More... | |
Accessors/Modifiers | |
TABLE< GUM_SCALAR > * | project (const TABLE< GUM_SCALAR > &table, const Set< const DiscreteVariable * > &del_vars) |
Creates and returns the projection of the table over a subset of its vars. More... | |
void | project (TABLE< GUM_SCALAR > &container, const TABLE< GUM_SCALAR > &table, const Set< const TABLE< GUM_SCALAR > * > &del_vars) |
Creates and returns the projection of the table over a subset of its vars. More... | |
void | setProjectFunction (TABLE< GUM_SCALAR > *(*proj)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable * > &)) |
Changes the function used for projecting TABLES. More... | |
TABLE< GUM_SCALAR > *(*)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable *> &) | projectFunction () |
Returns the projection function currently used by the projector. More... | |
float | nbOperations (const TABLE< GUM_SCALAR > &table, const Set< const DiscreteVariable * > &del_vars) const |
returns a rough estimate of the number of operations that will be performed to compute the projection. More... | |
float | nbOperations (const Sequence< const DiscreteVariable * > &vars, const Set< const DiscreteVariable * > &del_vars) const |
returns a rough estimate of the number of operations that will be performed to compute the projection. More... | |
std::pair< long, long > | memoryUsage (const TABLE< GUM_SCALAR > &table, const Set< const DiscreteVariable * > &del_vars) const |
Returns the memory consumption used during the projection. More... | |
std::pair< long, long > | memoryUsage (const Sequence< const DiscreteVariable * > &vars, const Set< const DiscreteVariable * > &del_vars) const |
Returns the memory consumption used during the projection. More... | |
Protected Attributes | |
TABLE< GUM_SCALAR > *(* | proj_ )(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable * > &) |
The projection function actually used. More... | |
A generic class to project efficiently a MultiDim table over a subset of its variables.
MultiDimProjection is a generic wrapper designed to project efficiently a multidimensional object over a subset of its variables.
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.
To be quite generic, the MultiDimProjection takes in argument the function that produces the result of the projection of the multidimensional object. The following code gives an example of the usage of MultiDimProjection:
Definition at line 88 of file multiDimProjection.h.
gum::MultiDimProjection< GUM_SCALAR, TABLE >::MultiDimProjection | ( | TABLE< GUM_SCALAR > *(*)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable * > &) | proj | ) |
Default constructor.
gum::MultiDimProjection< GUM_SCALAR, TABLE >::MultiDimProjection | ( | const MultiDimProjection< GUM_SCALAR, TABLE > & | ) |
Copy constructor.
|
virtual |
Destructor.
std::pair< long, long > gum::MultiDimProjection< GUM_SCALAR, TABLE >::memoryUsage | ( | const TABLE< GUM_SCALAR > & | table, |
const Set< const DiscreteVariable * > & | del_vars | ||
) | const |
Returns the memory consumption used during the projection.
Actually, this function does not return a precise account of the memory used by the multidimProjection but a rough estimate based on the size of the table involved in the projection.
std::pair< long, long > gum::MultiDimProjection< GUM_SCALAR, TABLE >::memoryUsage | ( | const Sequence< const DiscreteVariable * > & | vars, |
const Set< const DiscreteVariable * > & | del_vars | ||
) | const |
Returns the memory consumption used during the projection.
Actually, this function does not return a precise account of the memory used by the multidimProjection but a rough estimate based on the size of the table involved in the projection.
float gum::MultiDimProjection< GUM_SCALAR, TABLE >::nbOperations | ( | const TABLE< GUM_SCALAR > & | table, |
const Set< const DiscreteVariable * > & | del_vars | ||
) | const |
returns a rough estimate of the number of operations that will be performed to compute the projection.
float gum::MultiDimProjection< GUM_SCALAR, TABLE >::nbOperations | ( | const Sequence< const DiscreteVariable * > & | vars, |
const Set< const DiscreteVariable * > & | del_vars | ||
) | const |
returns a rough estimate of the number of operations that will be performed to compute the projection.
|
virtual |
virtual constructor
|
private |
Forbid copy operators.
TABLE< GUM_SCALAR >* gum::MultiDimProjection< GUM_SCALAR, TABLE >::project | ( | const TABLE< GUM_SCALAR > & | table, |
const Set< const DiscreteVariable * > & | del_vars | ||
) |
Creates and returns the projection of the table over a subset of its vars.
void gum::MultiDimProjection< GUM_SCALAR, TABLE >::project | ( | TABLE< GUM_SCALAR > & | container, |
const TABLE< GUM_SCALAR > & | table, | ||
const Set< const TABLE< GUM_SCALAR > * > & | del_vars | ||
) |
Creates and returns the projection of the table over a subset of its vars.
TABLE< GUM_SCALAR >*(*)(const TABLE< GUM_SCALAR >&, const Set< const DiscreteVariable* >&) gum::MultiDimProjection< GUM_SCALAR, TABLE >::projectFunction | ( | ) |
Returns the projection function currently used by the projector.
void gum::MultiDimProjection< GUM_SCALAR, TABLE >::setProjectFunction | ( | TABLE< GUM_SCALAR > *(*)(const TABLE< GUM_SCALAR > &, const Set< const DiscreteVariable * > &) | proj | ) |
Changes the function used for projecting TABLES.
|
protected |
The projection function actually used.
Definition at line 193 of file multiDimProjection.h.