48#ifndef GUM_MULTI_DIM_IMPLEMENTATION_H
49#define GUM_MULTI_DIM_IMPLEMENTATION_H
84 template <
typename GUM_SCALAR >
127 virtual const std::string&
name()
const = 0;
186 virtual bool empty()
const override;
319 template <
typename GUM_SCALAR >
Base class for discrete random variable.
Class for assigning/browsing values to tuples of discrete variables.
Generic doubly linked lists.
MultiDimContainer()
Default constructor.
virtual GUM_SCALAR get(const Instantiation &i) const
<agrum/base/multidim/multiDimImplementation.h>
virtual bool empty() const override
Returns true if no var is in *this.
virtual const std::string & name() const =0
Returns the real name of the multiDim implementation.
void _setNotCommitedChange_()
Change the internalChangeState to NOT_COMMITTED_CHANGE.
virtual void invert_(Idx p1, Idx p2)
Inverts variables at position p1 and p2.
virtual ~MultiDimImplementation()
Class destructor.
const std::string & basename() const
Returns the base class name of this MultiDimImplementation.
virtual const MultiDimImplementation< GUM_SCALAR > * content() const final
Returns the implementation for this object (may be *this).
virtual MultiDimContainer< GUM_SCALAR > * newFactory() const override=0
Creates an empty clone of this MultiDimContainer.
const DiscreteVariable & variable(const std::string &name) const override
Returns the variable with the name.
virtual Size realSize() const =0
Returns the real number of parameters used for this table.
MultiDimImplementation()
Default constructor.
Sequence< const DiscreteVariable * > _vars_
virtual Idx nbrDim() const override
Returns the number of vars in the multidimensional container.
_InternalChangeState_ _internalChangeState_
virtual void add(const DiscreteVariable &v) override
Adds a new var to the variables of the multidimensional matrix.
virtual void commitMultipleChanges_()
Synchronize content after MultipleChanges.
float compressionRate() const
The compression ratio of the table (depending on the type of implementation).
const List< Instantiation * > & slaves_() const
Returns a constant reference over the list of slaved instantiations.
bool isCommitNeeded_() const
Get the actual state of *this.
virtual Size domainSize() const override
Returns the product of the variables domain size.
List< Instantiation * > _slaveInstantiations_
virtual void replace_(const DiscreteVariable *x, const DiscreteVariable *y) override
Replace variable x by y.
_InternalChangeMethod_
Used to represent in which change method this MultiDimImplementation is.
virtual const Sequence< const DiscreteVariable * > & variablesSequence() const override
Returns a const ref to the sequence of DiscreteVariable*.
virtual void erase(const DiscreteVariable &v) override
Removes a var from the variables of the multidimensional matrix.
_InternalChangeMethod_ _internalChangeMethod_
virtual bool contains(const DiscreteVariable &v) const override
Returns true if var is in *this.
virtual bool registerSlave(Instantiation &slave) override
Register i as a slave of this MultiDimAdressable.
void endMultipleChanges() override
Call this method after doing important changes in this MultiDimContainer.
void endMultipleChanges(const GUM_SCALAR &) override
Call this method after doing important changes in this MultiDimContainer.
_InternalChangeState_
Used to represent in which change state this MultiDimImplementation is.
MultiDimImplementation(const MultiDimImplementation< GUM_SCALAR > &from)
Copy constructor.
const DiscreteVariable & variable(Idx i) const override
Returns a const ref to the ith var.
virtual bool unregisterSlave(Instantiation &slave) override
Unregister i as a slave of this MultiDimAdressable.
virtual Idx pos(const DiscreteVariable &v) const override
Returns the index of a variable.
void beginMultipleChanges() override
Call this method before doing important changes in this MultiDimContainer.
virtual void commitMultipleChanges_(const GUM_SCALAR &value)
Synchronize content after MultipleChanges.
bool isInMultipleChangeMethod_() const
Get the actual change method of this MultiDimImplementation.
The generic class for storing (ordered) sequences of objects.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
Headers of the MultiDimContainer class.
Implementation of gum::MultiDimImplementation.
gum is the global namespace for all aGrUM entities
std::ostream & operator<<(std::ostream &stream, const AVLTree< Val, Cmp > &tree)
display the content of a tree