![]() |
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/instantiation.h>
Public Member Functions | |
Constructors / Destructors | |
| Instantiation () | |
| Default constructor: creates an empty tuple. | |
| Instantiation (const Instantiation &aI, const bool notifyMaster=true) | |
| Copy constructor. | |
| Instantiation & | operator= (const Instantiation &aI) |
| Copy operator. | |
| Instantiation (MultiDimAdressable &aMD) | |
| Constructor for a Instantiation of all the variables of a MultiDimAdressable. | |
| Instantiation (const MultiDimAdressable &aMD) | |
| Constructor for a Instantiation of all the variables of a MultiDimAdressable. | |
| Instantiation (MultiDimAdressable *aMD) | |
| Constructor for a Instantiation of all the variables of a MultiDimAdressable. | |
| Instantiation (const MultiDimAdressable *aMD) | |
| Constructor for a Instantiation of all the variables of a MultiDimAdressable. | |
| ~Instantiation () | |
| Destructor. | |
Accessors / Modifiers | |
| Idx | nbrDim () const final |
| Returns the number of variables in the Instantiation. | |
| void | add (const DiscreteVariable &v) final |
| Adds a new variable in the Instantiation. | |
| void | erase (const DiscreteVariable &v) final |
| Removes a variable from the Instantiation. | |
| void | erase (const std::string &name) |
| Returns the number of variables in the Instantiation. | |
| void | clear () |
| Erase all variables from an Instantiation. | |
| Size | domainSize () const final |
| Returns the product of the variable's domain size in the Instantiation. | |
| Idx | pos (const DiscreteVariable &v) const final |
| Returns the position of the variable v. | |
| Idx | val (Idx i) const |
| Returns the current value of the variable at position i. | |
| Idx | val (const DiscreteVariable &var) const |
| Returns the current value of a given variable. | |
| Idx | val (const std::string &name) const |
| Returns the number of variables in the Instantiation. | |
| Idx | valFromPtr (const DiscreteVariable *pvar) const |
| Returns the current value of a given variable. | |
| const DiscreteVariable & | variable (Idx i) const final |
| Returns the variable at position i in the tuple. | |
| const DiscreteVariable & | variable (const std::string &name) const final |
| Returns the variable with the name. | |
| Instantiation & | chgVal (const DiscreteVariable &v, Idx newval) |
| Assign newval to variable v in the Instantiation. | |
| Instantiation & | chgVal (Idx varPos, Idx newval) |
| Assign newval to variable at position varPos in the Instantiation. | |
| Instantiation & | chgVal (const std::string &var, Idx newval) |
| Assign newval to variable at position varPos in the Instantiation. | |
| Instantiation & | chgVal (const std::string &var, const std::string &newval) |
| Assign newval to variable at position varPos in the Instantiation. | |
| Instantiation & | setVals (const Instantiation &i) |
| Assign the values from i in the Instantiation. | |
| void | setValsFrom (const HashTable< const DiscreteVariable *, const DiscreteVariable * > &map, const Instantiation &external) |
| Assign the values of external in *this, using map as a bijection between external and this variables. | |
| bool | contains (const DiscreteVariable &v) const final |
| Indicates whether a given variable belongs to the Instantiation. | |
| bool | contains (const std::string &name) const |
| Returns the number of variables in the Instantiation. | |
| bool | contains (const DiscreteVariable *v) const |
| Indicates whether a given variable belongs to the Instantiation. | |
| const Sequence< const DiscreteVariable * > & | variablesSequence () const final |
| Returns the sequence of DiscreteVariable of this instantiation. | |
| virtual bool | empty () const final |
| Returns true if the instantiation is empty. | |
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 Instantiation reached the end. | |
| bool | rend () const |
| Returns true if the Instantiation reached the rend. | |
Incrementation and decrementation methods | |
| void | inc () |
| Operator increment. | |
| void | dec () |
| Operator decrement. | |
| void | incIn (const Instantiation &i) |
| Operator increment for the variables in i. | |
| void | decIn (const Instantiation &i) |
| Operator decrement for the variables in i. | |
| void | incOut (const Instantiation &i) |
| Operator increment for the variables not in i. | |
| void | decOut (const Instantiation &i) |
| Operator decrement for the variables not in i. | |
| void | incNotVar (const DiscreteVariable &v) |
| Operator increment for vars which are not v. | |
| void | decNotVar (const DiscreteVariable &v) |
| Operator decrement for vars which are not v. | |
| void | incVar (const DiscreteVariable &v) |
| Operator increment for variable v only. | |
| void | decVar (const DiscreteVariable &v) |
| Operator decrement for variable v only. | |
Initialization methods | |
| void | setFirst () |
| Assign the first values to the tuple of the Instantiation. | |
| void | setLast () |
| Assign the last values in the Instantiation. | |
| void | setFirstIn (const Instantiation &i) |
| Assign the first values in the Instantiation for the variables in i. | |
| void | setLastIn (const Instantiation &i) |
| Assign the last values in the Instantiation for the variables in i. | |
| void | setFirstOut (const Instantiation &i) |
| Assign the first values in the Instantiation for the variables not in i. | |
| void | setLastOut (const Instantiation &i) |
| Assign the last values in the Instantiation for the variables not in i. | |
| void | setFirstNotVar (const DiscreteVariable &v) |
| Assign the first values to variables different of v. | |
| void | setLastNotVar (const DiscreteVariable &v) |
| Assign the last values to variables different of v. | |
| void | setFirstVar (const DiscreteVariable &v) |
| Assign the first value in the Instantiation for var v. | |
| void | setLastVar (const DiscreteVariable &v) |
| Assign the last value in the Instantiation for var v. | |
Notification methods | |
| bool | actAsSlave (MultiDimAdressable &aMD) |
| Tries to register the Instantiation to a MultiDimAdressable. | |
| bool | forgetMaster () |
| Deassociate the master MultiDimAdressable, if any. | |
| bool | isSlave () const |
| Indicates whether the Instantiation has a master. | |
| bool | isMaster (const MultiDimAdressable *m) const |
| Indicates whether m is the master of this instantiation. | |
| bool | isMaster (const MultiDimAdressable &m) const |
| Indicates whether m is the master of this instantiation. | |
| void | synchronizeWithMaster (const MultiDimAdressable *m) |
| Force the variables sequence to be the same as the master one. | |
| void | addWithMaster (const MultiDimAdressable *m, const DiscreteVariable &v) |
| Call Instantiation:: add(const DiscreteVariable&) by master. | |
| void | eraseWithMaster (const MultiDimAdressable *m, const DiscreteVariable &v) |
| Call Instantiation:: erase(const DiscreteVariable&) by master. | |
Operators | |
| bool | operator== (const Instantiation &other) const |
| operator== | |
| Instantiation & | operator++ () |
| Alias of Instantiation::inc(). | |
| Instantiation & | operator-- () |
| Alias of Instantiation::dec(). | |
| Instantiation & | operator+= (Size depl) |
| Calls depl times Instantiation::inc(). | |
| Instantiation & | operator-= (Size depl) |
| Calls depl times Instantiation::dec(). | |
Various methods | |
| Idx | hamming () const |
| Returns the hamming distance of this instantiation. | |
| std::string | toString () const |
| Give a string version of instantiation. | |
| void | reorder (const Sequence< const DiscreteVariable * > &v) |
| Reorder vars of this instantiation giving the order in v. | |
| void | reorder (const Instantiation &i) |
| Calls reorder(const Sequence<const DiscreteVariable*>&) with i.variablesSequence(). | |
Accessors / Modifiers | |
| void | replace (const DiscreteVariable &x, const DiscreteVariable &y) |
| Replace variables in this multidim. | |
Protected Member Functions | |
| virtual void | replace_ (const DiscreteVariable *x, const DiscreteVariable *y) final |
| Replace x by y. | |
Private Member Functions | |
| void | _swap_ (Idx i, Idx j) |
| Swap two variables in the Instantiation. | |
| void | _chgVal_ (Idx varPos, Idx newVal) |
| Modifies internally the value of a given variable of the sequence. | |
| 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 | _notifiedDimChanged_ (const Sequence< const DiscreteVariable * > &v) |
| This function is called by the master (if any) when changes arise in its vars list. | |
| void | _init_ (MultiDimAdressable *master) |
| Initialize this Instantiation. | |
| void | _reorder_ (const Sequence< const DiscreteVariable * > &v) |
| Reorder vars of this instantiation giving the order in v. | |
| void | _masterChangeNotification_ (Idx varPos, Idx newVal, Idx oldVal) const |
| void | _masterFirstNotification_ () const |
| void | _masterIncNotification_ () const |
| void | _masterLastNotification_ () const |
| void | _masterDecNotification_ () const |
Private Attributes | |
| MultiDimAdressable * | _master_ |
| The master, if any, contains precisely the set of variables to be instantiated. | |
| Sequence< const DiscreteVariable * > | _vars_ |
| The tuple of variables to be instantiated. | |
| std::vector< Idx > | _vals_ |
| The current instantiation: the value of the tuple. | |
| bool | _overflow_ |
| Indicates whether the current value of the tuple is valid when we loop sufficiently over values of the tuple, we may have browsed all the possible values and we have to know in a way or another that the tuple contains no more value. This is precisely the meaning of Boolean overflow. | |
Class for assigning/browsing values to tuples of discrete variables.
Instantiation is designed to assign values to tuples of variables and to efficiently loop over values of subsets of variables. This class can be used in two different flavors:
An Instantiation can be associated/deassociated to a given multidimensional array using the MultiDimAdressable::registerSlave(Instantiation& i) and MultiDimAdressable::unregisterSlave functions. Note that, to be registrable, the Instantiation must have precisely the same variables as the array. As a consequence, adding or removing a variable from a Instantiation associated to an array will unregister it. This behavior is compulsory as, if it were still associated, it would not be possible to retrieve a correct value of the array given a value of the Instantiation. For instance, if M[A,B,C] is an array indexed by Boolean variables A,B,C, Which value of M should be returned if B=0 and C=0? We do not know for sure as we do not know the value of A. Note also that, at any time, you can unregister a Instantiation from its master multidimensional array and you can ask to associate it (provided the tuple of variable match).
To print information about a Instantiation use the following function:
Definition at line 102 of file instantiation.h.
| gum::Instantiation::Instantiation | ( | ) |
Default constructor: creates an empty tuple.
Definition at line 59 of file instantiation.cpp.
References Instantiation(), _master_, and _overflow_.
Referenced by Instantiation(), Instantiation(), Instantiation(), Instantiation(), Instantiation(), Instantiation(), ~Instantiation(), chgVal(), chgVal(), chgVal(), chgVal(), decIn(), decOut(), incIn(), incOut(), operator++(), operator+=(), operator--(), operator-=(), operator=(), operator==(), reorder(), setFirstIn(), setFirstOut(), setLastIn(), setLastOut(), setVals(), and setValsFrom().
| gum::Instantiation::Instantiation | ( | const Instantiation & | aI, |
| const bool | notifyMaster = true ) |
Copy constructor.
Note that the Instantiation is by default associated to the same MultiDimAdressable as aI. This means that looping over values of the tuple will induce looping over the values of the MultiDimAdressable. Similarly, the value of the tuple is that of aI, and, if the Instantiation is slaved, its master is notified of the value of the Instantiation if notifyMaster is true.
| aI | The Instantiation we copy. |
| notifyMaster | Whether or not notify master if exits. |
Definition at line 118 of file instantiation.cpp.
References Instantiation(), _master_, _overflow_, _vals_, _vars_, and actAsSlave().
| gum::Instantiation::Instantiation | ( | MultiDimAdressable & | aMD | ) |
Constructor for a Instantiation of all the variables of a MultiDimAdressable.
The variables of the Instantiation are those of aMD (actually, they are shared in memory). All the variables of aMD belong to the tuple of variables to be instantiated.
Note that the Instantiation is by default associated to aMD, i.e., looping over values of the tuple will induce looping over the values of aMD. The value given to the tuple is the first possible value, that is, (0,...,0). If the Instantiation is slaved, its master is notified of the value of the Instantiation.
| aMD | The array the variables of which are those of the Instantiation. |
Definition at line 87 of file instantiation.cpp.
References Instantiation(), _init_(), _master_, and _overflow_.
| gum::Instantiation::Instantiation | ( | const MultiDimAdressable & | aMD | ) |
Constructor for a Instantiation of all the variables of a MultiDimAdressable.
The variables of the Instantiation are those of aMD (actually, they are shared in memory). All the variables of aMD belong to the tuple of variables to be instantiated.
Note that the Instantiation is by default associated to aMD, i.e., looping over values of the tuple will induce looping over the values of aMD. The value given to the tuple is the first possible value, that is, (0,...,0). If the Instantiation is slaved, its master is notified of the value of the Instantiation.
| aMD | The array the variables of which are those of the Instantiation. |
Definition at line 93 of file instantiation.cpp.
References Instantiation(), _init_(), _master_, and _overflow_.
| gum::Instantiation::Instantiation | ( | MultiDimAdressable * | aMD | ) |
Constructor for a Instantiation of all the variables of a MultiDimAdressable.
The variables of the Instantiation are those of aMD (actually, they are shared in memory). All the variables of aMD belong to the tuple of variables to be instantiated.
Note that the Instantiation is by default associated to aMD, i.e., looping over values of the tuple will induce looping over the values of aMD. The value given to the tuple is the first possible value, that is, (0,...,0). If the Instantiation is slaved, its master is notified of the value of the Instantiation.
| aMD | The array the variables of which are those of the Instantiation. |
Definition at line 100 of file instantiation.cpp.
References Instantiation(), _init_(), _master_, and _overflow_.
| gum::Instantiation::Instantiation | ( | const MultiDimAdressable * | aMD | ) |
Constructor for a Instantiation of all the variables of a MultiDimAdressable.
The variables of the Instantiation are those of aMD (actually, they are shared in memory). All the variables of aMD belong to the tuple of variables to be instantiated.
Note that the Instantiation is by default associated to aMD, i.e., looping over values of the tuple will induce looping over the values of aMD. The value given to the tuple is the first possible value, that is, (0,...,0). If the Instantiation is slaved, its master is notified of the value of the Instantiation.
| aMD | The array the variables of which are those of the Instantiation. |
Definition at line 110 of file instantiation.cpp.
References Instantiation(), _init_(), _master_, and _overflow_.
| gum::Instantiation::~Instantiation | ( | ) |
Destructor.
Definition at line 64 of file instantiation.cpp.
References Instantiation(), and _master_.
|
private |
Adds a new var to the sequence of vars.
If variable v already belongs to the Instantiation tuple of variables, then nothing is done. In particular, no exception is thrown in this case.
| v | The new var. |
| DuplicateElement | Raised if v is already in this Instantiation. |
Definition at line 750 of file instantiation_inl.h.
References _overflow_, _vals_, and _vars_.
Referenced by _init_(), add(), and addWithMaster().
Modifies internally the value of a given variable of the sequence.
In addition to modifying the value of the variable, the Instantiation informs its master MultiDimAdressable of the modification.
| varPos | The variable to change. |
| newVal | The variable new value. |
Definition at line 67 of file instantiation_inl.h.
References _masterChangeNotification_(), and _vals_.
Referenced by chgVal(), chgVal(), decIn(), decNotVar(), decOut(), decVar(), incIn(), incNotVar(), incOut(), incVar(), setFirstIn(), setFirstNotVar(), setFirstOut(), setFirstVar(), setLastIn(), setLastNotVar(), setLastOut(), setLastVar(), and setVals().
|
private |
Removes a variable from the sequence of vars.
If variable v does not belong to the Instantiation tuple of variables, then nothing is done. In particular, no exception is thrown in this case.
| v | The variable to be erased from the tuple. |
Definition at line 757 of file instantiation_inl.h.
References _vals_, _vars_, and pos().
Referenced by erase(), and eraseWithMaster().
|
private |
Initialize this Instantiation.
| master | This Instantiation's master. |
Definition at line 71 of file instantiation.cpp.
References _add_(), _vals_, _vars_, actAsSlave(), gum::MultiDimAdressable::getMasterRef(), gum::SequenceImplementation< Key, Gen >::size(), and gum::MultiDimInterface::variablesSequence().
Referenced by Instantiation(), Instantiation(), Instantiation(), and Instantiation().
|
private |
Definition at line 209 of file instantiation.cpp.
References _master_, and _vars_.
Referenced by _chgVal_().
|
private |
|
private |
Definition at line 213 of file instantiation.cpp.
References _master_.
Referenced by inc(), and setFirst().
|
private |
|
private |
|
private |
This function is called by the master (if any) when changes arise in its vars list.
| v | the new vars list |
|
private |
Reorder vars of this instantiation giving the order in v.
In the new order variables common to v and *this are placed first, then variables only in *this.
The variables only in v are ignored.
| v | The new order of variables in this Instantiation. |
Definition at line 726 of file instantiation_inl.h.
References _swap_(), gum::SequenceImplementation< Key, Gen >::atPos(), contains(), pos(), and gum::SequenceImplementation< Key, Gen >::size().
Referenced by reorder(), and synchronizeWithMaster().
Swap two variables in the Instantiation.
| i | The first variable. |
| j | The second variable. |
Definition at line 702 of file instantiation_inl.h.
References _vals_, and _vars_.
Referenced by _reorder_().
| bool gum::Instantiation::actAsSlave | ( | MultiDimAdressable & | aMD | ) |
Tries to register the Instantiation to a MultiDimAdressable.
The function will actually register the Instantiation if and only if it has precisely the same variables as the MultiDimAdressable (by precisely, we mean a physical equality, that is, the variables are at the same places in memory).
| aMD | The multidimensional array which will be the master of *this |
| OperationNotAllowed | Raised if this instantiation has already a master. |
Definition at line 255 of file instantiation.cpp.
References _master_, GUM_ERROR, and gum::MultiDimAdressable::registerSlave().
Referenced by Instantiation(), _init_(), and operator=().
|
finalvirtual |
Adds a new variable in the Instantiation.
If variable v already belongs to the Instantiation tuple of variables, then DuplicateElement is thrown in this case. The value of the new variable is set to that of index 0, that is, the first possible value for the variable. Since an instantiation must share the same set of variables with his master an OperationNotAllowed is raised if you try to add a variable of a slaved instantiation.
| v | The new variable added to this Instantiation. |
| DuplicateElement | Raised if v is already in this Instantiation. |
| InvalidArgument | Raised if the name of v is already used in this Instantiation. |
| OperationNotAllowed | Raised if this is a slave Instantiation. |
Implements gum::MultiDimInterface.
Definition at line 123 of file instantiation_inl.h.
References _add_(), _master_, _vars_, GUM_ERROR, and gum::Variable::name().
Referenced by gum::SamplingInference< GUM_SCALAR >::addVarSample_(), gum::BayesNet< GUM_SCALAR >::contextualize(), gum::SamplingInference< GUM_SCALAR >::contextualize(), gum::ImportanceSampling< GUM_SCALAR >::draw_(), gum::WeightedSampling< GUM_SCALAR >::draw_(), gum::learning::BNDatabaseGenerator< GUM_SCALAR >::drawSamples(), gum::JointTargetedInference< GUM_SCALAR >::evidenceJointImpact(), gum::JointTargetedMRFInference< GUM_SCALAR >::evidenceJointImpact(), gum::Tensor< GUM_SCALAR >::fillWith(), gum::JointTargetedInference< GUM_SCALAR >::jointMutualInformation(), gum::JointTargetedMRFInference< GUM_SCALAR >::jointMutualInformation(), gum::GibbsOperator< GUM_SCALAR >::monteCarloSample(), gum::FMDPSimulator::perform(), gum::AbstractSimulator::randomState_(), gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByColumns(), and gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByColumns().
| INLINE void gum::Instantiation::addWithMaster | ( | const MultiDimAdressable * | m, |
| const DiscreteVariable & | v ) |
Call Instantiation:: add(const DiscreteVariable&) by master.
| m | The master of this instantiation. |
| v | The varaible to add. |
| OperationNotAllowed | Raised if m is not hte master of this instantiation. |
Definition at line 743 of file instantiation_inl.h.
References _add_(), _master_, and GUM_ERROR.
| INLINE Instantiation & gum::Instantiation::chgVal | ( | const DiscreteVariable & | v, |
| Idx | newval ) |
Assign newval to variable v in the Instantiation.
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.
In addition to modifying the value of the variable, the Instantiation informs its master of the modification. This function also unsets the overflow flag.
| v | The variable whose value is assigned. |
| newval | The index of the value assigned. |
| NotFound | Raised if variable v does not belong to the instantiation. |
| OutOfBounds | Raised if newval is not a possible value for v. |
Definition at line 75 of file instantiation_inl.h.
References Instantiation(), _chgVal_(), _overflow_, _vars_, gum::DiscreteVariable::domainSize(), GUM_ERROR, and gum::Variable::name().
Referenced by gum::GibbsOperator< GUM_SCALAR >::_drawVarMonteCarlo_(), gum::BayesNetFactory< GUM_SCALAR >::_fillProbaWithValuesTable_(), gum::GibbsOperator< GUM_SCALAR >::_GibbsSample_(), gum::SamplingInference< GUM_SCALAR >::addVarSample_(), chgVal(), chgVal(), gum::MultiDimWithOffset< GUM_SCALAR >::computeInstantiationValue_(), gum::SamplingInference< GUM_SCALAR >::contextualize(), gum::Tensor< GUM_SCALAR >::deterministicTensor(), gum::ImportanceSampling< GUM_SCALAR >::draw_(), gum::WeightedSampling< GUM_SCALAR >::draw_(), gum::Tensor< GUM_SCALAR >::evEq(), gum::Tensor< GUM_SCALAR >::evGt(), gum::Tensor< GUM_SCALAR >::evIn(), gum::Tensor< GUM_SCALAR >::evLt(), gum::Tensor< GUM_SCALAR >::fillWith(), gum::GibbsOperator< GUM_SCALAR >::monteCarloSample(), gum::IMarkovRandomField< GUM_SCALAR >::operator==(), gum::InfluenceDiagram< GUM_SCALAR >::operator==(), gum::FMDPSimulator::perform(), gum::AbstractSimulator::randomState_(), gum::prm::PRMFactory< GUM_SCALAR >::setCPFByRule(), gum::prm::PRMFactory< GUM_SCALAR >::setCPFByRule(), and setValsFrom().
| INLINE Instantiation & gum::Instantiation::chgVal | ( | const std::string & | var, |
| const std::string & | newval ) |
Assign newval to variable at position varPos in the Instantiation.
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.
In addition to modifying the value of the variable, the Instantiation informs its master of the modification. This function also unsets the overflow flag.
| var | the name of the variable whose value is assigned in the tuple of variables of the Instantiation. |
| newval | The label of the value assigned. |
| NotFound | Raised if the variable does not belong to this |
| OutOfBounds | Raised if newval is not a possible value for the variable |
Definition at line 116 of file instantiation_inl.h.
References Instantiation(), chgVal(), pos(), and variable().
| INLINE Instantiation & gum::Instantiation::chgVal | ( | const std::string & | var, |
| Idx | newval ) |
Assign newval to variable at position varPos in the Instantiation.
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.
In addition to modifying the value of the variable, the Instantiation informs its master of the modification. This function also unsets the overflow flag.
| var | the name of the variable whose value is assigned in the tuple of variables of the Instantiation. |
| newval | The index of the value assigned. |
| NotFound | Raised if the variable does not belong to this |
| NotFound | Raised if newval is not a possible value for the variable |
Definition at line 112 of file instantiation_inl.h.
References Instantiation(), chgVal(), and variable().
| INLINE Instantiation & gum::Instantiation::chgVal | ( | Idx | varPos, |
| Idx | newval ) |
Assign newval to variable at position varPos in the Instantiation.
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.
In addition to modifying the value of the variable, the Instantiation informs its master of the modification. This function also unsets the overflow flag.
| varPos | The index of the variable whose value is assigned in the tuple of variables of the Instantiation. |
| newval | The index of the value assigned. |
| NotFound | Raised if the variable does not belong to this |
| OutOfBounds | Raised if newval is not a possible value for the variable |
Definition at line 97 of file instantiation_inl.h.
References Instantiation(), _chgVal_(), _overflow_, _vals_, _vars_, domainSize(), and GUM_ERROR.
| INLINE void gum::Instantiation::clear | ( | ) |
Erase all variables from an Instantiation.
| OperationNotAllowed | Raised if the instantiation is a slave. |
Definition at line 159 of file instantiation_inl.h.
References _master_, _vals_, _vars_, and GUM_ERROR.
Referenced by gum::ImportanceSampling< GUM_SCALAR >::draw_(), gum::MonteCarloSampling< GUM_SCALAR >::draw_(), and gum::WeightedSampling< GUM_SCALAR >::draw_().
|
finalvirtual |
Indicates whether a given variable belongs to the Instantiation.
| v | The variable for which the test is made. |
Implements gum::MultiDimInterface.
Definition at line 54 of file instantiation_inl.h.
References _vars_.
Referenced by _reorder_(), gum::BayesNet< GUM_SCALAR >::contextualize(), decIn(), decOut(), gum::learning::BNDatabaseGenerator< GUM_SCALAR >::drawSamples(), gum::MultiDimWithOffset< GUM_SCALAR >::getOffs_(), incIn(), incOut(), operator=(), operator==(), gum::MultiDimImplementation< GUM_SCALAR >::registerSlave(), setFirstIn(), setFirstOut(), setLastIn(), setLastOut(), and setVals().
| INLINE bool gum::Instantiation::contains | ( | const DiscreteVariable * | v | ) | const |
Indicates whether a given variable belongs to the Instantiation.
| v | A pointer on the variable for which the test is made. |
Definition at line 64 of file instantiation_inl.h.
References _vars_.
| INLINE bool gum::Instantiation::contains | ( | const std::string & | name | ) | const |
Returns the number of variables in the Instantiation.
Definition at line 56 of file instantiation_inl.h.
References _vars_.
| INLINE void gum::Instantiation::dec | ( | ) |
Operator decrement.
Note that this operator never throws an exception when it reaches the end of the possible values of the tuple of variables of the Instantiation. To know if we reached the end, use function end(). If the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. If we already reached the end() or the rend() of the possible values, function inc() will perform nothing (this prevents looping inadvertently several times within the same loop). To unset the end flag, use functions unsetOverflow(), unsetEnd() or one of the setFirst() or setLast().
Usage example:
Definition at line 265 of file instantiation_inl.h.
References _masterDecNotification_(), _masterLastNotification_(), _overflow_, _vals_, _vars_, and nbrDim().
Referenced by operator--(), and operator-=().
| INLINE void gum::Instantiation::decIn | ( | const Instantiation & | i | ) |
Operator decrement for the variables in i.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated.
Note also that this operator never throws an exception when it reaches the end of the possible values of the tuple of variables of the Instantiation. To know if we reached the end, use function end(). Finally, let us mention that the value of instantiation i is not taken into account, that is, only the variables belonging to i are taken into account. The next value of *this is thus computed w.r.t. to the current value of *this. If we already reached the end() or the rend() of the possible values, function incIn() will perform nothing (this prevents looping inadvertently several times within the same loop). To unset the end flag, use functions unsetOverflow(), unsetEnd() or one of the setFirst() or setLast().
| i | The set of variables to decrement in this Instantiation. |
Definition at line 391 of file instantiation_inl.h.
References Instantiation(), _chgVal_(), _overflow_, _vals_, _vars_, contains(), domainSize(), nbrDim(), pos(), and variable().
| INLINE void gum::Instantiation::decNotVar | ( | const DiscreteVariable & | v | ) |
Operator decrement for vars which are not v.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated.
Note also that this operator never throws an exception when it reaches the end of the possible values of the tuple of variables of the Instantiation. To know if we reached the end, use function end(). If we already reached the end() or the rend() of the possible values, function incNotVar() will perform nothing (this prevents looping inadvertently several times within the same loop). To unset the end flag, use functions unsetOverflow(), unsetEnd() or one of the setFirst() or setLast().
| v | The varaible not to decrement in this Instantiation. |
Definition at line 574 of file instantiation_inl.h.
References _chgVal_(), _overflow_, _vals_, _vars_, domainSize(), and nbrDim().
Referenced by gum::Tensor< GUM_SCALAR >::toString().
| INLINE void gum::Instantiation::decOut | ( | const Instantiation & | i | ) |
Operator decrement for the variables not in i.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. Note also that this operator never throws an exception when it reaches the end of the possible values of the tuple of variables of the Instantiation. To know if we reached the end, use function end(). Finally, let us mention that the value of instantiation i is not taken into account, that is, only the variables not belonging to i are taken into account. The next value of *this is thus computed w.r.t. to the current value of *this. If we already reached the end() or the rend() of the possible values, function incerr() will perform nothing (this prevents looping inadvertently several times within the same loop). To unset the end flag, use functions unsetOverflow(), unsetEnd() or one of the setFirst() or setLast().
| i | The set of variables to not decrement in this Instantiation. |
Definition at line 491 of file instantiation_inl.h.
References Instantiation(), _chgVal_(), _overflow_, _vals_, _vars_, contains(), domainSize(), and nbrDim().
| INLINE void gum::Instantiation::decVar | ( | const DiscreteVariable & | v | ) |
Operator decrement for variable v only.
This function decrement only variable v. Trying to decrement the last possible value results in an overflow (no exception is thrown in this case). If we already reached the end() or the rend() of the possible values, function incVar() will perform nothing (this prevents looping inadvertently several times within the same loop). To unset the end flag, use functions unsetOverflow(), unsetEnd() or one of the setFirst() or setLast().
| v | The variable to decrement in this Instantiation. |
| NotFound | Raised if variable v does not belong to the Instantiation. |
Definition at line 658 of file instantiation_inl.h.
References _chgVal_(), _overflow_, _vals_, _vars_, and gum::DiscreteVariable::domainSize().
|
finalvirtual |
Returns the product of the variable's domain size in the Instantiation.
Implements gum::MultiDimInterface.
Definition at line 168 of file instantiation_inl.h.
References _vars_.
Referenced by chgVal(), decIn(), decNotVar(), decOut(), inc(), incIn(), incNotVar(), incOut(), setLast(), setLastIn(), and setLastOut().
|
finalvirtual |
Returns true if the instantiation is empty.
Implements gum::MultiDimInterface.
Definition at line 765 of file instantiation_inl.h.
References _vals_.
Referenced by gum::learning::BNDatabaseGenerator< GUM_SCALAR >::drawSamples().
| INLINE bool gum::Instantiation::end | ( | ) | const |
Returns true if the Instantiation reached the end.
Function end() should be used as in:
Definition at line 221 of file instantiation_inl.h.
References inOverflow().
Referenced by gum::prm::PRMInference< GUM_SCALAR >::PRMInference(), gum::prm::PRMFormAttribute< GUM_SCALAR >::_fillCpf_(), gum::BayesNetFactory< GUM_SCALAR >::_fillProbaWithValuesTable_(), gum::GraphicalModelInference< GUM_SCALAR >::_isHardEvidence_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_isHardEvidence_(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::_threadUpdate_(), gum::credal::InferenceEngine< GUM_SCALAR >::addEvidence(), gum::MultiDimContainer< GUM_SCALAR >::apply(), gum::prm::PRMFormAttribute< GUM_SCALAR >::becomeCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::becomeCastDescendant(), gum::prm::o3prmr::O3prmrInterpreter::checkObserve(), gum::GraphicalModelInference< GUM_SCALAR >::chgEvidence(), gum::MultiDimBucket< GUM_SCALAR >::compute(), gum::prm::PRMFormAttribute< GUM_SCALAR >::copy(), gum::prm::PRMFormAttribute< GUM_SCALAR >::copyCpf(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::copyCpf(), gum::learning::DAG2BNLearner::createBNwithEM(), gum::MCBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator, SimpleCPTDisturber >::disturbReducCPT(), gum::SimpleCPTDisturber< GUM_SCALAR >::disturbReducCPT(), gum::DecisionTensor< GUM_SCALAR >::divideEvenZero(), gum::Tensor< GUM_SCALAR >::draw(), gum::learning::BNDatabaseGenerator< GUM_SCALAR >::drawSamples(), gum::MarginalTargetedInference< GUM_SCALAR >::evidenceImpact(), gum::MarginalTargetedMRFInference< GUM_SCALAR >::evidenceImpact(), gum::JointTargetedInference< GUM_SCALAR >::evidenceJointImpact(), gum::JointTargetedMRFInference< GUM_SCALAR >::evidenceJointImpact(), gum::Tensor< GUM_SCALAR >::fillWith(), gum::Tensor< GUM_SCALAR >::fillWith(), gum::Tensor< GUM_SCALAR >::findAll(), gum::prm::PRMFormAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::getCastDescendant(), gum::JointTargetedInference< GUM_SCALAR >::jointMutualInformation(), gum::JointTargetedMRFInference< GUM_SCALAR >::jointMutualInformation(), gum::Tensor< GUM_SCALAR >::KL(), gum::Tensor< GUM_SCALAR >::normalizeAsCPT(), gum::Tensor< GUM_SCALAR >::operator&(), gum::prm::PRMInference< double >::operator=(), gum::IMarkovRandomField< GUM_SCALAR >::operator==(), gum::InfluenceDiagram< GUM_SCALAR >::operator==(), gum::Tensor< GUM_SCALAR >::operator|(), gum::Tensor< GUM_SCALAR >::operator~(), gum::FMDPSimulator::perform(), gum::prm::PRMInference< double >::posterior(), gum::prm::StructuredInference< GUM_SCALAR >::posterior_(), gum::prm::o3prmr::O3prmrInterpreter::query(), gum::Tensor< GUM_SCALAR >::randomCPT(), gum::MultiDimContainer< GUM_SCALAR >::reduce(), gum::prm::PRMFactory< GUM_SCALAR >::setCPFByRule(), gum::prm::PRMFactory< GUM_SCALAR >::setCPFByRule(), gum::Estimator< GUM_SCALAR >::setFromLBP(), gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByColumns(), gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByColumns(), gum::BayesNetFactory< GUM_SCALAR >::setVariableValuesUnchecked(), gum::prm::PRMFormAttribute< GUM_SCALAR >::swap(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::swap(), gum::Tensor< GUM_SCALAR >::toString(), gum::prm::PRMFormAttribute< GUM_SCALAR >::type_(), and gum::prm::PRMScalarAttribute< GUM_SCALAR >::type_().
|
finalvirtual |
Removes a variable from the Instantiation.
If variable v does not belong to the Instantiation tuple of variables, then NotFound is thrown. Since an instantiation must share the same set of variables with his master an OperationNotAllowed is raised if you try to remove a variable from a slaved instantiation.
| v | The variable to remove from this Instantiation. |
| NotFound | Raised if v does not belong to this Instantiation. |
| OperationNotAllowed | Raised if the instantiation is a slave. |
Implements gum::MultiDimInterface.
Definition at line 145 of file instantiation_inl.h.
References _erase_(), _master_, _vars_, and GUM_ERROR.
Referenced by gum::GibbsOperator< GUM_SCALAR >::_drawVarMonteCarlo_(), gum::GibbsOperator< GUM_SCALAR >::_GibbsSample_(), erase(), and gum::credal::CredalNet< GUM_SCALAR >::toString().
| INLINE void gum::Instantiation::erase | ( | const std::string & | name | ) |
Returns the number of variables in the Instantiation.
Definition at line 156 of file instantiation_inl.h.
References erase(), and variable().
| void gum::Instantiation::eraseWithMaster | ( | const MultiDimAdressable * | m, |
| const DiscreteVariable & | v ) |
Call Instantiation:: erase(const DiscreteVariable&) by master.
| m | The master of this instantiation. |
| v | The variable to remove. |
| OperationNotAllowed | Raised if m is not the master of this instantiation. |
Definition at line 246 of file instantiation.cpp.
References _erase_(), _master_, and GUM_ERROR.
| bool gum::Instantiation::forgetMaster | ( | ) |
Deassociate the master MultiDimAdressable, if any.
Definition at line 230 of file instantiation.cpp.
References _master_.
Referenced by gum::credal::CredalNet< GUM_SCALAR >::fillConstraint(), gum::credal::CredalNet< GUM_SCALAR >::setCPT(), and gum::credal::CredalNet< GUM_SCALAR >::toString().
| Idx gum::Instantiation::hamming | ( | ) | const |
Returns the hamming distance of this instantiation.
Definition at line 180 of file instantiation.cpp.
| INLINE void gum::Instantiation::inc | ( | ) |
Operator increment.
Note that this operator never throws an exception when it reaches the end of the possible values of the tuple of variables of the Instantiation. To know if we reached the end, use function end(). If the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. If we already reached the end() or the rend() of the possible values, function inc() will perform nothing (this prevents looping inadvertently several times within the same loop). To unset the end flag, use functions unsetOverflow(), unsetEnd() or one of the setFirst() or setLast().
Usage example:
Definition at line 234 of file instantiation_inl.h.
References _masterFirstNotification_(), _masterIncNotification_(), _overflow_, _vals_, _vars_, domainSize(), and nbrDim().
Referenced by gum::prm::PRMInference< GUM_SCALAR >::PRMInference(), gum::prm::PRMFormAttribute< GUM_SCALAR >::_fillCpf_(), gum::GraphicalModelInference< GUM_SCALAR >::_isHardEvidence_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_isHardEvidence_(), gum::credal::InferenceEngine< GUM_SCALAR >::addEvidence(), gum::prm::PRMFormAttribute< GUM_SCALAR >::becomeCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::becomeCastDescendant(), gum::prm::o3prmr::O3prmrInterpreter::checkObserve(), gum::GraphicalModelInference< GUM_SCALAR >::chgEvidence(), gum::MultiDimBucket< GUM_SCALAR >::compute(), gum::prm::PRMFormAttribute< GUM_SCALAR >::copy(), gum::prm::PRMFormAttribute< GUM_SCALAR >::copyCpf(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::copyCpf(), gum::DecisionTensor< GUM_SCALAR >::divideEvenZero(), gum::Tensor< GUM_SCALAR >::draw(), gum::prm::GroundedInference< GUM_SCALAR >::evidenceAdded_(), gum::prm::PRMFormAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::getCastDescendant(), gum::JointTargetedInference< GUM_SCALAR >::jointMutualInformation(), gum::JointTargetedMRFInference< GUM_SCALAR >::jointMutualInformation(), gum::Tensor< GUM_SCALAR >::KL(), operator++(), operator+=(), gum::prm::PRMInference< double >::operator=(), gum::IMarkovRandomField< GUM_SCALAR >::operator==(), gum::InfluenceDiagram< GUM_SCALAR >::operator==(), gum::prm::PRMInference< GUM_SCALAR >::posterior(), gum::prm::PRMInference< double >::posterior(), gum::prm::StructuredInference< GUM_SCALAR >::posterior_(), gum::prm::o3prmr::O3prmrInterpreter::query(), gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByColumns(), gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByColumns(), gum::prm::PRMFormAttribute< GUM_SCALAR >::swap(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::swap(), gum::prm::PRMFormAttribute< GUM_SCALAR >::type_(), and gum::prm::PRMScalarAttribute< GUM_SCALAR >::type_().
| INLINE void gum::Instantiation::incIn | ( | const Instantiation & | i | ) |
Operator increment for the variables in i.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated.
Note also that this operator never throws an exception when it reaches the end of the possible values of the tuple of variables of the Instantiation. To know if we reached the end, use function end(). Finally, let us mention that the value of instantiation i is not taken into account, that is, only the variables belonging to i are taken into account. The next value of *this is thus computed w.r.t. to the current value of *this. If we already reached the end() or the rend() of the possible values, function incIn() will perform nothing (this prevents looping inadvertently several times within the same loop). To unset the end flag, use functions unsetOverflow(), unsetEnd() or one of the setFirst() or setLast().
| i | The set of variables to increment in this Instantiation. |
Definition at line 348 of file instantiation_inl.h.
References Instantiation(), _chgVal_(), _overflow_, _vals_, _vars_, contains(), domainSize(), nbrDim(), pos(), and variable().
Referenced by gum::JointTargetedInference< GUM_SCALAR >::evidenceJointImpact(), gum::JointTargetedMRFInference< GUM_SCALAR >::evidenceJointImpact(), gum::prm::PRMFactory< GUM_SCALAR >::setCPFByRule(), gum::prm::PRMFactory< GUM_SCALAR >::setCPFByRule(), and gum::BayesNetFactory< GUM_SCALAR >::setVariableValuesUnchecked().
| INLINE void gum::Instantiation::incNotVar | ( | const DiscreteVariable & | v | ) |
Operator increment for vars which are not v.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. Note also that this operator never throws an exception when it reaches the end of the possible values of the tuple of variables of the Instantiation. To know if we reached the end, use function end(). If we already reached the end() or the rend() of the possible values, function incNotVar() will perform nothing (this prevents looping inadvertently several times within the same loop). To unset the end flag, use functions unsetOverflow(), unsetEnd() or one of the setFirst() or setLast().
| v | The variable not to increment in this Instantiation. |
Definition at line 542 of file instantiation_inl.h.
References _chgVal_(), _overflow_, _vals_, _vars_, domainSize(), and nbrDim().
Referenced by gum::BayesNetFactory< GUM_SCALAR >::_fillProbaWithValuesTable_(), gum::MarginalTargetedInference< GUM_SCALAR >::evidenceImpact(), gum::MarginalTargetedMRFInference< GUM_SCALAR >::evidenceImpact(), gum::Tensor< GUM_SCALAR >::normalizeAsCPT(), gum::Tensor< GUM_SCALAR >::randomCPT(), and gum::Tensor< GUM_SCALAR >::toString().
| INLINE void gum::Instantiation::incOut | ( | const Instantiation & | i | ) |
Operator increment for the variables not in i.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated.
Note also that this operator never throws an exception when it reaches the end of the possible values of the tuple of variables of the Instantiation. To know if we reached the end, use function end(). Finally, let us mention that the value of instantiation i is not taken into account, that is, only the variables not belonging to i are taken into account. The next value of *this is thus computed w.r.t. to the current value of *this. If we already reached the end() or the rend() of the possible values, function incerr() will perform nothing (this prevents looping inadvertently several times within the same loop). To unset the end flag, use functions unsetOverflow(), unsetEnd() or one of the setFirst() or setLast().
| i | The set of variable to not increment in this Instantiation. |
Definition at line 459 of file instantiation_inl.h.
References Instantiation(), _chgVal_(), _overflow_, _vals_, _vars_, contains(), domainSize(), and nbrDim().
Referenced by gum::JointTargetedInference< GUM_SCALAR >::evidenceJointImpact(), gum::JointTargetedMRFInference< GUM_SCALAR >::evidenceJointImpact(), gum::FMDPSimulator::perform(), and gum::BayesNetFactory< GUM_SCALAR >::setVariableValuesUnchecked().
| INLINE void gum::Instantiation::incVar | ( | const DiscreteVariable & | v | ) |
Operator increment for variable v only.
This function increment only variable v. Trying to increment the last possible value results in an overflow (no exception is thrown in this case). If we already reached the end() or the rend() of the possible values, function incVar() will perform nothing (this prevents looping inadvertently several times within the same loop). To unset the end flag, use functions unsetOverflow(), unsetEnd() or one of the setFirst() or setLast().
| v | The variable to increment in this Instantiation. |
| NotFound | Raised if variable v does not belong to the Instantiation. |
Definition at line 640 of file instantiation_inl.h.
References _chgVal_(), _overflow_, _vals_, _vars_, and gum::DiscreteVariable::domainSize().
Referenced by gum::BayesNetFactory< GUM_SCALAR >::_fillProbaWithValuesTable_(), gum::learning::BNDatabaseGenerator< GUM_SCALAR >::drawSamples(), gum::MarginalTargetedInference< GUM_SCALAR >::evidenceImpact(), gum::MarginalTargetedMRFInference< GUM_SCALAR >::evidenceImpact(), gum::Tensor< GUM_SCALAR >::normalizeAsCPT(), gum::Tensor< GUM_SCALAR >::randomCPT(), and gum::Tensor< GUM_SCALAR >::toString().
| INLINE bool gum::Instantiation::inOverflow | ( | ) | const |
Indicates whether the current value of the tuple is correct or not.
The function inOverflow() is used to flag overflowed operation (for instance, ++ on the last value or – on the first value will produce an incorrect value of the tuple. Hence inOverflow() is used as an end()/rend() function for loops on Instantiation.
Definition at line 218 of file instantiation_inl.h.
References _overflow_.
Referenced by end(), operator==(), and rend().
| INLINE bool gum::Instantiation::isMaster | ( | const MultiDimAdressable & | m | ) | const |
Indicates whether m is the master of this instantiation.
Definition at line 694 of file instantiation_inl.h.
References isMaster().
| INLINE bool gum::Instantiation::isMaster | ( | const MultiDimAdressable * | m | ) | const |
Indicates whether m is the master of this instantiation.
Definition at line 691 of file instantiation_inl.h.
References _master_.
Referenced by gum::MultiDimBijArray< GUM_SCALAR >::get(), gum::MultiDimBucket< GUM_SCALAR >::get(), gum::MultiDimSparse< GUM_SCALAR >::get(), gum::MultiDimArray< GUM_SCALAR >::get_(), isMaster(), operator=(), gum::MultiDimSparse< GUM_SCALAR >::set(), and gum::MultiDimWithOffset< GUM_SCALAR >::toString().
| INLINE bool gum::Instantiation::isSlave | ( | ) | const |
Indicates whether the Instantiation has a master.
Definition at line 688 of file instantiation_inl.h.
References _master_.
|
finalvirtual |
Returns the number of variables in the Instantiation.
Implements gum::MultiDimInterface.
Definition at line 181 of file instantiation_inl.h.
References _vars_.
Referenced by gum::aggregator::Amplitude< GUM_SCALAR >::buildValue_(), gum::aggregator::Median< GUM_SCALAR >::buildValue_(), gum::GibbsBNdistance< GUM_SCALAR >::computeKL_(), gum::BayesNet< GUM_SCALAR >::contextualize(), dec(), decIn(), decNotVar(), decOut(), gum::credal::CredalNet< GUM_SCALAR >::fillConstraint(), inc(), incIn(), incNotVar(), incOut(), gum::JointTargetedInference< GUM_SCALAR >::jointMutualInformation(), gum::JointTargetedMRFInference< GUM_SCALAR >::jointMutualInformation(), operator=(), operator==(), gum::MultiDimImplementation< GUM_SCALAR >::registerSlave(), gum::credal::CredalNet< GUM_SCALAR >::setCPT(), setFirst(), setFirstIn(), setFirstNotVar(), setFirstOut(), setLast(), setLastIn(), setLastNotVar(), setLastOut(), setVals(), and gum::Estimator< GUM_SCALAR >::update().
| INLINE Instantiation & gum::Instantiation::operator++ | ( | ) |
Alias of Instantiation::inc().
Definition at line 298 of file instantiation_inl.h.
References Instantiation(), and inc().
| INLINE Instantiation & gum::Instantiation::operator+= | ( | Size | depl | ) |
Calls depl times Instantiation::inc().
Definition at line 310 of file instantiation_inl.h.
References Instantiation(), and inc().
| INLINE Instantiation & gum::Instantiation::operator-- | ( | ) |
Alias of Instantiation::dec().
Definition at line 304 of file instantiation_inl.h.
References Instantiation(), and dec().
| INLINE Instantiation & gum::Instantiation::operator-= | ( | Size | depl | ) |
Calls depl times Instantiation::dec().
Definition at line 318 of file instantiation_inl.h.
References Instantiation(), and dec().
| Instantiation & gum::Instantiation::operator= | ( | const Instantiation & | aI | ) |
Copy operator.
If this is a slave but not with the same as aI's master: if aI and this does not share the same variables then an OperationNotAllowed will we be raised. Otherwise calls this->setVals( aI ).
If this is not a slave, copies aI.
| aI | The Instantiation to copy. |
| OperationNotAllowed | Raised if copy is not allowed. |
Definition at line 131 of file instantiation.cpp.
References Instantiation(), _master_, _overflow_, _vals_, _vars_, actAsSlave(), contains(), GUM_ERROR, isMaster(), nbrDim(), setVals(), and variable().
| INLINE bool gum::Instantiation::operator== | ( | const Instantiation & | other | ) | const |
operator==
Definition at line 789 of file instantiation_inl.h.
References Instantiation(), contains(), inOverflow(), nbrDim(), val(), and variablesSequence().
|
finalvirtual |
Returns the position of the variable v.
| v | The variable for which its position is return. |
| NotFound | Raised if v does not belong to the instantiation. |
Implements gum::MultiDimInterface.
Definition at line 178 of file instantiation_inl.h.
References _vars_.
Referenced by _erase_(), _reorder_(), gum::credal::CredalNet< GUM_SCALAR >::approximatedBinarization(), gum::prm::PRMFormAttribute< GUM_SCALAR >::becomeCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::becomeCastDescendant(), chgVal(), decIn(), incIn(), and setVals().
| INLINE bool gum::Instantiation::rend | ( | ) | const |
Returns true if the Instantiation reached the rend.
Function end() should be used as in:
Definition at line 224 of file instantiation_inl.h.
References inOverflow().
| INLINE void gum::Instantiation::reorder | ( | const Instantiation & | i | ) |
Calls reorder(const Sequence<const DiscreteVariable*>&) with i.variablesSequence().
| i | The sequence of variables with which to reorder this Instantiation. |
Definition at line 427 of file instantiation_inl.h.
References Instantiation(), reorder(), and variablesSequence().
| INLINE void gum::Instantiation::reorder | ( | const Sequence< const DiscreteVariable * > & | v | ) |
Reorder vars of this instantiation giving the order in v.
In the new order variables common to v and *this are placed first, then variables only in *this.
The variables only in v are ignored.
| v | The new order of variables for this Instantiation. |
| OperationNotAllowed | if slave instantiation |
Definition at line 716 of file instantiation_inl.h.
References _master_, _reorder_(), and GUM_ERROR.
Referenced by gum::credal::CredalNet< GUM_SCALAR >::fillConstraint(), reorder(), and gum::credal::CredalNet< GUM_SCALAR >::setCPT().
|
inherited |
Replace variables in this multidim.
If x is in this MultiDim and y has the same domain size, then x will be replace by y in this MultiDim.
| x | The variable in this which will be replaced. |
| y | The variable replacing y. |
| NotFound | Raised if x does not belong to this MultiDim. |
| OperationNotAllowed | If y and x are not interchangeable. |
| DuplicateElement | If y is already in this MultiDim. |
Definition at line 56 of file multiDimInterface_inl.h.
References contains(), gum::DiscreteVariable::domainSize(), GUM_ERROR, and replace_().
|
finalprotectedvirtual |
Replace x by y.
| x | The variable to replace. |
| y | The variable replacing x. |
Implements gum::MultiDimInterface.
Definition at line 768 of file instantiation_inl.h.
References _vars_.
| INLINE void gum::Instantiation::setFirst | ( | ) |
Assign the first values to the tuple of the Instantiation.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. This function naturally unsets the overFlow flag.
Definition at line 326 of file instantiation_inl.h.
References _masterFirstNotification_(), _overflow_, _vals_, and nbrDim().
Referenced by gum::prm::PRMInference< GUM_SCALAR >::PRMInference(), gum::prm::PRMFormAttribute< GUM_SCALAR >::_fillCpf_(), gum::credal::CredalNet< GUM_SCALAR >::_intervalToCredal_(), gum::GraphicalModelInference< GUM_SCALAR >::_isHardEvidence_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_isHardEvidence_(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::_threadUpdate_(), gum::credal::InferenceEngine< GUM_SCALAR >::addEvidence(), gum::MultiDimContainer< GUM_SCALAR >::apply(), gum::credal::CredalNet< GUM_SCALAR >::approximatedBinarization(), gum::prm::PRMFormAttribute< GUM_SCALAR >::becomeCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::becomeCastDescendant(), gum::credal::CredalNet< GUM_SCALAR >::bnToCredal(), gum::prm::o3prmr::O3prmrInterpreter::checkObserve(), gum::GraphicalModelInference< GUM_SCALAR >::chgEvidence(), gum::MultiDimBucket< GUM_SCALAR >::compute(), gum::prm::PRMFormAttribute< GUM_SCALAR >::copy(), gum::prm::PRMFormAttribute< GUM_SCALAR >::copyCpf(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::copyCpf(), gum::MCBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator, SimpleCPTDisturber >::disturbReducCPT(), gum::SimpleCPTDisturber< GUM_SCALAR >::disturbReducCPT(), gum::DecisionTensor< GUM_SCALAR >::divideEvenZero(), gum::Tensor< GUM_SCALAR >::draw(), gum::prm::GroundedInference< GUM_SCALAR >::evidenceAdded_(), gum::MarginalTargetedInference< GUM_SCALAR >::evidenceImpact(), gum::MarginalTargetedMRFInference< GUM_SCALAR >::evidenceImpact(), gum::credal::CredalNet< GUM_SCALAR >::fillConstraint(), gum::Tensor< GUM_SCALAR >::fillWith(), gum::Tensor< GUM_SCALAR >::fillWith(), gum::Tensor< GUM_SCALAR >::findAll(), gum::prm::PRMFormAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::getCastDescendant(), gum::credal::CredalNet< GUM_SCALAR >::idmLearning(), gum::credal::CredalNet< GUM_SCALAR >::intervalToCredal(), gum::credal::CredalNet< GUM_SCALAR >::intervalToCredalWithFiles(), gum::JointTargetedInference< GUM_SCALAR >::jointMutualInformation(), gum::JointTargetedMRFInference< GUM_SCALAR >::jointMutualInformation(), gum::Tensor< GUM_SCALAR >::KL(), gum::credal::CredalNet< GUM_SCALAR >::lagrangeNormalization(), gum::Tensor< GUM_SCALAR >::normalizeAsCPT(), gum::Tensor< GUM_SCALAR >::operator&(), gum::prm::PRMInference< double >::operator=(), gum::IMarkovRandomField< GUM_SCALAR >::operator==(), gum::InfluenceDiagram< GUM_SCALAR >::operator==(), gum::Tensor< GUM_SCALAR >::operator|(), gum::Tensor< GUM_SCALAR >::operator~(), gum::prm::PRMInference< GUM_SCALAR >::posterior(), gum::prm::PRMInference< double >::posterior(), gum::prm::StructuredInference< GUM_SCALAR >::posterior_(), gum::prm::o3prmr::O3prmrInterpreter::query(), gum::MultiDimContainer< GUM_SCALAR >::reduce(), setFirstNotVar(), gum::Estimator< GUM_SCALAR >::setFromLBP(), gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByColumns(), gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByColumns(), gum::BayesNetFactory< GUM_SCALAR >::setVariableValuesUnchecked(), gum::prm::PRMFormAttribute< GUM_SCALAR >::swap(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::swap(), gum::credal::CredalNet< GUM_SCALAR >::toString(), gum::Tensor< GUM_SCALAR >::toString(), gum::prm::PRMFormAttribute< GUM_SCALAR >::type_(), and gum::prm::PRMScalarAttribute< GUM_SCALAR >::type_().
| INLINE void gum::Instantiation::setFirstIn | ( | const Instantiation & | i | ) |
Assign the first values in the Instantiation for the variables in i.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. Note also that the value of instantiation i is not taken into account, that is, only the variables not belonging to i are taken into account. This function naturally unsets the overFlow flag.
| i | The variables to which their first value is assigned in this Instantiation. |
Definition at line 430 of file instantiation_inl.h.
References Instantiation(), _chgVal_(), _overflow_, _vars_, contains(), and nbrDim().
Referenced by gum::JointTargetedInference< GUM_SCALAR >::evidenceJointImpact(), gum::JointTargetedMRFInference< GUM_SCALAR >::evidenceJointImpact(), gum::prm::PRMFactory< GUM_SCALAR >::setCPFByRule(), gum::prm::PRMFactory< GUM_SCALAR >::setCPFByRule(), and gum::BayesNetFactory< GUM_SCALAR >::setVariableValuesUnchecked().
| INLINE void gum::Instantiation::setFirstNotVar | ( | const DiscreteVariable & | v | ) |
Assign the first values to variables different of v.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. This function naturally unsets the overFlow flag.
| v | Tha variable that will not be set to its first value in this Instantiation. |
Definition at line 606 of file instantiation_inl.h.
References _chgVal_(), _overflow_, _vals_, _vars_, nbrDim(), and setFirst().
Referenced by gum::BayesNetFactory< GUM_SCALAR >::_fillProbaWithValuesTable_(), and gum::Tensor< GUM_SCALAR >::randomCPT().
| INLINE void gum::Instantiation::setFirstOut | ( | const Instantiation & | i | ) |
Assign the first values in the Instantiation for the variables not in i.
Note that, if the Instantiation is related to a qum::MultiDimAdressable, then the corresponding value in the latter is updated. Note also that the value of instantiation i is not taken into account, that is, only the variables not belonging to i are taken into account. This function naturally unsets the overFlow flag.
| i | The variable that will not be set to their first value in this Instantiation. |
Definition at line 524 of file instantiation_inl.h.
References Instantiation(), _chgVal_(), _overflow_, _vars_, contains(), and nbrDim().
Referenced by gum::JointTargetedInference< GUM_SCALAR >::evidenceJointImpact(), gum::JointTargetedMRFInference< GUM_SCALAR >::evidenceJointImpact(), gum::FMDPSimulator::perform(), and gum::BayesNetFactory< GUM_SCALAR >::setVariableValuesUnchecked().
| INLINE void gum::Instantiation::setFirstVar | ( | const DiscreteVariable & | v | ) |
Assign the first value in the Instantiation for var v.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. This function naturally unsets the overFlow flag.
| v | The variable that will be set to its first value in this Instantiation. |
Definition at line 676 of file instantiation_inl.h.
References _chgVal_(), _overflow_, and _vars_.
Referenced by gum::BayesNetFactory< GUM_SCALAR >::_fillProbaWithValuesTable_(), gum::learning::BNDatabaseGenerator< GUM_SCALAR >::drawSamples(), gum::MarginalTargetedInference< GUM_SCALAR >::evidenceImpact(), gum::MarginalTargetedMRFInference< GUM_SCALAR >::evidenceImpact(), gum::Tensor< GUM_SCALAR >::normalizeAsCPT(), gum::Tensor< GUM_SCALAR >::randomCPT(), and gum::Tensor< GUM_SCALAR >::toString().
| INLINE void gum::Instantiation::setLast | ( | ) |
Assign the last values in the Instantiation.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. This function naturally unsets the overFlow flag.
Definition at line 337 of file instantiation_inl.h.
References _masterLastNotification_(), _overflow_, _vals_, _vars_, domainSize(), and nbrDim().
Referenced by setLastNotVar(), and gum::Tensor< GUM_SCALAR >::toString().
| INLINE void gum::Instantiation::setLastIn | ( | const Instantiation & | i | ) |
Assign the last values in the Instantiation for the variables in i.
Where Di is the domain size of variable i in the Instantiation) for the i vars.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. Note also that the value of instantiation i is not taken into account, that is, only the variables belonging to i are taken into account. This function naturally unsets the overFlow flag.
| i | The variables to which their last value is assigned in this Instantiation. |
Definition at line 450 of file instantiation_inl.h.
References Instantiation(), _chgVal_(), _overflow_, _vars_, contains(), domainSize(), and nbrDim().
| INLINE void gum::Instantiation::setLastNotVar | ( | const DiscreteVariable & | v | ) |
Assign the last values to variables different of v.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. This function naturally unsets the overFlow flag.
| v | The variable that will not be set to its last value in this Instantiation. |
Definition at line 623 of file instantiation_inl.h.
References _chgVal_(), _overflow_, _vals_, _vars_, nbrDim(), and setLast().
| INLINE void gum::Instantiation::setLastOut | ( | const Instantiation & | i | ) |
Assign the last values in the Instantiation for the variables not in i.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. Note also that the value of instantiation i is not taken into account, that is, only the variables not belonging to i are taken into account. This function naturally unsets the overFlow flag.
| i | The variables that will not be set to their last value in this Instantiation. |
Definition at line 533 of file instantiation_inl.h.
References Instantiation(), _chgVal_(), _overflow_, _vars_, contains(), domainSize(), and nbrDim().
| INLINE void gum::Instantiation::setLastVar | ( | const DiscreteVariable & | v | ) |
Assign the last value in the Instantiation for var v.
Note that, if the Instantiation is related to a MultiDimAdressable, then the corresponding value in the latter is updated. This function naturally unsets the overFlow flag.
| v | The variable that will be set to its last value in this Instantiation. |
Definition at line 682 of file instantiation_inl.h.
References _chgVal_(), _overflow_, _vars_, and gum::DiscreteVariable::domainSize().
Referenced by gum::learning::BNDatabaseGenerator< GUM_SCALAR >::drawSamples().
| INLINE Instantiation & gum::Instantiation::setVals | ( | const Instantiation & | i | ) |
Assign the values from i in the Instantiation.
For any variable in i and in *this, value of the variable in i is assigned to the variable in *this.
In addition of modifying the value of the variables in *this, the Instantiation informs its master of the modification. This function also unsets the overflow flag.
If no variables in i matches, then no value is changed.
| i | A Instantiation in which the new values are searched. |
Definition at line 439 of file instantiation_inl.h.
References Instantiation(), _chgVal_(), _overflow_, contains(), nbrDim(), pos(), val(), and variable().
Referenced by gum::SimpleCPTDisturber< GUM_SCALAR >::disturbReducCPT(), operator=(), gum::prm::PRMFactory< GUM_SCALAR >::setCPFByRule(), gum::prm::PRMFactory< GUM_SCALAR >::setCPFByRule(), gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByColumns(), gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByColumns(), and gum::BayesNetFactory< GUM_SCALAR >::setVariableValuesUnchecked().
| void gum::Instantiation::setValsFrom | ( | const HashTable< const DiscreteVariable *, const DiscreteVariable * > & | map, |
| const Instantiation & | external ) |
Assign the values of external in *this, using map as a bijection between external and this variables.
| map | Keys are variables in external. |
| external | An instantiation used to change the values in j. |
| NotFound | Raised if a variable in external does not point to a variable in *this or in external. |
Definition at line 189 of file instantiation.cpp.
References Instantiation(), chgVal(), GUM_ERROR, gum::Variable::name(), and val().
| void gum::Instantiation::synchronizeWithMaster | ( | const MultiDimAdressable * | m | ) |
Force the variables sequence to be the same as the master one.
The master should be a friend to notify dimensions changes friend class MultiDimAdressable.
| m | The master of this instantiation. |
| OperationNotAllowed | Raised if m is not the master of instantiation. |
Definition at line 239 of file instantiation.cpp.
References _master_, _reorder_(), and GUM_ERROR.
| std::string gum::Instantiation::toString | ( | ) | const |
Give a string version of instantiation.
Definition at line 157 of file instantiation.cpp.
References _overflow_, _vars_, and val().
Referenced by gum::operator<<(), gum::aggregator::MultiDimAggregator< GUM_SCALAR >::toString(), and gum::MultiDimICIModel< GUM_SCALAR >::toString().
| INLINE void gum::Instantiation::unsetEnd | ( | ) |
Alias for unsetOverflow().
Definition at line 231 of file instantiation_inl.h.
References _overflow_.
Referenced by gum::BayesNetFactory< GUM_SCALAR >::_fillProbaWithValuesTable_(), and gum::Tensor< GUM_SCALAR >::randomCPT().
| INLINE void gum::Instantiation::unsetOverflow | ( | ) |
Removes the flag overflow.
See full documentation for details. (Recommended).
When we use multiple inner loops w.r.t. a given Instantiation, it may happen that one inner loop reaches the end() of the Instantiation while the outer loops do not have reached it. This means that the inner loop has toggled the overflow flag. To enable the other loops to go on, we must unset this flag using function unsetOverflow(). For instance, assume that Prob represents probability P(b|a,c), then normalizing this proba can be performed using the following code:
Definition at line 228 of file instantiation_inl.h.
References _overflow_.
| INLINE Idx gum::Instantiation::val | ( | const DiscreteVariable & | var | ) | const |
Returns the current value of a given variable.
| var | The variable the value of which we wish to know. |
| NotFound | Raised it var does not belong to the instantiation. |
Definition at line 193 of file instantiation_inl.h.
| INLINE Idx gum::Instantiation::val | ( | const std::string & | name | ) | const |
Returns the number of variables in the Instantiation.
Definition at line 198 of file instantiation_inl.h.
References val(), and variable().
Returns the current value of the variable at position i.
| i | The index of the variable. |
| NotFound | Raised if the element cannot be found. |
Definition at line 184 of file instantiation_inl.h.
References _vals_, and GUM_ERROR.
Referenced by gum::GraphicalModelInference< GUM_SCALAR >::_isHardEvidence_(), gum::credal::InferenceEngine< GUM_SCALAR >::addEvidence(), gum::credal::CredalNet< GUM_SCALAR >::approximatedBinarization(), gum::aggregator::Amplitude< GUM_SCALAR >::buildValue_(), gum::aggregator::Median< GUM_SCALAR >::buildValue_(), gum::aggregator::MultiDimAggregator< GUM_SCALAR >::buildValue_(), gum::HashFunc< Instantiation >::castToSize(), gum::prm::o3prmr::O3prmrInterpreter::checkObserve(), gum::Tensor< GUM_SCALAR >::draw(), gum::MonteCarloSampling< GUM_SCALAR >::draw_(), gum::learning::BNDatabaseGenerator< GUM_SCALAR >::drawSamples(), gum::MarginalTargetedInference< GUM_SCALAR >::evidenceImpact(), gum::MarginalTargetedMRFInference< GUM_SCALAR >::evidenceImpact(), gum::JointTargetedInference< GUM_SCALAR >::evidenceJointImpact(), gum::JointTargetedMRFInference< GUM_SCALAR >::evidenceJointImpact(), gum::SDYNA::feedback(), gum::credal::CredalNet< GUM_SCALAR >::fillConstraint(), gum::Tensor< GUM_SCALAR >::fillWith(), gum::aggregator::MultiDimAggregator< GUM_SCALAR >::get(), gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::get(), gum::MultiDimLogit< GUM_SCALAR >::get(), gum::MultiDimNoisyAND< GUM_SCALAR >::get(), gum::MultiDimNoisyORCompound< GUM_SCALAR >::get(), gum::MultiDimNoisyORNet< GUM_SCALAR >::get(), gum::prm::PRMFormAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::getCastDescendant(), hamming(), gum::JointTargetedInference< GUM_SCALAR >::jointMutualInformation(), gum::JointTargetedMRFInference< GUM_SCALAR >::jointMutualInformation(), gum::IMarkovRandomField< GUM_SCALAR >::operator==(), gum::InfluenceDiagram< GUM_SCALAR >::operator==(), operator==(), gum::FMDPSimulator::perform(), gum::prm::o3prmr::O3prmrInterpreter::query(), gum::Tensor< GUM_SCALAR >::randomCPT(), gum::credal::CredalNet< GUM_SCALAR >::setCPT(), setVals(), setValsFrom(), gum::BayesNetFactory< GUM_SCALAR >::setVariableValuesUnchecked(), toString(), gum::Tensor< GUM_SCALAR >::toString(), gum::Estimator< GUM_SCALAR >::update(), and val().
| INLINE Idx gum::Instantiation::valFromPtr | ( | const DiscreteVariable * | pvar | ) | const |
Returns the current value of a given variable.
| pvar | The variable for which the value is returned. |
| NotFound | Raised if var does not belong to the instantiation. |
Definition at line 201 of file instantiation_inl.h.
References _vals_, and _vars_.
Referenced by gum::StatesCounter::_incState_(), gum::StatesChecker::_insertState_(), gum::StatesChecker::addState(), gum::MultiDimWithOffset< GUM_SCALAR >::getOffs_(), and gum::StatesCounter::incState().
|
finalvirtual |
Returns the variable with the name.
| name | The index of the variable |
| NotFound | Raised if the element cannot be found. |
Implements gum::MultiDimInterface.
Definition at line 209 of file instantiation_inl.h.
|
finalvirtual |
Returns the variable at position i in the tuple.
| i | The index of the variable |
| NotFound | Raised if the element cannot be found. |
Implements gum::MultiDimInterface.
Definition at line 206 of file instantiation_inl.h.
References _vars_.
Referenced by gum::BayesNet< double >::_copyTensors_(), gum::aggregator::Median< GUM_SCALAR >::buildValue_(), chgVal(), chgVal(), gum::GibbsBNdistance< GUM_SCALAR >::computeKL_(), gum::BayesNet< GUM_SCALAR >::contextualize(), decIn(), erase(), gum::credal::CredalNet< GUM_SCALAR >::fillConstraint(), gum::Tensor< GUM_SCALAR >::fillWith(), incIn(), gum::JointTargetedInference< GUM_SCALAR >::jointMutualInformation(), gum::JointTargetedMRFInference< GUM_SCALAR >::jointMutualInformation(), operator=(), gum::IMarkovRandomField< GUM_SCALAR >::operator==(), gum::InfluenceDiagram< GUM_SCALAR >::operator==(), gum::credal::CredalNet< GUM_SCALAR >::setCPT(), setVals(), gum::Estimator< GUM_SCALAR >::update(), and val().
|
finalvirtual |
Returns the sequence of DiscreteVariable of this instantiation.
Implements gum::MultiDimInterface.
Definition at line 697 of file instantiation_inl.h.
References _vars_.
Referenced by gum::StatesCounter::_incState_(), gum::StatesChecker::_insertState_(), gum::HashFunc< Instantiation >::castToSize(), gum::SDYNA::feedback(), gum::credal::CredalNet< GUM_SCALAR >::fillConstraint(), operator==(), reorder(), gum::StatesChecker::reset(), gum::StatesCounter::reset(), gum::credal::CredalNet< GUM_SCALAR >::setCPT(), gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByColumns(), and gum::prm::PRMFactory< GUM_SCALAR >::setRawCPFByColumns().
|
private |
The master, if any, contains precisely the set of variables to be instantiated.
Definition at line 1126 of file instantiation.h.
Referenced by Instantiation(), Instantiation(), Instantiation(), Instantiation(), Instantiation(), Instantiation(), ~Instantiation(), _masterChangeNotification_(), _masterDecNotification_(), _masterFirstNotification_(), _masterIncNotification_(), _masterLastNotification_(), actAsSlave(), add(), addWithMaster(), clear(), erase(), eraseWithMaster(), forgetMaster(), isMaster(), isSlave(), operator=(), reorder(), and synchronizeWithMaster().
|
private |
Indicates whether the current value of the tuple is valid when we loop sufficiently over values of the tuple, we may have browsed all the possible values and we have to know in a way or another that the tuple contains no more value. This is precisely the meaning of Boolean overflow.
Definition at line 1139 of file instantiation.h.
Referenced by Instantiation(), Instantiation(), Instantiation(), Instantiation(), Instantiation(), Instantiation(), _add_(), chgVal(), chgVal(), dec(), decIn(), decNotVar(), decOut(), decVar(), inc(), incIn(), incNotVar(), incOut(), incVar(), inOverflow(), operator=(), setFirst(), setFirstIn(), setFirstNotVar(), setFirstOut(), setFirstVar(), setLast(), setLastIn(), setLastNotVar(), setLastOut(), setLastVar(), setVals(), toString(), unsetEnd(), and unsetOverflow().
|
private |
The current instantiation: the value of the tuple.
Definition at line 1132 of file instantiation.h.
Referenced by Instantiation(), _add_(), _chgVal_(), _erase_(), _init_(), _swap_(), chgVal(), clear(), dec(), decIn(), decNotVar(), decOut(), decVar(), empty(), inc(), incIn(), incNotVar(), incOut(), incVar(), operator=(), setFirst(), setFirstNotVar(), setLast(), setLastNotVar(), val(), val(), and valFromPtr().
|
private |
The tuple of variables to be instantiated.
Definition at line 1129 of file instantiation.h.
Referenced by Instantiation(), _add_(), _erase_(), _init_(), _masterChangeNotification_(), _swap_(), add(), chgVal(), chgVal(), clear(), contains(), contains(), contains(), dec(), decIn(), decNotVar(), decOut(), decVar(), domainSize(), erase(), hamming(), inc(), incIn(), incNotVar(), incOut(), incVar(), nbrDim(), operator=(), pos(), replace_(), setFirstIn(), setFirstNotVar(), setFirstOut(), setFirstVar(), setLast(), setLastIn(), setLastNotVar(), setLastOut(), setLastVar(), toString(), val(), valFromPtr(), variable(), variable(), and variablesSequence().