29 #ifndef GUM_MULTI_DIM_IMPLEMENTATION_H 30 #define GUM_MULTI_DIM_IMPLEMENTATION_H 65 template <
typename GUM_SCALAR >
66 class MultiDimImplementation :
public MultiDimContainer< GUM_SCALAR > {
108 virtual const std::string&
name()
const = 0;
116 const std::string&
basename()
const;
154 virtual void add(
const DiscreteVariable& v)
override;
156 virtual void erase(
const DiscreteVariable& v)
override;
158 virtual const Sequence< const DiscreteVariable* >&
161 virtual const DiscreteVariable&
variable(
Idx i)
const override;
162 virtual const DiscreteVariable&
165 virtual Idx pos(
const DiscreteVariable& v)
const override;
167 virtual bool contains(
const DiscreteVariable& v)
const override;
169 virtual bool empty()
const override;
189 virtual MultiDimContainer< GUM_SCALAR >*
newFactory()
const override = 0;
234 const List< Instantiation* >&
_slaves()
const;
245 virtual void _replace(
const DiscreteVariable* x,
246 const DiscreteVariable* y)
override;
264 virtual const MultiDimImplementation< GUM_SCALAR >*
content() const final;
303 template <
typename GUM_SCALAR >
float compressionRate() const
The compression ratio of the table (depending on the type of implementation).
__InternalChangeState __internalChangeState
The current change state.
virtual void erase(const DiscreteVariable &v) override
Removes a var from the variables of the multidimensional matrix.
The generic class for storing (ordered) sequences of objects.
Size __domainSize
This MultiDimImplementation domain size.
virtual const DiscreteVariable & variable(Idx i) const override
Returns a const ref to the ith var.
bool _isCommitNeeded() const
Get the actual state of *this.
const List< Instantiation *> & _slaves() const
Returns a constant reference over the list of slaved instantiations.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Base class for discrete random variable.
Generic doubly linked lists.
virtual bool unregisterSlave(Instantiation &slave) override
Unregister i as a slave of this MultiDimAdressable.
virtual void _invert(Idx p1, Idx p2)
Inverts variables at position p1 and p2.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual bool empty() const override
Returns true if no var is in *this.
Sequence< const DiscreteVariable *> __vars
List of discrete variables (dimensions).
virtual const MultiDimImplementation< GUM_SCALAR > * content() const final
Returns the implementation for this object (may be *this).
bool _isInMultipleChangeMethod() const
Get the actual change method of this MultiDimImplementation.
std::ostream & operator<<(std::ostream &output, const BayesNet< GUM_SCALAR > &bn)
Prints map's DAG in output using the Graphviz-dot format.
void __setNotCommitedChange()
Change the __internalChangeState to NOT_COMMITTED_CHANGE.
virtual void _replace(const DiscreteVariable *x, const DiscreteVariable *y) override
Replace variable x by y.
MultiDimImplementation()
Default constructor.
virtual const std::string & name() const =0
Returns the real name of the multiDim implementation.
List< Instantiation *> __slaveInstantiations
List of instantiations of the tuples (sequences) of variables.
virtual Size realSize() const =0
Returns the real number of parameters used for this table.
virtual void add(const DiscreteVariable &v) override
Adds a new var to the variables of the multidimensional matrix.
virtual ~MultiDimImplementation()
Class destructor.
virtual void endMultipleChanges() override
Call this method after doing important changes in this MultiDimContainer.
__InternalChangeMethod __internalChangeMethod
The current change method.
virtual const Sequence< const DiscreteVariable *> & variablesSequence() const override
Returns a const ref to the sequence of DiscreteVariable*.
virtual Idx nbrDim() const override
Returns the number of vars in the multidimensional container.
Class for assigning/browsing values to tuples of discrete variables.
virtual void beginMultipleChanges() override
Call this method before doing important changes in this MultiDimContainer.
virtual Size domainSize() const override
Returns the product of the variables domain size.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
__InternalChangeMethod
Used to represent in which change method this MultiDimImplementation is.
virtual void _commitMultipleChanges()
Synchronize content after MultipleChanges.
<agrum/multidim/multiDimImplementation.h>
virtual Idx pos(const DiscreteVariable &v) const override
Returns the index of a variable.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
virtual GUM_SCALAR get(const Instantiation &i) const
Returns the value pointed by i.
virtual bool contains(const DiscreteVariable &v) const override
Returns true if var is in *this.
__InternalChangeState
Used to represent in which change state this MultiDimImplementation is.
virtual MultiDimContainer< GUM_SCALAR > * newFactory() const override=0
Creates an empty clone of this MultiDimContainer.
const std::string & basename() const
Returns the base class name of this MultiDimImplementation.
virtual bool registerSlave(Instantiation &slave) override
Register i as a slave of this MultiDimAdressable.