aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR > Class Template Reference

A container for registering complete projection functions on multiDimImplementations, i.e., functions projecting tables over all their variables. More...

#include <agrum/multdim/operators/completeProjectionRegister4MultiDim.h>

+ Collaboration diagram for gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >:

Public Member Functions

Accessors / Modifiers
void insert (const std::string &projection_name, const std::string &type_multidim, CompleteProjectionPtr newFunction)
 Adds a new entry into the register. More...
 
void erase (const std::string &projection_name, const std::string &type_multidim)
 Removes a given entry from the register. More...
 
bool exists (const std::string &projection_name, const std::string &type_multidim) const
 Indicates whether a given entry exists in the register. More...
 
CompleteProjectionPtr get (const std::string &projection_name, const std::string &type_multidim) const
 returns the specialized projection operator assigned to a given type of MultiDimImplementation More...
 

Static Public Member Functions

Named Constructors
static CompleteProjectionRegister4MultiDimRegister ()
 A named constructor that constructs one and only one Register per data type. More...
 

Public Types

typedef GUM_SCALAR(* CompleteProjectionPtr) (const MultiDimImplementation< GUM_SCALAR > *, Instantiation *instantiation)
 the type of functions used by the register More...
 

Detailed Description

template<typename GUM_SCALAR>
class gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >

A container for registering complete projection functions on multiDimImplementations, i.e., functions projecting tables over all their variables.

Definition at line 65 of file completeProjectionRegister4MultiDim.h.

Member Typedef Documentation

◆ CompleteProjectionPtr

template<typename GUM_SCALAR >
typedef GUM_SCALAR(* gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >::CompleteProjectionPtr) (const MultiDimImplementation< GUM_SCALAR > *, Instantiation *instantiation)

the type of functions used by the register

Definition at line 68 of file completeProjectionRegister4MultiDim.h.

◆ CompleteProjectionSet

template<typename GUM_SCALAR >
typedef HashTable< std::string, CompleteProjectionPtr > gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >::CompleteProjectionSet
private

The set of associations for a given projection type.

Definition at line 188 of file completeProjectionRegister4MultiDim.h.

Constructor & Destructor Documentation

◆ CompleteProjectionRegister4MultiDim() [1/2]

template<typename GUM_SCALAR >
gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >::CompleteProjectionRegister4MultiDim ( )
private

Default constructor: creates an empty register.

◆ CompleteProjectionRegister4MultiDim() [2/2]

template<typename GUM_SCALAR >
gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >::CompleteProjectionRegister4MultiDim ( const CompleteProjectionRegister4MultiDim< GUM_SCALAR > &  )
private

copy operator: never to be used

◆ ~CompleteProjectionRegister4MultiDim()

template<typename GUM_SCALAR >
gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >::~CompleteProjectionRegister4MultiDim ( )
private

Destructor.

Member Function Documentation

◆ erase()

template<typename GUM_SCALAR >
void gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >::erase ( const std::string &  projection_name,
const std::string &  type_multidim 
)

Removes a given entry from the register.

removes the function, if any, that performs the projection described by projection_name, and that takes in argument a multiDim of type type_multidim

Parameters
projection_namedescribes the name of the projection performed by the function to remove. Usual projection names are "min", "max", "sum", "product"
type_multidimthe real type of the multiDim taken in argument by the function to remove

◆ exists()

template<typename GUM_SCALAR >
bool gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >::exists ( const std::string &  projection_name,
const std::string &  type_multidim 
) const

Indicates whether a given entry exists in the register.

Indicates if the register contains a function that performs the projection described by projection_name, and that takes in argument a multiDim of type type_multidim.

Parameters
projection_namedescribes the name of the projection performed by the function we look for. Usual projection names are "min", "max", "sum", "product".
type_multidimthe real type of the multiDim taken in argument by the function we look for.

◆ get()

template<typename GUM_SCALAR >
CompleteProjectionPtr gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >::get ( const std::string &  projection_name,
const std::string &  type_multidim 
) const

returns the specialized projection operator assigned to a given type of MultiDimImplementation

returns the function, if any, that performs the projection described by projection_name, and that takes in argument a multiDim of type type_multidim

Parameters
projection_namedescribes the name of the projection performed by the function we look for. Usual projection names are "min", "max", "sum", "product"
type_multidimthe real type of the multiDim taken in argument by the function we look for
Exceptions
NotFoundexception is thrown if the operator we look for does not exist within this register.

◆ insert()

template<typename GUM_SCALAR >
void gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >::insert ( const std::string &  projection_name,
const std::string &  type_multidim,
CompleteProjectionPtr  newFunction 
)

Adds a new entry into the register.

This method inserts a new function (newFunction) taking a multiDim of type type_multidim (which actually inherit from MultiDimImplementation) and, possibly, a pointer on an instantiation in arguments. This new function's purpose is to achieve the projection described by projection_name. For instance, if projection_name is "max", "min", "sum" or "product", the new function performs the usual algebraic operations.

Parameters
projection_namedescribes the name of the operation performed by newFunction. Usual operation names are "min", "max", "sum", "product"
type_multidimthe real type of the multiDim taken in argument by function newFunction.
newFunctiona pointer to the new function to register. Note that although newFunction actually performs an operation on multiDims of type type_multidim, it should be declared as taking in argument two MultiDimImplementations. This constraint is imposed by the C++ typing system.

◆ Register()

template<typename GUM_SCALAR >
static CompleteProjectionRegister4MultiDim& gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >::Register ( )
static

A named constructor that constructs one and only one Register per data type.

Note that this constructor prevents the famous init order fiasco.

Member Data Documentation

◆ _set_

template<typename GUM_SCALAR >
HashTable< std::string, CompleteProjectionSet* > gum::CompleteProjectionRegister4MultiDim< GUM_SCALAR >::_set_
private

A mapping from the types of MultiDimImplementations to projection operators.

In this type, the strings represent the very types of the MultiDimImplementations that will be combined. Hence, to a subtype of MultiDimImplementation is associated a function to project this subtype of hypermatrix (the CompleteProjectionPtr)

Definition at line 199 of file completeProjectionRegister4MultiDim.h.


The documentation for this class was generated from the following file: