49#ifndef GUM_MULTI_DIM_WITH_OFFSET_H
50#define GUM_MULTI_DIM_WITH_OFFSET_H
72 template <
typename GUM_ELEMENT >
119 void fill(
const GUM_ELEMENT& d)
const override = 0;
126 Idx newval)
override;
Base class for discrete random variable.
The class for generic Hash Tables.
Class for assigning/browsing values to tuples of discrete variables.
Abstract base class for all multi dimensionnal containers.
virtual std::string toString() const
Returns a representation of this MultiDimContainer.
MultiDimImplementation()
Default constructor.
Size getOffs_(const Instantiation &i) const
Compute the offset of a Instantiation.
void erase(const DiscreteVariable &v) override
Removes a var from the variables of the multidimensional matrix.
~MultiDimWithOffset() override
Class destrucor.
void setFirstNotification(const Instantiation &i) override
Listen to setFirst in a given Instantiation.
MultiDimWithOffset()
Class constructor.
MultiDimContainer< GUM_ELEMENT > * newFactory() const override=0
Class constructor.
void setLastNotification(const Instantiation &i) override
Listen to setLast in a given Instantiation.
bool registerSlave(Instantiation &i) override
Register i as a slave of this MultiDimAdressable.
void setIncNotification(const Instantiation &i) override
Listen to increment in a given Instantiation.
HashTable< const DiscreteVariable *, Size > gaps_
The gaps between consecutive values of a given variable.
void setDecNotification(const Instantiation &i) override
Listen to increment in each recorded Instantiation.
void setChangeNotification(const Instantiation &i) override
Listen to an assignment of a value in a Instantiation.
MultiDimWithOffset< GUM_ELEMENT > & operator=(const MultiDimWithOffset< GUM_ELEMENT > &from)
Copy operator.
bool unregisterSlave(Instantiation &i) override
Unregister i as a slave of this MultiDimAdressable.
void changeNotification(const Instantiation &i, const DiscreteVariable *const var, Idx oldval, Idx newval) override
Listen to changes in a given Instantiation.
HashTable< const Instantiation *, Size > offsets_
The position in the array of each slave Instantiation.
Size toOffset(const Instantiation &i) const
Compute offset from an Instantiation (in this array).
void computeInstantiationValue_(Instantiation &result, Size indice) const
For a given index of a value in the vector values, this method computes the corresponding instantiati...
void fill(const GUM_ELEMENT &d) const override=0
Fill the table with d.
GUM_ELEMENT & get_(const Instantiation &i) const override=0
Return a data, given a Instantiation.
void add(const DiscreteVariable &v) override
Adds a new var to the variables of the multidimensional matrix.
Instantiation & fromOffset(Instantiation &i, Size offset) const
Set the Instantiation to the values corresponding to the offset (in this array).
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
Headers of gum::MultiDimImplementation.
Headers of the MultiDimWithOffset class.
gum is the global namespace for all aGrUM entities