aGrUM  0.14.2
exists.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Pierre-Henri WUILLEMIN et Christophe GONZALES *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
27 #ifndef GUM_EXISTS_AGGREGATOR_H
28 #define GUM_EXISTS_AGGREGATOR_H
29 
31 
32 namespace gum {
33 
34  namespace aggregator {
35  // =========================================================================
36  // === GUM_MAX_AGGREGATOR ===
37  // =========================================================================
50  template < typename GUM_SCALAR >
51  class Exists : public MultiDimAggregator< GUM_SCALAR > {
52  public:
53  Exists(Idx value);
54  Exists(const Exists< GUM_SCALAR >& from);
55  virtual ~Exists();
56 
75 
76  virtual std::string aggregatorName() const;
77 
78  protected:
79  virtual Idx _neutralElt() const;
80  virtual Idx _fold(const DiscreteVariable& v,
81  Idx i1,
82  Idx i2,
83  bool& stop_iteration) const;
84 
85  private:
87  };
88 
89 
90 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
91  extern template class Exists< double >;
92 #endif
93 
94 
95  } // namespace aggregator
96 } // namespace gum
97 
99 
100 #endif // GUM_EXISTS_AGGREGATOR_H
virtual Idx _neutralElt() const
_neutralElt() is the result value for the first application of _fold
Definition: exists_tpl.h:53
virtual std::string aggregatorName() const
Definition: exists_tpl.h:74
Base class for discrete random variable.
forall aggregator
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
Abstract base class for all multi dimensionnal containers.
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: exists_tpl.h:58
<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()
Definition: exists_tpl.h:82
exists aggregator
Definition: exists.h:51
MultiDimAggregator.
Size Idx
Type for indexes.
Definition: types.h:50