44 class MultiDimAdressable;
712 virtual bool empty()
const;
945 #ifndef GUM_NO_INLINE const DiscreteVariable & variable(Idx i) const
Returns the variable at position i in the tuple.
void __chgVal(Idx varPos, Idx newVal)
Change the value of a variable.
Idx nbrDim() const
Returns the number of variables in the SetInst.
void clear()
Erase all variables from an SetInst.
void __erase(const DiscreteVariable &v)
Removes a variable from the sequence of vars.
Size domainSize() const
Returns the product of the variable's domain size in the SetInst.
virtual bool empty() const
Returns true if the SetInst is empty.
static void assign_values(Bijection< const DiscreteVariable *, const DiscreteVariable * > &bij, const SetInst &i, SetInst &j)
Assign the values of i in j, using bij as a bijection between i and j variables.
SetInst & chgVal(const DiscreteVariable &v, Idx newVal)
Assign newVal to variable v in the SetInst.
The generic class for storing (ordered) sequences of objects.
void add(const DiscreteVariable &v)
Adds a new variable in the SetInst.
SetInst & remVal(const DiscreteVariable &v, Idx newVal)
Remove newVal from the variable v in the SetInst.
Base class for discrete random variable.
bool end() const
Returns true if the SetInst reached the end.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool rend() const
Returns true if the SetInst reached the rend.
std::string toString() const
Give a string version of SetInst.
bool contains(const DiscreteVariable &v) const
Indicates whether a given variable belongs to the SetInst.
const Sequence< const DiscreteVariable *> & variablesSequence() const
Returns the sequence of DiscreteVariable of this SetInst.
std::ostream & operator<<(std::ostream &output, const BayesNet< GUM_SCALAR > &bn)
Prints map's DAG in output using the Graphviz-dot format.
virtual void _replace(const DiscreteVariable *x, const DiscreteVariable *y)
Class for assigning/browsing values to tuples of discrete variables.
void __swap(Idx i, Idx j)
Swap 2 vars in the SetInst.
void __add(const DiscreteVariable &v)
Adds a new var to the sequence of vars.
Set of pairs of elements with fast search for both elements.
SetInst & interVal(const DiscreteVariable &v, Idx newVal)
Does an intersection (binary and) between the old value and new value.
void unsetOverflow()
Removes the flag overflow.
std::vector< Size > __vals
The current SetInst: the value of the tuple.
bool __overflow
The overflow flag.
Abstract base class for all multi dimensionnal addressable.
SetInst & remVals(const DiscreteVariable &v, const Size newVal)
Remove newVal from the variable v in the SetInst.
Class for assigning/browsing values to tuples of discrete variables.
Sequence< const DiscreteVariable *> __vars
The tuple of variables to be instantiated.
void erase(const DiscreteVariable &v)
Removes a variable from the SetInst.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Idx pos(const DiscreteVariable &v) const
Returns the position of the variable v.
SetInst & chgVals(const DiscreteVariable &v, const Size newVal)
Assign newVal to variable v in the SetInst.
Idx nbrOccurences(const DiscreteVariable &var) const
Returns the current value of the variable at position i.
Size vals(Idx i) const
Returns the current value of the variable at position i.
SetInst & chgDifVal(Idx varPos, const Size newVal)
Does the difference (binary or) between the old value and new value.
void unsetEnd()
Alias for unsetOverflow().
SetInst & addVal(const DiscreteVariable &v, Idx newVal)
Add newVal to variable v in the SetInst.
SetInst()
Default constructor: creates an empty tuple.
Size Idx
Type for indexes.
bool inOverflow() const
Indicates whether the current value of the tuple is correct or not.
Idx val(Idx i) const
Returns the current value of a variable at a given position.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
void __init(MultiDimAdressable *master)
Intialize the SetInst.
SetInst & interVals(const DiscreteVariable &v, const Size newVal)
Does an intersection (binary and) between the old value and new value.
MultiDimInterface & operator>>(MultiDimInterface &c, const DiscreteVariable &v)
Removes a var from the variables of the MutliDimAdressing.
SetInst & chgValIn(const SetInst &i)
Change all the values to match does in i.
SetInst & addVals(const DiscreteVariable &v, const Size newVal)
Add newVal to variable v in the SetInst.
SetInst & operator=(const SetInst &aI)
Copy operator.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void __chgVals(Idx varPos, const Size newVal)
Change the value of a variable.
~SetInst()
Class destructor.
void reorder(const Sequence< const DiscreteVariable * > &v)
Reorder the variables given v.