Set of pairs of elements with fast search for both elements.
Set of pairs of elements with fast search for both elements.
Base class for discrete random variable.
Class for assigning/browsing values to tuples of discrete variables.
Abstract base class for all multi dimensionnal addressable.
The generic class for storing (ordered) sequences of objects.
Class for assigning/browsing values to tuples of discrete variables.
SetInst & interVal(Idx varPos, Idx newVal)
Does an intersection (binary and) between the old value and new value.
Idx val(const DiscreteVariable &var) const
Returns the current value of a given variable.
Size vals(Idx i) const
Returns the current value of the variable at position i.
SetInst & addVals(Idx varPos, const Size newVal)
Add newVal to variable varPos in the SetInst.
SetInst(MultiDimAdressable &aMD)
Constructor for a SetInst of all the variables of a MultiDimAdressable.
SetInst(const SetInst &aI)
Copy constructor.
void reorder(const SetInst &i)
Reorder the variables given i.
SetInst()
Default constructor: creates an empty tuple.
bool end() const
Returns true if the SetInst reached the end.
SetInst & remVal(const DiscreteVariable *v, Idx newVal)
Remove newVal from the variable v in the SetInst.
void _chgVal_(Idx varPos, Idx newVal)
Change the value of a variable.
Idx pos(const DiscreteVariable &v) const
Returns the position of the variable v.
SetInst & chgVal(Idx varPos, Idx newVal)
Assign newVal to variable at position varPos in the SetInst.
SetInst & interVal(const DiscreteVariable *v, Idx newVal)
Does an intersection (binary and) between the old value and new value.
void _swap_(Idx i, Idx j)
Swap 2 vars in the SetInst.
void erase(const DiscreteVariable &v)
Removes a variable from the SetInst.
Sequence< const DiscreteVariable * > _vars_
The tuple of variables to be instantiated.
bool inOverflow() const
Indicates whether the current value of the tuple is correct or not.
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.
void unsetOverflow()
Removes the flag overflow.
void _chgVals_(Idx varPos, const Size newVal)
Change the value of a variable.
bool rend() const
Returns true if the SetInst reached the rend.
SetInst & interVals(const DiscreteVariable &v, const Size newVal)
Does an intersection (binary and) between the old value and new value.
bool contains(const DiscreteVariable &v) const
Indicates whether a given variable belongs to the SetInst.
void _erase_(const DiscreteVariable &v)
Removes a variable from the sequence of vars.
SetInst(const MultiDimAdressable *aMD)
Constructor for a SetInst of all the variables of a MultiDimAdressable.
SetInst & chgDifVal(Idx varPos, const Size newVal)
Does the difference (binary or) between the old value and new value.
bool contains(const DiscreteVariable *v) const
Indicates whether a given variable belongs to the SetInst.
SetInst & addVal(const DiscreteVariable *v, Idx newVal)
Add newVal to variable v in the SetInst.
~SetInst()
Class destructor.
SetInst & chgValIn(const SetInst &i)
Change all the values to match does in i.
SetInst & interVals(const DiscreteVariable *v, const Size newVal)
Does an intersection (binary and) between the old value and new value.
void unsetEnd()
Alias for unsetOverflow().
const Sequence< const DiscreteVariable * > & variablesSequence() const
Returns the sequence of DiscreteVariable of this SetInst.
SetInst(const Instantiation &aI)
Copy constructor.
Size vals(const DiscreteVariable &var) const
Returns the current value of a given variable.
SetInst & addVals(const DiscreteVariable *v, const Size newVal)
Add newVal to variable v in the SetInst.
SetInst & addVal(const DiscreteVariable &v, Idx newVal)
Add newVal to variable v in the SetInst.
SetInst & remVals(Idx varPos, const Size newVal)
Remove newVal from the variable varPos in the SetInst.
void _add_(const DiscreteVariable &v)
Adds a new var to the sequence of vars.
bool _overflow_
The overflow flag.
Idx val(const DiscreteVariable *var) const
Returns the current value of a given variable.
SetInst & remVals(const DiscreteVariable &v, const Size newVal)
Remove newVal from the variable v in the SetInst.
Idx nbrDim() const
Returns the number of variables in the SetInst.
Idx val(Idx i) const
Returns the current value of a variable at a given position.
SetInst & operator=(const SetInst &aI)
Copy operator.
Size vals(const DiscreteVariable *var) const
Returns the current value of a given variable.
SetInst(const MultiDimAdressable &aMD)
Constructor for a SetInst of all the variables of a MultiDimAdressable.
Size domainSize() const
Returns the product of the variable's domain size in the SetInst.
SetInst & interVal(const DiscreteVariable &v, Idx newVal)
Does an intersection (binary and) between the old value and new value.
SetInst & addVal(Idx varPos, Idx newVal)
Add newVal to variable v in the SetInst.
Idx nbrOccurences(const DiscreteVariable &var) const
Returns the current value of the variable at position i.
SetInst & remVal(const DiscreteVariable &v, Idx newVal)
Remove newVal from the variable v in the SetInst.
SetInst & chgVals(const DiscreteVariable *v, const Size newVal)
Assign newVal to variable v in the SetInst.
std::string toString() const
Give a string version of SetInst.
void _init_(MultiDimAdressable *master)
Intialize the SetInst.
const DiscreteVariable & variable(Idx i) const
Returns the variable at position i in the tuple.
void add(const DiscreteVariable &v)
Adds a new variable in the SetInst.
std::vector< Size > _vals_
The current SetInst: the value of the tuple.
SetInst & chgVal(const DiscreteVariable &v, Idx newVal)
Assign newVal to variable v in the SetInst.
void reorder(const Sequence< const DiscreteVariable * > &v)
Reorder the variables given v.
void clear()
Erase all variables from an SetInst.
SetInst & remVals(const DiscreteVariable *v, const Size newVal)
Remove newVal from the variable v in the SetInst.
SetInst & chgVals(const DiscreteVariable &v, const Size newVal)
Assign newVal to variable v in the SetInst.
SetInst & interVals(Idx varPos, const Size newVal)
Does an intersection (binary and) between the old value and new value.
virtual bool empty() const
Returns true if the SetInst is empty.
SetInst & chgVals(Idx varPos, const Size newVal)
Assign newVal to variable at position varPos in the SetInst.
SetInst & remVal(Idx varPos, Idx newVal)
Remove newVal from the variable varPos in the SetInst.
virtual void replace_(const DiscreteVariable *x, const DiscreteVariable *y)
SetInst(MultiDimAdressable *aMD)
Constructor for a SetInst of all the variables of a MultiDimAdressable.
SetInst & chgVal(const DiscreteVariable *v, Idx newVal)
Assign newVal to variable v in the SetInst.
SetInst & addVals(const DiscreteVariable &v, const Size newVal)
Add newVal to variable v in the SetInst.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
MultiDimInterface & operator>>(MultiDimInterface &c, const DiscreteVariable &v)
Removes a var from the variables of the MutliDimAdressing.
Headers for the abstract base class for all multi dimensionnal containers.
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