![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Class for assigning/browsing values to tuples of discrete variables. More...
#include <agrum/base/multidim/SetInst.h>
Public Member Functions | |
Constructors / Destructors | |
| SetInst () | |
| Default constructor: creates an empty tuple. | |
| SetInst (const SetInst &aI) | |
| Copy constructor. | |
| SetInst (const Instantiation &aI) | |
| Copy constructor. | |
| SetInst & | operator= (const SetInst &aI) |
| Copy operator. | |
| SetInst (MultiDimAdressable &aMD) | |
| Constructor for a SetInst of all the variables of a MultiDimAdressable. | |
| SetInst (const MultiDimAdressable &aMD) | |
| Constructor for a SetInst of all the variables of a MultiDimAdressable. | |
| SetInst (MultiDimAdressable *aMD) | |
| Constructor for a SetInst of all the variables of a MultiDimAdressable. | |
| SetInst (const MultiDimAdressable *aMD) | |
| Constructor for a SetInst of all the variables of a MultiDimAdressable. | |
| ~SetInst () | |
| Class destructor. | |
Accessors / Modifiers | |
| Idx | nbrDim () const |
| Returns the number of variables in the SetInst. | |
| void | add (const DiscreteVariable &v) |
| Adds a new variable in the SetInst. | |
| void | erase (const DiscreteVariable &v) |
| Removes a variable from the SetInst. | |
| void | clear () |
| Erase all variables from an SetInst. | |
| Size | domainSize () const |
| Returns the product of the variable's domain size in the SetInst. | |
| Idx | pos (const DiscreteVariable &v) const |
| Returns the position of the variable v. | |
| Size | vals (Idx i) const |
| Returns the current value of the variable at position i. | |
| Size | vals (const DiscreteVariable &var) const |
| Returns the current value of a given variable. | |
| Size | vals (const DiscreteVariable *var) const |
| Returns the current value of a given variable. | |
| Idx | nbrOccurences (const DiscreteVariable &var) const |
| Returns the current value of the variable at position i. | |
| Idx | val (Idx i) const |
| Returns the current value of a variable at a given position. | |
| Idx | val (const DiscreteVariable &var) const |
| Returns the current value of a given variable. | |
| Idx | val (const DiscreteVariable *var) const |
| Returns the current value of a given variable. | |
| const DiscreteVariable & | variable (Idx i) const |
| Returns the variable at position i in the tuple. | |
| SetInst & | chgVal (const DiscreteVariable &v, Idx newVal) |
| Assign newVal to variable v in the SetInst. | |
| SetInst & | chgVal (const DiscreteVariable *v, Idx newVal) |
| Assign newVal to variable v in the SetInst. | |
| SetInst & | chgVal (Idx varPos, Idx newVal) |
| Assign newVal to variable at position varPos in the SetInst. | |
| SetInst & | chgVals (const DiscreteVariable &v, const Size newVal) |
| Assign newVal to variable v in the SetInst. | |
| SetInst & | addVal (const DiscreteVariable &v, Idx newVal) |
| Add newVal to variable v in the SetInst. | |
| SetInst & | addVals (const DiscreteVariable &v, const Size newVal) |
| Add newVal to variable v in the SetInst. | |
| SetInst & | remVal (const DiscreteVariable &v, Idx newVal) |
| Remove newVal from the variable v in the SetInst. | |
| SetInst & | remVals (const DiscreteVariable &v, const Size newVal) |
| Remove newVal from the variable v in the SetInst. | |
| SetInst & | interVals (const DiscreteVariable &v, const Size newVal) |
| Does an intersection (binary and) between the old value and new value. | |
| SetInst & | interVal (const DiscreteVariable &v, Idx newVal) |
| Does an intersection (binary and) between the old value and new value. | |
| SetInst & | chgVals (const DiscreteVariable *v, const Size newVal) |
| Assign newVal to variable v in the SetInst. | |
| SetInst & | addVal (const DiscreteVariable *v, Idx newVal) |
| Add newVal to variable v in the SetInst. | |
| SetInst & | addVals (const DiscreteVariable *v, const Size newVal) |
| Add newVal to variable v in the SetInst. | |
| SetInst & | remVal (const DiscreteVariable *v, Idx newVal) |
| Remove newVal from the variable v in the SetInst. | |
| SetInst & | remVals (const DiscreteVariable *v, const Size newVal) |
| Remove newVal from the variable v in the SetInst. | |
| SetInst & | interVals (const DiscreteVariable *v, const Size newVal) |
| Does an intersection (binary and) between the old value and new value. | |
| SetInst & | interVal (const DiscreteVariable *v, Idx newVal) |
| Does an intersection (binary and) between the old value and new value. | |
| SetInst & | chgVals (Idx varPos, const Size newVal) |
| Assign newVal to variable at position varPos in the SetInst. | |
| SetInst & | addVal (Idx varPos, Idx newVal) |
| Add newVal to variable v in the SetInst. | |
| SetInst & | addVals (Idx varPos, const Size newVal) |
| Add newVal to variable varPos in the SetInst. | |
| SetInst & | remVal (Idx varPos, Idx newVal) |
| Remove newVal from the variable varPos in the SetInst. | |
| SetInst & | remVals (Idx varPos, const Size newVal) |
| Remove newVal from the variable varPos in the SetInst. | |
| SetInst & | interVals (Idx varPos, const Size newVal) |
| Does an intersection (binary and) between the old value and new value. | |
| SetInst & | interVal (Idx varPos, Idx newVal) |
| Does an intersection (binary and) between the old value and new value. | |
| SetInst & | chgDifVal (Idx varPos, const Size newVal) |
| Does the difference (binary or) between the old value and new value. | |
| SetInst & | chgValIn (const SetInst &i) |
| Change all the values to match does in i. | |
| bool | contains (const DiscreteVariable &v) const |
| Indicates whether a given variable belongs to the 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. | |
| virtual bool | empty () const |
| Returns true if the SetInst is empty. | |
| std::string | toString () const |
| Give a string version of SetInst. | |
| void | reorder (const Sequence< const DiscreteVariable * > &v) |
| Reorder the variables given v. | |
| void | reorder (const SetInst &i) |
| Reorder the variables given i. | |
Overflow management methods. | |
| bool | inOverflow () const |
| Indicates whether the current value of the tuple is correct or not. | |
| void | unsetOverflow () |
| Removes the flag overflow. | |
| void | unsetEnd () |
| Alias for unsetOverflow(). | |
| bool | end () const |
| Returns true if the SetInst reached the end. | |
| bool | rend () const |
| Returns true if the SetInst reached the rend. | |
Static Public Member Functions | |
Static methods | |
| 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. | |
Protected Member Functions | |
| virtual void | replace_ (const DiscreteVariable *x, const DiscreteVariable *y) |
Private Member Functions | |
| void | _swap_ (Idx i, Idx j) |
| Swap 2 vars in the SetInst. | |
| void | _chgVal_ (Idx varPos, Idx newVal) |
| Change the value of a variable. | |
| void | _chgVals_ (Idx varPos, const Size newVal) |
| Change the value of a variable. | |
| void | _add_ (const DiscreteVariable &v) |
| Adds a new var to the sequence of vars. | |
| void | _erase_ (const DiscreteVariable &v) |
| Removes a variable from the sequence of vars. | |
| void | _init_ (MultiDimAdressable *master) |
| Intialize the SetInst. | |
Private Attributes | |
| Sequence< const DiscreteVariable * > | _vars_ |
| The tuple of variables to be instantiated. | |
| std::vector< Size > | _vals_ |
| The current SetInst: the value of the tuple. | |
| bool | _overflow_ |
| The overflow flag. | |
Class for assigning/browsing values to tuples of discrete variables.
SetInst is designed to assign a set of deterministic values to tuples of variables for contextual dependencies detection.
For a variable I of possible determinstic instances \(i1, i2, i3, \ldots\) in the expresion of a set of instantiations is express by the boolean state of each instance transform in an integer. For example: \(i1\) or \(i2\) or \(i4\) will be :
There is two different types of setters:
To print information about a SetInst use the following function:
| gum::SetInst::SetInst | ( | ) |
Default constructor: creates an empty tuple.
Referenced by SetInst(), addVal(), addVal(), addVal(), addVals(), addVals(), addVals(), assign_values(), chgDifVal(), chgVal(), chgVal(), chgVal(), chgValIn(), chgVals(), chgVals(), chgVals(), interVal(), interVal(), interVal(), interVals(), interVals(), interVals(), operator=(), remVal(), remVal(), remVal(), remVals(), remVals(), remVals(), and reorder().
| gum::SetInst::SetInst | ( | const SetInst & | aI | ) |
| gum::SetInst::SetInst | ( | const Instantiation & | aI | ) |
Copy constructor.
| aI | The SetInst to copy. |
| gum::SetInst::SetInst | ( | MultiDimAdressable & | aMD | ) |
Constructor for a SetInst of all the variables of a MultiDimAdressable.
| aMD | The array the variables of which are those of the SetInst. |
| gum::SetInst::SetInst | ( | const MultiDimAdressable & | aMD | ) |
Constructor for a SetInst of all the variables of a MultiDimAdressable.
| aMD | The array the variables of which are those of the SetInst. |
| gum::SetInst::SetInst | ( | MultiDimAdressable * | aMD | ) |
Constructor for a SetInst of all the variables of a MultiDimAdressable.
| aMD | The array the variables of which are those of the SetInst. |
| gum::SetInst::SetInst | ( | const MultiDimAdressable * | aMD | ) |
Constructor for a SetInst of all the variables of a MultiDimAdressable.
| aMD | The array the variables of which are those of the SetInst |
| gum::SetInst::~SetInst | ( | ) |
Class destructor.
|
private |
Adds a new var to the sequence of vars.
If variable v already belongs to the SetInst tuple of variables, then nothing is done. In particular, no exception is thrown in this case.
@ warning note that this function does not deassociate the SetInst from its master MultiDimAdressable, if any. To do so, use function add instead.
| v | The new var. |
| DuplicateElement | Raised if v is already in the SetInst. |
Change the value of a variable.
| varPos | The variable index. |
| newVal | The new value. |
Change the value of a variable.
| varPos | The variable index. |
| newVal | The new value. |
|
private |
Removes a variable from the sequence of vars.
If variable v does not belong to the SetInst tuple of variables, then nothing is done. In particular, no exception is thrown in this case.
| v | The variable to remove. |
|
private |
Swap 2 vars in the SetInst.
| i | The first variable to swap. |
| j | The second variable to swap. |
| void gum::SetInst::add | ( | const DiscreteVariable & | v | ) |
Adds a new variable in the SetInst.
| v | The new variable. |
| DuplicateElement | Raised if c is already in this SetInst. |
| OperationNotAllowed | Raised if the SetInst is a slave. |
| SetInst & gum::SetInst::addVal | ( | const DiscreteVariable & | v, |
| Idx | newVal ) |
Add newVal to variable v in the SetInst.
| v | The variable whose value is assigned. |
| newVal | The value added to the index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
| SetInst & gum::SetInst::addVal | ( | const DiscreteVariable * | v, |
| Idx | newVal ) |
Add newVal to variable v in the SetInst.
| v | The variable whose value is assigned. |
| newVal | The value added to the index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
Add newVal to variable v in the SetInst.
| varPos | The variable whose value is assigned. |
| newVal | The value added to the index of the value assigned (consider the values of varPos as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by varPos. |
| NotFound | Raised if variable varPos does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for varPos. |
References SetInst().
| SetInst & gum::SetInst::addVals | ( | const DiscreteVariable & | v, |
| const Size | newVal ) |
Add newVal to variable v in the SetInst.
| v | The variable whose value is assigned. |
| newVal | The value added to the index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
| SetInst & gum::SetInst::addVals | ( | const DiscreteVariable * | v, |
| const Size | newVal ) |
Add newVal to variable v in the SetInst.
| v | The variable whose value is assigned. |
| newVal | The value added to the index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
Add newVal to variable varPos in the SetInst.
| varPos | The variable whose value is assigned. |
| newVal | The value added to the index of the value assigned (consider the values of varPos as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by varPos. |
| NotFound | Raised if variable varPos does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for varPos. |
References SetInst().
|
static |
Assign the values of i in j, using bij as a bijection between i and j variables.
| bij | Firsts are variables in i and seconds are variables in j. |
| i | An SetInst used to change the values in j. |
| j | An SetInst which receives new values from i using bij. |
| NotFound | raised if a variable in i does not point to a variable in j or if a variable in i is missing in bij. |
References SetInst().
Does the difference (binary or) between the old value and new value.
| varPos | The variable whose value is assigned. |
| newVal | The value intersected with the index of the value assigned (consider the values of varPos as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by varPos. |
| NotFound | Raised if variable varPos does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for varPos. |
References SetInst().
| SetInst & gum::SetInst::chgVal | ( | const DiscreteVariable & | v, |
| Idx | newVal ) |
Assign newVal to variable v in the SetInst.
| v | The variable whose value is assigned. |
| newVal | The index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
| SetInst & gum::SetInst::chgVal | ( | const DiscreteVariable * | v, |
| Idx | newVal ) |
Assign newVal to variable v in the SetInst.
| v | The variable whose value is assigned. |
| newVal | The index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
Assign newVal to variable at position varPos in the SetInst.
| varPos | The index of the variable whose value is assigned in the tuple of variables of the SetInst. |
| newVal | The index of the value assigned (consider the values of the variable as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by the variable. |
| NotFound | raised if the variable does not belong to this |
| OutOfBounds | raised if newVal is not a possible value for the variable |
References SetInst().
| SetInst & gum::SetInst::chgVals | ( | const DiscreteVariable & | v, |
| const Size | newVal ) |
Assign newVal to variable v in the SetInst.
| v | The variable whose value is assigned. |
| newVal | The index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
| SetInst & gum::SetInst::chgVals | ( | const DiscreteVariable * | v, |
| const Size | newVal ) |
Assign newVal to variable v in the SetInst.
| v | The variable whose value is assigned. |
| newVal | The index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
Assign newVal to variable at position varPos in the SetInst.
| varPos | The index of the variable whose value is assigned in the tuple of variables of the SetInst. |
| newVal | The index of the value assigned (consider the values of the variable as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by the variable. |
| NotFound | Raised if the variable does not belong to this |
| OutOfBounds | Raised if newVal is not a possible value for the variable |
References SetInst().
| void gum::SetInst::clear | ( | ) |
Erase all variables from an SetInst.
| OperationNotAllowed | Raised if the SetInst is a slave. |
| bool gum::SetInst::contains | ( | const DiscreteVariable & | v | ) | const |
| bool gum::SetInst::contains | ( | const DiscreteVariable * | v | ) | const |
| Size gum::SetInst::domainSize | ( | ) | const |
|
virtual |
| bool gum::SetInst::end | ( | ) | const |
| void gum::SetInst::erase | ( | const DiscreteVariable & | v | ) |
Removes a variable from the SetInst.
| v | The variable to erase. |
| NotFound | Raised if v is not in this SetInst. |
| OperationNotAllowed | Raised if the SetInst is a slave. |
| bool gum::SetInst::inOverflow | ( | ) | const |
Indicates whether the current value of the tuple is correct or not.
| SetInst & gum::SetInst::interVal | ( | const DiscreteVariable & | v, |
| Idx | newVal ) |
Does an intersection (binary and) between the old value and new value.
| v | The variable whose value is assigned. |
| newVal | The value intersected with the index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
| SetInst & gum::SetInst::interVal | ( | const DiscreteVariable * | v, |
| Idx | newVal ) |
Does an intersection (binary and) between the old value and new value.
| v | The variable whose value is assigned. |
| newVal | The value intersected with the index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
Does an intersection (binary and) between the old value and new value.
| varPos | The variable whose value is assigned. |
| newVal | The value intersected with the index of the value assigned (consider the values of varPos as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by varPos. |
| NotFound | Raised if variable varPos does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for varPos. |
References SetInst().
| SetInst & gum::SetInst::interVals | ( | const DiscreteVariable & | v, |
| const Size | newVal ) |
Does an intersection (binary and) between the old value and new value.
| v | The variable whose value is assigned. |
| newVal | The value intersected with the index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
| SetInst & gum::SetInst::interVals | ( | const DiscreteVariable * | v, |
| const Size | newVal ) |
Does an intersection (binary and) between the old value and new value.
| v | The variable whose value is assigned. |
| newVal | The value intersected with the index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
Does an intersection (binary and) between the old value and new value.
| varPos | The variable whose value is assigned. |
| newVal | The value intersected with the index of the value assigned (consider the values of varPos as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by varPos. |
| NotFound | Raised if variable varPos does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for varPos. |
References SetInst().
| Idx gum::SetInst::nbrDim | ( | ) | const |
| Idx gum::SetInst::nbrOccurences | ( | const DiscreteVariable & | var | ) | const |
Returns the current value of the variable at position i.
| var | the variable. |
| NotFound | raised if the element cannot be found. |
Copy operator.
References SetInst().
| Idx gum::SetInst::pos | ( | const DiscreteVariable & | v | ) | const |
| SetInst & gum::SetInst::remVal | ( | const DiscreteVariable & | v, |
| Idx | newVal ) |
Remove newVal from the variable v in the SetInst.
| v | The variable whose value is assigned. |
| newVal | The value removed to the index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
| SetInst & gum::SetInst::remVal | ( | const DiscreteVariable * | v, |
| Idx | newVal ) |
Remove newVal from the variable v in the SetInst.
| v | The variable whose value is assigned. |
| newVal | The value removed to the index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
Remove newVal from the variable varPos in the SetInst.
| varPos | The variable whose value is assigned. |
| newVal | The value removed to the index of the value assigned (consider the values of varPos as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by varPos. |
| NotFound | Raised if variable varPos does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for varPos. |
References SetInst().
| SetInst & gum::SetInst::remVals | ( | const DiscreteVariable & | v, |
| const Size | newVal ) |
Remove newVal from the variable v in the SetInst.
| v | The variable whose value is assigned. |
| newVal | The value removed to the index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
| SetInst & gum::SetInst::remVals | ( | const DiscreteVariable * | v, |
| const Size | newVal ) |
Remove newVal from the variable v in the SetInst.
| v | The variable whose value is assigned. |
| newVal | The value removed to the index of the value assigned (consider the values of v as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by v. |
| NotFound | Raised if variable v does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for v. |
References SetInst().
Remove newVal from the variable varPos in the SetInst.
| varPos | The variable whose value is assigned. |
| newVal | The value removed to the index of the value assigned (consider the values of varPos as an array indexed from 0 to n of values (which might be anything from real numbers to strings, etc). Parameter newVal indicates the index in this array of the new value taken by varPos. |
| NotFound | Raised if variable varPos does not belong to the SetInst. |
| OutOfBounds | Raised if newVal is not a possible value for varPos. |
References SetInst().
| bool gum::SetInst::rend | ( | ) | const |
| void gum::SetInst::reorder | ( | const Sequence< const DiscreteVariable * > & | v | ) |
Reorder the variables given v.
| v | The new order of variables in this SetInst. |
| void gum::SetInst::reorder | ( | const SetInst & | i | ) |
|
protectedvirtual |
| std::string gum::SetInst::toString | ( | ) | const |
| void gum::SetInst::unsetEnd | ( | ) |
Alias for unsetOverflow().
| void gum::SetInst::unsetOverflow | ( | ) |
Removes the flag overflow.
See full documentation for details. (Recommended).
| Idx gum::SetInst::val | ( | const DiscreteVariable & | var | ) | const |
| Idx gum::SetInst::val | ( | const DiscreteVariable * | var | ) | const |
| Size gum::SetInst::vals | ( | const DiscreteVariable & | var | ) | const |
| Size gum::SetInst::vals | ( | const DiscreteVariable * | var | ) | const |
Returns the current value of the variable at position i.
| i | The index of the variable. |
| NotFound | Raised if the element cannot be found. |
| const DiscreteVariable & gum::SetInst::variable | ( | Idx | i | ) | const |
Returns the variable at position i in the tuple.
| i | The index of the variable. |
| NotFound | Raised if the element cannot be found. |
| const Sequence< const DiscreteVariable * > & gum::SetInst::variablesSequence | ( | ) | const |
Returns the sequence of DiscreteVariable of this SetInst.
|
private |
|
private |