31 template <
typename GUM_SCALAR >
40 template <
typename GUM_SCALAR >
51 template <
typename GUM_SCALAR >
60 template <
typename GUM_SCALAR >
74 template <
typename GUM_SCALAR >
76 const GUM_SCALAR& value)
const {
94 template <
typename GUM_SCALAR >
104 template <
typename GUM_SCALAR >
113 template <
typename GUM_SCALAR >
120 template <
typename GUM_SCALAR >
126 template <
typename GUM_SCALAR >
131 template <
typename GUM_SCALAR >
138 template <
typename GUM_SCALAR >
140 static const std::string str =
"MultiDimSparse";
144 template <
typename GUM_SCALAR >
150 template <
typename GUM_SCALAR >
154 "Do not use this with the MultiDimSparse class.");
GUM_SCALAR _default
The default value.
void erase(const DiscreteVariable &v)
Removes a var from the variables of the multidimensional matrix.
virtual ~MultiDimSparse()
Copy operator.
Size size() const noexcept
Returns the number of elements stored into the hashtable.
HashTable< const Instantiation *, Size > _offsets
The position in the array of each slave Instantiation.
bool exists(const Key &key) const
Checks whether there exists an element with a given key in the hashtable.
Base class for discrete random variable.
gum is the global namespace for all aGrUM entities
Abstract base class for all multi dimensionnal containers.
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
Returns the value pointed by i.
virtual void set(const Instantiation &i, const GUM_SCALAR &value) const
Changes the value pointed by i.
virtual MultiDimContainer< GUM_SCALAR > * newFactory() const
Class constructor.
Abstract class for Multidimensional matrix stored as an array in memory and with an offset associated...
void reset(const Key &key)
Removes a property (i.e., remove an element).
virtual void _replace(const DiscreteVariable *x, const DiscreteVariable *y) override
Replace variable x by y.
void set(const Key &key, const Val &default_value)
Add a new property or modify it if it already existed.
virtual void erase(const DiscreteVariable &v)
Removes a var from the variables of the multidimensional matrix.
Size _getOffs(const Instantiation &i) const
Compute the offset of a Instantiation.
virtual void _commitMultipleChanges()
Synchronise content after MultipleChanges.
void add(const DiscreteVariable &v)
Adds a new var to the variables of the multidimensional matrix.
virtual const std::string & name() const
Returns the real name of the multiDim implementation.
Class for assigning/browsing values to tuples of discrete variables.
MultiDimSparse(const GUM_SCALAR &default_value)
Default constructor: creates an empty null dimensional matrix.
bool isMaster(const MultiDimAdressable *m) const
Indicates whether m is the master of this instantiation.
void clear()
Removes all the elements in the hash table.
virtual GUM_SCALAR & _get(const Instantiation &i) const
HashTable< Size, GUM_SCALAR > _params
The true data : the values is mutable since we can change the value in a const multiDimArray.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
virtual void _replace(const DiscreteVariable *x, const DiscreteVariable *y)
Replace variable x by y.
virtual void fill(const GUM_SCALAR &d) const
Fill the table with d.
virtual Size realSize() const
Returns the real number of parameters used for this table.
Multidimensional matrix stored as a sparse array in memory.
#define GUM_ERROR(type, msg)