aGrUM  0.16.0
or_tpl.h
Go to the documentation of this file.
1 
30 #include <sstream>
31 // to ease parser in IDEs
33 
34 namespace gum {
35 
36  namespace aggregator {
37  template < typename GUM_SCALAR >
38  INLINE Or< GUM_SCALAR >::Or() : MultiDimAggregator< GUM_SCALAR >() {
39  GUM_CONSTRUCTOR(Or);
40  }
41 
42  template < typename GUM_SCALAR >
43  INLINE Or< GUM_SCALAR >::Or(const Or< GUM_SCALAR >& from) :
44  MultiDimAggregator< GUM_SCALAR >(from) {
45  GUM_CONS_CPY(Or);
46  }
47 
48  template < typename GUM_SCALAR >
50  GUM_DESTRUCTOR(Or);
51  }
52 
53  template < typename GUM_SCALAR >
55  return (Idx)0;
56  }
57 
58  template < typename GUM_SCALAR >
60  Idx i1,
61  Idx i2,
62  bool& stop_iteration) const {
63  if (i1 != 1) {
64  return (Idx)0;
65  } else {
66  stop_iteration = true;
67  return (Idx)1;
68  }
69  }
70 
71  template < typename GUM_SCALAR >
72  INLINE std::string Or< GUM_SCALAR >::aggregatorName() const {
73  return std::string("or");
74  }
75 
76  template < typename GUM_SCALAR >
78  return new Or< GUM_SCALAR >();
79  }
80 
81  } // namespace aggregator
82 } // namespace gum
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: or_tpl.h:59
virtual Idx _neutralElt() const
_neutralElt() is the result value for the first application of _fold
Definition: or_tpl.h:54
or aggregator
Definition: or.h:56
virtual ~Or()
Definition: or_tpl.h:49
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 std::string aggregatorName() const
Definition: or_tpl.h:72
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 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: or_tpl.h:77