48#ifndef GUM_MULTI_DIM_ARRAY_H
49#define GUM_MULTI_DIM_ARRAY_H
59 template <
typename GUM_SCALAR >
74 template <
typename GUM_SCALAR >
77 template <
typename GUM_SCALARBIS >
136 virtual void apply(std::function< GUM_SCALAR(GUM_SCALAR) > f)
const;
143 virtual GUM_SCALAR
reduce(std::function< GUM_SCALAR(GUM_SCALAR, GUM_SCALAR) > f,
144 GUM_SCALAR base)
const;
164 virtual void fill(
const GUM_SCALAR& d)
const;
169 virtual const std::string&
name()
const;
276#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
Base class for discrete random variable.
Class for assigning/browsing values to tuples of discrete variables.
const GUM_SCALAR & getByOffset(Idx offset) const
Returns the element stored in the multidimArray at a given offset.
virtual void erase(const DiscreteVariable &v)
Removes a variable.
void commitMultipleChanges_() final
Synchronize content after MultipleChanges.
const GUM_SCALAR & unsafeGet(Idx offset) const
Returns the element stored in the multidimArray at a given offset.
virtual void copyFrom(const MultiDimContainer< GUM_SCALAR > &src) const
Copy from a other MultiDimContainer.
friend class MultiDimBijArray
virtual ~MultiDimArray()
Copy operator.
virtual void apply(std::function< GUM_SCALAR(GUM_SCALAR) > f) const
Apply a function on every element of the container.
std::vector< GUM_SCALAR > values_
The true data : the values is mutable since we can change the value / in a const multiDimArray.
void setByOffset(Idx offset, const GUM_SCALAR &val)
Modifies the element stored in the multidimArray at a given offset.
virtual void fill(const GUM_SCALAR &d) const
Fills the MultiDimArray with the given value.
virtual GUM_SCALAR reduce(std::function< GUM_SCALAR(GUM_SCALAR, GUM_SCALAR) > f, GUM_SCALAR base) const
compute lfold for this container
MultiDimArray()
Default constructor.
virtual Size realSize() const
Returns the real size of this MultiDimArray.
void replace_(const DiscreteVariable *x, const DiscreteVariable *y) final
Replace variable x by y.
GUM_SCALAR & get_(const Instantiation &i) const final
Return a data, given a Instantiation.
virtual const std::string & name() const
Returns the MultiDimArray name.
void unsafeSet(Idx offset, const GUM_SCALAR &val)
Modifies the element stored in the multidimArray at a given offset.
virtual void add(const DiscreteVariable &v)
Adds a variable.
virtual MultiDimContainer< GUM_SCALAR > * newFactory() const
Default constructor.
Decorator of a MultiDimArray, using a bijection over the variables.
Abstract base class for all multi dimensionnal containers.
MultiDimWithOffset()
Class constructor.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
Implementation of the MultiDimArray class.
Headers of the MultiDimWithOffset class.
gum is the global namespace for all aGrUM entities