58 template <
typename GUM_SCALAR >
65 template <
typename GUM_SCALAR >
73 template <
typename GUM_SCALAR >
78 template <
typename GUM_SCALAR >
84 template <
typename GUM_SCALAR >
87 template <
typename GUM_SCALAR >
99 return (i.
val(agg) == current) ? (GUM_SCALAR)1.0 : (GUM_SCALAR)0.0;
102 template <
typename GUM_SCALAR >
107 for (
Idx i = 1; i < this->
nbrDim(); i++) {
118 template <
typename GUM_SCALAR >
122 if (p->name() != this->name()) {
124 "Can not copy from a " << p->name() <<
" to a " << this->name());
132 template <
typename GUM_SCALAR >
138 template <
typename GUM_SCALAR >
140 static const std::string str =
"MultiDimAggregator";
144 template <
typename GUM_SCALAR >
150 template <
typename GUM_SCALAR >
155 template <
typename GUM_SCALAR >
161 template <
typename GUM_SCALAR >
164 template <
typename GUM_SCALAR >
167 template <
typename GUM_SCALAR >
170 template <
typename GUM_SCALAR >
173 template <
typename GUM_SCALAR >
176 template <
typename GUM_SCALAR >
181 template <
typename GUM_SCALAR >
Base class for discrete random variable.
virtual Size domainSize() const =0
Class for assigning/browsing values to tuples of discrete variables.
Idx val(Idx i) const
Returns the current value of the variable at position i.
std::string toString() const
Give a string version of instantiation.
virtual void copyFrom(const MultiDimContainer< GUM_ELEMENT > &src) const
Basic copy of a MultiDimContainer.
void add(const DiscreteVariable &v) override
Adds a new var to the variables of the multidimensional matrix.
const DiscreteVariable & variable(Idx i) const override
Returns a const ref to the ith var.
Idx nbrDim() const override
Returns the number of vars in the multidimensional container.
Abstract base class for all multi dimensionnal read only structure.
MultiDimReadOnly()
Default constructor.
Exception : operation not allowed.
~MultiDimAggregator() override
Class destructor.
void setFirstNotification(const gum::Instantiation &) override
Adds a variable: the first one is the aggregator, the next ones are its parents.
GUM_ELEMENT get(const Instantiation &i) const override
Adds a variable: the first one is the aggregator, the next ones are its parents.
void setChangeNotification(const gum::Instantiation &) override
Adds a variable: the first one is the aggregator, the next ones are its parents.
bool isDecomposable() const
virtual Idx buildValue_(const gum::Instantiation &i) const =0
void setIncNotification(const gum::Instantiation &) override
Adds a variable: the first one is the aggregator, the next ones are its parents.
void changeNotification(const gum::Instantiation &, const gum::DiscreteVariable *const, gum::Idx, gum::Idx) override
Adds a variable: the first one is the aggregator, the next ones are its parents.
MultiDimAggregator()
Default constructor.
std::string toString() const override
Adds a variable: the first one is the aggregator, the next ones are its parents.
void setDecNotification(const gum::Instantiation &) override
Adds a variable: the first one is the aggregator, the next ones are its parents.
void setLastNotification(const gum::Instantiation &) override
Adds a variable: the first one is the aggregator, the next ones are its parents.
virtual std::optional< Idx > value() const
Returns the scalar parameter of this aggregator, if it has one.
Size realSize() const override
void add(const DiscreteVariable &v) override
Adds a variable: the first one is the aggregator, the next ones are its parents.
virtual std::string aggregatorName() const=0
void copyFrom(const MultiDimContainer< GUM_ELEMENT > &src) const override
Copy of a multiDimICIModel.
const std::string & name() const override
Returns the real name of the multiDimArray.
bool decomposable_
decomposable_ indicates if the aggregator can be decomposed
virtual void checkVariable_(const DiscreteVariable &v) const
Checks that a variable can be added to this aggregator (nothing by default).
#define GUM_ERROR(type, msg)
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
Aggregators are functional description of CPTs.
std::ostream & operator<<(std::ostream &s, const MultiDimAggregator< GUM_ELEMENT > &ag)
For friendly displaying the content of the array.
gum is the global namespace for all aGrUM entities