aGrUM  0.16.0
projectionPattern4MultiDimImplementation.h
Go to the documentation of this file.
1 
31 // check if we allowed these patterns to be used
32 #ifndef GUM_PROJECTION_PATTERN_ALLOWED
33 
34 // #warning To use projectionPattern4MultiDimImplementation.h, you must define
35 // GUM_PROJECTION_PATTERN_ALLOWED
36 
37 #else
38 
39 namespace gum {
40 
41 # ifdef GUM_MULTI_DIM_PROJECTION_NAME
42  template < typename GUM_SCALAR >
43  MultiDimImplementation< GUM_SCALAR >* GUM_MULTI_DIM_PROJECTION_NAME(
44  const MultiDimImplementation< GUM_SCALAR >& ttable,
45  const Set< const DiscreteVariable* >& del_vars) {
46 # endif
47 
49 
50  // get the appropriate function to perform the operation
51  try {
52  // try to find func(ttable,del_vars) in the register
54  GUM_MULTI_DIM_PROJECTION_FUNC_NAME, ttable.name());
55  } catch (NotFound&) {
57  GUM_MULTI_DIM_PROJECTION_FUNC_NAME, ttable.basename());
58  }
59 
60  // perform the projection
61  return func(&ttable, del_vars);
62  }
63 } // namespace gum
64 #endif /* GUM_PROJECTION_PATTERN_ALLOWED */
static ProjectionRegister4MultiDim & Register()
a named constructor that constructs one and only one Register per data type
MultiDimImplementation< GUM_SCALAR > *(* ProjectionPtr)(const MultiDimImplementation< GUM_SCALAR > *, const Set< const DiscreteVariable * > &)
the type of functions used by the register
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
ProjectionPtr get(const std::string &projection_name, const std::string &type_multidim) const
returns the specialized projection operator assigned to a given type of MultiDimImplementation ...