49#ifndef GUM_MULTI_DIM_WITH_OFFSET_H
50#define GUM_MULTI_DIM_WITH_OFFSET_H
72 template <
typename GUM_SCALAR >
119 virtual void fill(
const GUM_SCALAR& d)
const = 0;
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.
HashTable< const Instantiation *, Size > offsets_
The position in the array of each slave Instantiation.
virtual void erase(const DiscreteVariable &v)
Removes a var from the variables of the multidimensional matrix.
HashTable< const DiscreteVariable *, Size > gaps_
The gaps between consecutive values of a given variable.
MultiDimWithOffset< GUM_SCALAR > & operator=(const MultiDimWithOffset< GUM_SCALAR > &from)
Copy operator.
void setIncNotification(const Instantiation &i)
Listen to increment in a given Instantiation.
virtual void setChangeNotification(const Instantiation &i)
Listen to an assignment of a value in a Instantiation.
virtual MultiDimContainer< GUM_SCALAR > * newFactory() const =0
Class constructor.
void setDecNotification(const Instantiation &i)
Listen to increment in each recorded Instantiation.
virtual void setLastNotification(const Instantiation &i)
Listen to setLast in a given Instantiation.
virtual bool unregisterSlave(Instantiation &i)
Unregister i as a slave of this MultiDimAdressable.
virtual void changeNotification(const Instantiation &i, const DiscreteVariable *const var, Idx oldval, Idx newval)
Listen to changes in a given Instantiation.
MultiDimWithOffset()
Class constructor.
Size getOffs_(const Instantiation &i) const
Compute the offset of a Instantiation.
void computeInstantiationValue_(Instantiation &result, Size indice) const
For a given index of a value in the vector values, this method computes the corresponding instantiati...
virtual void add(const DiscreteVariable &v)
Adds a new var to the variables of the multidimensional matrix.
virtual GUM_SCALAR & get_(const Instantiation &i) const =0
Return a data, given a Instantiation.
virtual void setFirstNotification(const Instantiation &i)
Listen to setFirst in a given Instantiation.
virtual bool registerSlave(Instantiation &i)
Register i as a slave of this MultiDimAdressable.
virtual void fill(const GUM_SCALAR &d) const =0
Fill the table with d.
Instantiation & fromOffset(Instantiation &i, Size offset) const
Set the Instantiation to the values corresponding to the offset (in this array).
Size toOffset(const Instantiation &i) const
Compute offset from an Instantiation (in this array).
virtual ~MultiDimWithOffset()
Class destrucor.
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