34 template <
typename GUM_SCALAR >
43 template <
typename GUM_SCALAR >
54 template <
typename GUM_SCALAR >
63 template <
typename GUM_SCALAR >
77 template <
typename GUM_SCALAR >
79 const GUM_SCALAR& value)
const {
97 template <
typename GUM_SCALAR >
107 template <
typename GUM_SCALAR >
116 template <
typename GUM_SCALAR >
123 template <
typename GUM_SCALAR >
129 template <
typename GUM_SCALAR >
134 template <
typename GUM_SCALAR >
141 template <
typename GUM_SCALAR >
143 static const std::string str =
"MultiDimSparse";
147 template <
typename GUM_SCALAR >
153 template <
typename GUM_SCALAR >
157 "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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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)