aGrUM  0.16.0
multiDimICIModel.h
Go to the documentation of this file.
1 
36 #ifndef GUM_MULTI_DIM_ICI_MODEL_H
37 #define GUM_MULTI_DIM_ICI_MODEL_H
38 
39 #include <agrum/core/bijection.h>
41 
42 namespace gum {
43 
44  // ===========================================================================
45  // === GUM_MULTI_DIM_AGGREGATOR ===
46  // ===========================================================================
47  // clang-format off
58  // clang-format on
59  template < typename GUM_SCALAR >
60  class MultiDimICIModel : public MultiDimReadOnly< GUM_SCALAR > {
61  public:
62  // ============================================================================
64  // ============================================================================
66 
70  MultiDimICIModel(GUM_SCALAR external_weight,
71  GUM_SCALAR default_weight = (GUM_SCALAR)1.0);
72 
77 
86  const MultiDimICIModel< GUM_SCALAR >& from);
87 
91  virtual ~MultiDimICIModel();
92 
94  // ============================================================================
96  // ============================================================================
98 
99  public:
100  const std::string toString() const override;
101 
102  // @todo : optimisation with a always up-to-date value associated to each
103  // instantiation
105  const gum::DiscreteVariable* const,
106  gum::Idx,
107  gum::Idx) override{};
108 
109  virtual void setFirstNotification(const gum::Instantiation&) override{};
110 
111  virtual void setLastNotification(const gum::Instantiation&) override{};
112 
113  virtual void setIncNotification(const gum::Instantiation&) override{};
114 
115  virtual void setDecNotification(const gum::Instantiation&) override{};
116 
117  virtual void setChangeNotification(const gum::Instantiation&) override{};
118 
119  const std::string toString(const gum::Instantiation* i) const override {
120  return i->toString();
121  };
122 
132  virtual void
133  copyFrom(const MultiDimContainer< GUM_SCALAR >& src) const override;
134 
139  virtual Size realSize() const override { return this->nbrDim(); };
140 
141  GUM_SCALAR causalWeight(const DiscreteVariable& v) const;
142 
143  void causalWeight(const DiscreteVariable& v, GUM_SCALAR w) const;
144 
145  GUM_SCALAR externalWeight() const;
146 
147  void externalWeight(GUM_SCALAR w) const;
148 
160  virtual const std::string& name() const override;
161 
163  protected:
165  mutable GUM_SCALAR __external_weight;
166 
167  // ============================================================================
169  // ============================================================================
171 
173  mutable GUM_SCALAR __default_weight;
174 
177 
178  virtual void _replace(const DiscreteVariable* x,
179  const DiscreteVariable* y) override;
180  };
181 
182 
183 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
184  extern template class MultiDimICIModel< double >;
185 #endif
186 
187 } /* namespace gum */
188 
190 
191 #endif /* GUM_MULTI_DIM_ICI_MODEL_H */
virtual ~MultiDimICIModel()
Destructor.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
HashTable< const DiscreteVariable *, GUM_SCALAR > __causal_weights
in Henrion (89) in a hashtable with a default_value.
virtual void setIncNotification(const gum::Instantiation &) override
Copy of a multiDimICIModel.
virtual void setDecNotification(const gum::Instantiation &) override
Copy of a multiDimICIModel.
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.
Abstract base class for all multi dimensionnal read only structure.
GUM_SCALAR __external_weight
in Henrion (89).
The class for generic Hash Tables.
Definition: hashTable.h:679
GUM_SCALAR externalWeight() const
Copy of a multiDimICIModel.
const std::string toString(const gum::Instantiation *i) const override
Copy of a multiDimICIModel.
virtual void changeNotification(const gum::Instantiation &, const gum::DiscreteVariable *const, gum::Idx, gum::Idx) override
Copy of a multiDimICIModel.
abstract class for Conditional Indepency Models
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
GUM_SCALAR __default_weight
in Henrion (89) in a hashtable with a default_value.
virtual Size realSize() const override
std::string toString() const
Give a string version of instantiation.
virtual const std::string & name() const override
returns the real name of the multiDimArray
Set of pairs of elements with fast search for both elements.
Definition: bijection.h:1805
virtual void _replace(const DiscreteVariable *x, const DiscreteVariable *y) override
Replace variable x by y.
virtual void copyFrom(const MultiDimContainer< GUM_SCALAR > &src) const override
Copy of a multiDimICIModel.
const std::string toString() const override
Copy of a multiDimICIModel.
virtual Idx nbrDim() const override
Returns the number of vars in the multidimensional container.
Class for assigning/browsing values to tuples of discrete variables.
Definition: instantiation.h:83
virtual void setFirstNotification(const gum::Instantiation &) override
Copy of a multiDimICIModel.
GUM_SCALAR causalWeight(const DiscreteVariable &v) const
Copy of a multiDimICIModel.
MultiDimICIModel(GUM_SCALAR external_weight, GUM_SCALAR default_weight=(GUM_SCALAR) 1.0)
Default constructor.
Size Idx
Type for indexes.
Definition: types.h:53
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
virtual void setChangeNotification(const gum::Instantiation &) override
Copy of a multiDimICIModel.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual void setLastNotification(const gum::Instantiation &) override
Copy of a multiDimICIModel.