![]() |
aGrUM 2.3.2
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/base/multidim/operators/multiDimProjection.h>
Public Types | |
| using | value_type = typename TableType< TABLE >::value_type |
| the type of the values contained into TABLE | |
Public Member Functions | |
Constructors / Destructors | |
| MultiDimProjection (TABLE(*proj)(const TABLE &, const gum::VariableSet &)) | |
| Default constructor. | |
| MultiDimProjection (const MultiDimProjection< TABLE > &) | |
| Copy constructor. | |
| virtual | ~MultiDimProjection () |
| Destructor. | |
| virtual MultiDimProjection< TABLE > * | clone () const |
| virtual constructor | |
Protected Attributes | |
| TABLE(* | proj_ )(const TABLE &, const gum::VariableSet &) |
| The projection function actually used. | |
Private Member Functions | |
| MultiDimProjection< TABLE > & | operator= (const MultiDimProjection< TABLE > &) |
| Forbid copy operators. | |
Accessors/Modifiers | |
| TABLE(*)(const TABLE &, const gum::VariableSet &) | projectionFunction () |
| Returns the projection function currently used by the projector. | |
| TABLE * | execute (const TABLE &table, const gum::VariableSet &del_vars) const |
| Creates and returns the projection of the table over a subset of its vars. | |
| void | execute (TABLE &container, const TABLE &table, const gum::VariableSet &del_vars) const |
| Returns the projection function currently used by the projector. | |
| std::pair< ScheduleOperator *, const IScheduleMultiDim * > | operations (const IScheduleMultiDim *table, const gum::VariableSet &del_vars, const bool is_result_persistent=false) const |
| returns operation to perform as well as the result of the projection | |
| const IScheduleMultiDim * | schedule (Schedule &schedule, const IScheduleMultiDim *table, const gum::VariableSet &del_vars, const bool is_result_persistent=false) const |
| add to a given schedule the set of operations needed to perform the projection | |
| void | setProjectionFunction (TABLE(*proj)(const TABLE &, const gum::VariableSet &)) |
| Changes the function used for projecting TABLES. | |
| double | nbOperations (const TABLE &table, const gum::VariableSet &del_vars) const |
| returns a rough estimate of the number of operations that will be performed to compute the projection. | |
| double | nbOperations (const Sequence< const DiscreteVariable * > &vars, const gum::VariableSet &del_vars) const |
| returns a rough estimate of the number of operations that will be performed to compute the projection. | |
| std::pair< double, double > | memoryUsage (const TABLE &table, const gum::VariableSet &del_vars) const |
| Returns the memory consumption used during the projection. | |
| std::pair< double, double > | memoryUsage (const Sequence< const DiscreteVariable * > &vars, const gum::VariableSet &del_vars) const |
| Returns the memory consumption used during the projection. | |
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. Note that MultiDimProjections always produce a new freshly allocated table as the result of the projections.
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,Tensor) 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 109 of file multiDimProjection.h.
| using gum::MultiDimProjection< TABLE >::value_type = typename TableType< TABLE >::value_type |
the type of the values contained into TABLE
Definition at line 125 of file multiDimProjection.h.
| gum::MultiDimProjection< TABLE >::MultiDimProjection | ( | TABLE(* | proj )(const TABLE &, const gum::VariableSet &) | ) |
Default constructor.
Referenced by MultiDimProjection(), clone(), and operator=().
| gum::MultiDimProjection< TABLE >::MultiDimProjection | ( | const MultiDimProjection< TABLE > & | ) |
|
virtual |
Destructor.
|
virtual |
virtual constructor
References MultiDimProjection().
| TABLE * gum::MultiDimProjection< TABLE >::execute | ( | const TABLE & | table, |
| const gum::VariableSet & | del_vars ) const |
Creates and returns the projection of the table over a subset of its vars.
| void gum::MultiDimProjection< TABLE >::execute | ( | TABLE & | container, |
| const TABLE & | table, | ||
| const gum::VariableSet & | del_vars ) const |
Returns the projection function currently used by the projector.
| std::pair< double, double > gum::MultiDimProjection< TABLE >::memoryUsage | ( | const Sequence< const DiscreteVariable * > & | vars, |
| const gum::VariableSet & | 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< double, double > gum::MultiDimProjection< TABLE >::memoryUsage | ( | const TABLE & | table, |
| const gum::VariableSet & | 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.
| double gum::MultiDimProjection< TABLE >::nbOperations | ( | const Sequence< const DiscreteVariable * > & | vars, |
| const gum::VariableSet & | del_vars ) const |
returns a rough estimate of the number of operations that will be performed to compute the projection.
| double gum::MultiDimProjection< TABLE >::nbOperations | ( | const TABLE & | table, |
| const gum::VariableSet & | del_vars ) const |
returns a rough estimate of the number of operations that will be performed to compute the projection.
| std::pair< ScheduleOperator *, const IScheduleMultiDim * > gum::MultiDimProjection< TABLE >::operations | ( | const IScheduleMultiDim * | table, |
| const gum::VariableSet & | del_vars, | ||
| const bool | is_result_persistent = false ) const |
returns operation to perform as well as the result of the projection
|
private |
| const IScheduleMultiDim * gum::MultiDimProjection< TABLE >::schedule | ( | Schedule & | schedule, |
| const IScheduleMultiDim * | table, | ||
| const gum::VariableSet & | del_vars, | ||
| const bool | is_result_persistent = false ) const |
add to a given schedule the set of operations needed to perform the projection
| schedule | the schedule to which we add the new projection |
| table | the table which is projected |
| del_vars | the set of variables to remove from the table |
| is_result_persistent | this boolean indicates whether the result of the projection is persistent, i.e., whether it should be kept in memory when the operation itself is deleted from memory. |
References schedule().
Referenced by schedule().
| void gum::MultiDimProjection< TABLE >::setProjectionFunction | ( | TABLE(* | proj )(const TABLE &, const gum::VariableSet &) | ) |
Changes the function used for projecting TABLES.
|
protected |
The projection function actually used.
Definition at line 248 of file multiDimProjection.h.
| TABLE(*)(const TABLE &, const gum::VariableSet &) gum::MultiDimProjection< TABLE >::projectionFunction() |
Returns the projection function currently used by the projector.
Definition at line 199 of file multiDimProjection.h.