![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
An efficient class for combining and projecting MultiDim tables. More...
#include <agrum/base/multidim/operators/multiDimCombineAndProjectDefault.h>
Public Types | |
| using | value_type = typename MultiDimCombineAndProject< TABLE >::value_type |
Public Member Functions | |
Constructors / Destructors | |
| MultiDimCombineAndProjectDefault (TABLE(*combine)(const TABLE &, const TABLE &), TABLE(*project)(const TABLE &, const gum::VariableSet &)) | |
| Default constructor. | |
| MultiDimCombineAndProjectDefault (const MultiDimCombineAndProjectDefault< TABLE > &) | |
| Copy constructor. | |
| virtual | ~MultiDimCombineAndProjectDefault () |
| Destructor. | |
| virtual MultiDimCombineAndProjectDefault< TABLE > * | clone () const |
| virtual constructor | |
Accessors/Modifiers | |
| 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 | |
Private Member Functions | |
| void | _freeData_ (std::vector< const IScheduleMultiDim * > &tables, std::vector< ScheduleOperator * > &operations) const |
| free the scheduling memory | |
Private Attributes | |
| MultiDimCombination< TABLE > * | _combination_ |
| the class used for the combinations | |
| MultiDimProjection< TABLE > * | _projection_ |
| the class used for the projections | |
Accessors/Modifiers | |
| TABLE(*)(const TABLE &, const TABLE &) | combinationFunction () |
| Returns the current combination function. | |
| TABLE(*)(const TABLE &, const gum::VariableSet &) | projectionFunction () |
| returns the current projection function | |
| Set< const TABLE * > | execute (const Set< const TABLE * > &set, const gum::VariableSet &del_vars) final |
| creates and returns the result of the projection over the variables not in del_vars of the combination of the tables within set | |
| 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 final |
| returns the set of operations to perform to make all the combinations and projections | |
| 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 final |
| Returns the current combination function. | |
| void | setCombinationFunction (TABLE(*combine)(const TABLE &, const TABLE &)) final |
| changes the function used for combining two TABLES | |
| void | setCombinationClass (const MultiDimCombination< TABLE > &comb_class) final |
| changes the class that performs the combinations | |
| void | setProjectionFunction (TABLE(*proj)(const TABLE &, const gum::VariableSet &)) final |
| Changes the function used for projecting TABLES. | |
| void | setProjectionClass (const MultiDimProjection< TABLE > &proj_class) final |
| Changes the class that performs the projections. | |
| double | nbOperations (const Set< const TABLE * > &set, const gum::VariableSet &del_vars) const final |
| returns a rough estimate of the number of operations that will be performed to compute the combination. | |
| double | nbOperations (const Set< const Sequence< const DiscreteVariable * > * > &set, const gum::VariableSet &del_vars) const final |
| returns a rough estimate of the number of operations that will be performed to compute the combination. | |
| std::pair< double, double > | memoryUsage (const Set< const TABLE * > &set, const gum::VariableSet &del_vars) const final |
| returns the memory consumption used during the combinations and projections | |
| std::pair< double, double > | memoryUsage (const Set< const Sequence< const DiscreteVariable * > * > &set, const gum::VariableSet &del_vars) const final |
| returns the memory consumption used during the combinations and projections | |
An efficient class for combining and projecting MultiDim tables.
Definition at line 66 of file multiDimCombineAndProjectDefault.h.
| using gum::MultiDimCombineAndProjectDefault< TABLE >::value_type = typename MultiDimCombineAndProject< TABLE >::value_type |
Definition at line 68 of file multiDimCombineAndProjectDefault.h.
| gum::MultiDimCombineAndProjectDefault< TABLE >::MultiDimCombineAndProjectDefault | ( | TABLE(* | combine )(const TABLE &, const TABLE &), |
| TABLE(* | project )(const TABLE &, const gum::VariableSet &) ) |
Default constructor.
Referenced by MultiDimCombineAndProjectDefault(), and clone().
| gum::MultiDimCombineAndProjectDefault< TABLE >::MultiDimCombineAndProjectDefault | ( | const MultiDimCombineAndProjectDefault< TABLE > & | ) |
Copy constructor.
References MultiDimCombineAndProjectDefault().
|
virtual |
Destructor.
|
private |
free the scheduling memory
References _freeData_(), and operations().
Referenced by _freeData_().
|
virtual |
virtual constructor
Implements gum::MultiDimCombineAndProject< TABLE >.
References MultiDimCombineAndProjectDefault().
|
finalvirtual |
creates and returns the result of the projection over the variables not in del_vars 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::MultiDimCombineAndProject< TABLE >.
|
finalvirtual |
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.
Implements gum::MultiDimCombineAndProject< TABLE >.
References memoryUsage().
|
finalvirtual |
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.
Implements gum::MultiDimCombineAndProject< TABLE >.
References memoryUsage().
Referenced by memoryUsage(), and memoryUsage().
|
finalvirtual |
returns a rough estimate of the number of operations that will be performed to compute the combination.
Implements gum::MultiDimCombineAndProject< TABLE >.
References nbOperations().
|
finalvirtual |
returns a rough estimate of the number of operations that will be performed to compute the combination.
Implements gum::MultiDimCombineAndProject< TABLE >.
References nbOperations().
Referenced by nbOperations(), and nbOperations().
|
finalvirtual |
returns the set of operations to perform to make all the combinations and projections
Implements gum::MultiDimCombineAndProject< TABLE >.
Referenced by _freeData_(), and operations().
|
finalvirtual |
Returns the current combination function.
Implements gum::MultiDimCombineAndProject< TABLE >.
References gum::MultiDimCombineAndProject< TABLE >::MultiDimCombineAndProject(), operations(), and gum::MultiDimCombineAndProject< TABLE >::schedule().
|
inherited |
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().
|
finalvirtual |
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.
Implements gum::MultiDimCombineAndProject< TABLE >.
References setCombinationClass().
Referenced by setCombinationClass().
|
finalvirtual |
changes the function used for combining two TABLES
Implements gum::MultiDimCombineAndProject< TABLE >.
References setCombinationFunction().
Referenced by setCombinationFunction().
|
finalvirtual |
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.
Implements gum::MultiDimCombineAndProject< TABLE >.
References setProjectionClass().
Referenced by setProjectionClass().
|
finalvirtual |
Changes the function used for projecting TABLES.
Implements gum::MultiDimCombineAndProject< TABLE >.
References setProjectionFunction().
Referenced by setProjectionFunction().
|
private |
the class used for the combinations
Definition at line 217 of file multiDimCombineAndProjectDefault.h.
|
private |
the class used for the projections
Definition at line 220 of file multiDimCombineAndProjectDefault.h.
| TABLE(*)(const TABLE &, const TABLE &) gum::MultiDimCombineAndProjectDefault< TABLE >::combinationFunction() |
Returns the current combination function.
Definition at line 150 of file multiDimCombineAndProjectDefault.h.
| TABLE(*)(const TABLE &, const gum::VariableSet &) gum::MultiDimCombineAndProjectDefault< TABLE >::projectionFunction() |
returns the current projection function
Definition at line 164 of file multiDimCombineAndProjectDefault.h.