29 #ifndef GUM_MULTI_DIM_WITH_OFFSET_H 30 #define GUM_MULTI_DIM_WITH_OFFSET_H 32 #include <agrum/agrum.h> 33 #include <agrum/tools/multidim/implementations/multiDimImplementation.h> 50 template <
typename GUM_SCALAR >
93 virtual void add(
const DiscreteVariable& v);
95 virtual void erase(
const DiscreteVariable& v);
97 virtual void fill(
const GUM_SCALAR& d)
const = 0;
102 const DiscreteVariable*
const var,
195 virtual GUM_SCALAR&
get_(
const Instantiation& i)
const = 0;
199 #include <agrum/tools/multidim/implementations/multiDimWithOffset_tpl.h> virtual void setLastNotification(const Instantiation &i)
Listen to setLast in a given Instantiation.
Instantiation & fromOffset(Instantiation &i, Size offset) const
Set the Instantiation to the values corresponding to the offset (in this array).
void setDecNotification(const Instantiation &i)
Listen to increment in each recorded Instantiation.
Size toOffset(const Instantiation &i) const
Compute offset from an Instantiation (in this array).
virtual bool unregisterSlave(Instantiation &i)
Unregister i as a slave of this MultiDimAdressable.
virtual void fill(const GUM_SCALAR &d) const =0
Fill the table with d.
virtual std::string toString(const Instantiation *i) const
Display the internal representation of i.
virtual void setChangeNotification(const Instantiation &i)
Listen to an assignment of a value in a Instantiation.
INLINE void emplace(Args &&... args)
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 changeNotification(const Instantiation &i, const DiscreteVariable *const var, Idx oldval, Idx newval)
Listen to changes in a given Instantiation.
MultiDimWithOffset< GUM_SCALAR > & operator=(const MultiDimWithOffset< GUM_SCALAR > &from)
Copy operator.
virtual ~MultiDimWithOffset()
Class destrucor.
HashTable< const DiscreteVariable *, Size > gaps_
The gaps between consecutive values of a given variable.
HashTable< const Instantiation *, Size > offsets_
The position in the array of each slave Instantiation.
virtual void add(const DiscreteVariable &v)
Adds a new var to the variables of the multidimensional matrix.
Abstract class for Multidimensional matrix stored as an array in memory and with an offset associated...
MultiDimWithOffset()
Class constructor.
void setIncNotification(const Instantiation &i)
Listen to increment in a given Instantiation.
virtual void erase(const DiscreteVariable &v)
Removes a var from the variables of the multidimensional matrix.
virtual MultiDimContainer< GUM_SCALAR > * newFactory() const =0
Class constructor.
virtual void setFirstNotification(const Instantiation &i)
Listen to setFirst in a given Instantiation.
MultiDimWithOffset(const MultiDimWithOffset< GUM_SCALAR > &from)
Copy constructor.
virtual GUM_SCALAR & get_(const Instantiation &i) const =0
Return a data, given a Instantiation.
virtual bool registerSlave(Instantiation &i)
Register i as a slave of this MultiDimAdressable.