aGrUM  0.16.0
amplitude.h
Go to the documentation of this file.
1 
30 #ifndef GUM_AMPLITUDE_AGGREGATOR_H
31 #define GUM_AMPLITUDE_AGGREGATOR_H
32 
34 
35 namespace gum {
36 
37  namespace aggregator {
38  // =========================================================================
39  // === GUM_AMPLITUDE_AGGREGATOR ===
40  // =========================================================================
41 
54  template < typename GUM_SCALAR >
55  class Amplitude : public MultiDimAggregator< GUM_SCALAR > {
56  public:
57  Amplitude();
58 
60 
61  virtual ~Amplitude();
62 
63  virtual std::string aggregatorName() const;
64 
83 
84  protected:
85  virtual Idx _buildValue(const gum::Instantiation& i) const;
86 
87  // fold scheme is not used, these methods are neutralized
88  virtual Idx _neutralElt() const { return 0; };
89  virtual Idx _fold(const DiscreteVariable& v,
90  Idx i1,
91  Idx i2,
92  bool& stop_iteration) const;
93 
94  private:
96  };
97 
98 
99 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
100  extern template class Amplitude< double >;
101 #endif
102 
103  } // namespace aggregator
104 } // namespace gum
105 
107 
108 #endif // GUM_AMPLITUDE_AGGREGATOR_H
virtual Idx _neutralElt() const
_neutralElt() is the result value for the first application of _fold
Definition: amplitude.h:88
virtual Idx _fold(const DiscreteVariable &v, Idx i1, Idx i2, bool &stop_iteration) const
_fold is applied on value i1 for variable v. the actual result for precedent applications is i2...
Definition: amplitude_tpl.h:88
Base class for discrete random variable.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Abstract base class for all multi dimensionnal containers.
<agrum/multidim/aggregators/multiDimAggregator.h>
virtual MultiDimContainer< GUM_SCALAR > * newFactory() const
This method creates a clone of this object, withouth its content (including variable), you must use this method if you want to ensure that the generated object has the same type than the object containing the called newFactory() For example :
Definition: amplitude_tpl.h:67
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Class for assigning/browsing values to tuples of discrete variables.
Definition: instantiation.h:83
Size Idx
Type for indexes.
Definition: types.h:53
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
amplitude aggregator
Definition: amplitude.h:55
virtual Idx _buildValue(const gum::Instantiation &i) const
by default, _buildValue uses a "fold" scheme and the user has to implement _neutralElt and _fold but ...
Definition: amplitude_tpl.h:72
virtual std::string aggregatorName() const
Definition: amplitude_tpl.h:59