aGrUM  0.16.0
min_tpl.h
Go to the documentation of this file.
1 
30 // to ease parser in IDEs
33 
34 namespace gum {
35 
36  namespace aggregator {
37 
38  // Default constructor
39  template < typename GUM_SCALAR >
40  INLINE Min< GUM_SCALAR >::Min() : MultiDimAggregator< GUM_SCALAR >() {
41  GUM_CONSTRUCTOR(Min);
42  }
43 
44  // Default constructor
45  template < typename GUM_SCALAR >
47  MultiDimAggregator< GUM_SCALAR >(from) {
48  GUM_CONS_CPY(Min);
49  }
50 
51  // destructor
52  template < typename GUM_SCALAR >
54  GUM_DESTRUCTOR(Min);
55  }
56 
57  template < typename GUM_SCALAR >
59  return std::numeric_limits< Idx >::max();
60  }
61 
62  template < typename GUM_SCALAR >
64  Idx i1,
65  Idx i2,
66  bool& stop_iteration) const {
67  return (i1 < i2) ? i1 : i2;
68  }
69 
70  template < typename GUM_SCALAR >
71  INLINE std::string Min< GUM_SCALAR >::aggregatorName() const {
72  return "min";
73  }
74 
75  template < typename GUM_SCALAR >
77  return new Min< GUM_SCALAR >;
78  }
79 
80  } // namespace aggregator
81 } // namespace gum
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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
<agrum/multidim/aggregators/multiDimAggregator.h>
virtual Idx _neutralElt() const
_neutralElt() is the result value for the first application of _fold
Definition: min_tpl.h:58
virtual ~Min()
Definition: min_tpl.h:53
virtual std::string aggregatorName() const
Definition: min_tpl.h:71
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Size Idx
Type for indexes.
Definition: types.h:53
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: min_tpl.h:63
min aggregator
Definition: min.h:53
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()
Definition: min_tpl.h:76