29 #ifndef GUM_MULTI_DIM_ARRAY_H 30 #define GUM_MULTI_DIM_ARRAY_H 38 template <
typename GUM_SCALAR >
53 template <
typename GUM_SCALAR >
56 template <
typename GUM_SCALARBIS >
115 virtual void apply(std::function< GUM_SCALAR(GUM_SCALAR) > f)
const;
123 reduce(std::function< GUM_SCALAR(GUM_SCALAR, GUM_SCALAR) > f,
124 GUM_SCALAR base)
const;
144 virtual void fill(
const GUM_SCALAR& d)
const;
149 virtual const std::string&
name()
const;
256 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS std::vector< GUM_SCALAR > _values
The true data : the values is mutable since we can change the value / in a const multiDimArray.
virtual Size realSize() const
Returns the real size of this MultiDimArray.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Decorator of a MultiDimArray, using a bijection over the variables.
virtual void erase(const DiscreteVariable &v)
Removes a variable.
virtual GUM_SCALAR & _get(const Instantiation &i) const
Return a data, given a Instantiation.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual void copyFrom(const MultiDimContainer< GUM_SCALAR > &src) const
Copy from a other MultiDimContainer.
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 apply(std::function< GUM_SCALAR(GUM_SCALAR) > f) const
Apply a function on every element of the container.
void unsafeSet(Idx offset, const GUM_SCALAR &val)
Modifies the element stored in the multidimArray at a given offset.
virtual ~MultiDimArray()
Copy operator.
virtual void _commitMultipleChanges()
Synchronize content after MultipleChanges.
void setByOffset(Idx offset, const GUM_SCALAR &val)
Modifies the element stored in the multidimArray at a given offset.
Abstract class for Multidimensional matrix stored as an array in memory and with an offset associated...
virtual GUM_SCALAR reduce(std::function< GUM_SCALAR(GUM_SCALAR, GUM_SCALAR) > f, GUM_SCALAR base) const
compute lfold for this container
virtual void fill(const GUM_SCALAR &d) const
Fills the MultiDimArray with the given value.
Multidimensional matrix stored as an array in memory.
virtual MultiDimContainer< GUM_SCALAR > * newFactory() const
Default constructor.
virtual void _replace(const DiscreteVariable *x, const DiscreteVariable *y)
Replace variable x by y.
virtual const std::string & name() const
Returns the MultiDimArray name.
const GUM_SCALAR & getByOffset(Idx offset) const
Returns the element stored in the multidimArray at a given offset.
Class for assigning/browsing values to tuples of discrete variables.
MultiDimArray()
Default constructor.
Size Idx
Type for indexes.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
const GUM_SCALAR & unsafeGet(Idx offset) const
Returns the element stored in the multidimArray at a given offset.
virtual void add(const DiscreteVariable &v)
Adds a variable.