![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
A class for storing a pair of sets of NodeIds, the second one corresponding to a conditional set. More...
#include <idCondSet.h>
Public Types | |
| using | iterator = IdCondSetIterator |
| using | const_iterator = IdCondSetIterator |
| using | iterator_safe = IdCondSetIterator |
| using | const_iterator_safe = IdCondSetIterator |
Public Member Functions | |
Constructors / Destructors | |
| IdCondSet () | |
| default constructor | |
| IdCondSet (const std::vector< NodeId > &ids, const bool rhs_ids, const bool ordered_ids) | |
| default constructor with no variable on the left side | |
| IdCondSet (NodeId var1, const std::vector< NodeId > &rhs_ids, const bool ordered_rhs_ids=false) | |
| default constructor with one variable on the left side | |
| IdCondSet (NodeId var1, NodeId var2, const std::vector< NodeId > &rhs_ids, const bool ordered_lhs_vars, const bool ordered_rhs_ids=false) | |
| default constructor with two variables on the left side | |
| IdCondSet (NodeId var1, NodeId var2, NodeId var3, const std::vector< NodeId > &rhs_ids, const bool ordered_lhs_vars, const bool ordered_rhs_ids=false) | |
| default constructor with three variables on the left side | |
| IdCondSet (const IdCondSet &from) | |
| copy constructor | |
| IdCondSet (IdCondSet &&from) | |
| move constructor | |
| virtual IdCondSet * | clone () const |
| virtual copy constructor | |
| virtual | ~IdCondSet () |
| destructor | |
Operators | |
| IdCondSet & | operator= (const IdCondSet &from) |
| copy operator | |
| IdCondSet & | operator= (IdCondSet &&from) |
| move operator | |
| NodeId | operator[] (const std::size_t index) const |
| returns the node id stored at a given index | |
| bool | operator== (const IdCondSet &from) const |
| returns true if both sets are equal | |
| bool | operator!= (const IdCondSet &from) const |
| returns true if the sets differ | |
Iterators | |
| iterator_safe | beginSafe () const |
| Returns a safe begin iterator. | |
| const iterator_safe & | endSafe () const |
| Returns the safe end iterator. | |
| iterator | begin () const |
| Returns an unsafe begin iterator. | |
| const iterator & | end () const |
| Returns the unsafe end iterator. | |
Accessors / Modifiers | |
| const Sequence< NodeId > & | ids () const |
| returns the set of ids | |
| IdCondSet | conditionalIdCondSet () const |
| returns the idSet at the right hand side of the conditioning bar | |
| std::size_t | nbLHSIds () const |
| returns the number of left hand side ids | |
| std::size_t | nbRHSIds () const |
| returns the number of right hand side ids | |
| bool | contains (const IdCondSet &set) const |
| indicates whether the IdCondSet contains the IdCondSet passed in argument | |
| void | clear () |
| removes all the nodes from the IdCondSet | |
| std::size_t | size () const |
| returns the number of variables (both left and right hand side) | |
| std::size_t | pos (const NodeId id) const |
| returns the position of a given node in the IdCondSet | |
| bool | exists (const NodeId id) const |
| indicates whether a given id is contained in the IdCondSet | |
| void | erase (const NodeId id) |
| erase a node in the idset | |
| bool | hasConditioningSet () const |
| indicates whether the idset contains a non-empty conditioning set | |
| bool | empty () const |
| indicates whether the IdCondSet contains some nodes or not | |
| std::string | toString () const |
| returns the content of the set as a string | |
| std::pair< NodeSet, NodeSet > | toNodeSets () const |
| returns the pair of conditioned gum::NodeSet and conditioning gum::NodeSet | |
A class for storing a pair of sets of NodeIds, the second one corresponding to a conditional set.
IdCondSets are used by learning caches to store pairs of sets of nodes, the second ones represent typically conditional sets. This is useful for storing in hashtables the scores assigned to sets of nodes given other nodes. NodeSets are actually not well suited for this purpose because their implementations makes the computation of their hash values quite difficult. IdCondSets fix this issue.
Definition at line 214 of file idCondSet.h.
Definition at line 217 of file idCondSet.h.
Definition at line 219 of file idCondSet.h.
Definition at line 216 of file idCondSet.h.
Definition at line 218 of file idCondSet.h.
| gum::learning::IdCondSet::IdCondSet | ( | ) |
default constructor
Referenced by IdCondSet(), IdCondSet(), clone(), conditionalIdCondSet(), contains(), operator!=(), operator=(), operator=(), and operator==().
| gum::learning::IdCondSet::IdCondSet | ( | const std::vector< NodeId > & | ids, |
| const bool | rhs_ids, | ||
| const bool | ordered_ids ) |
default constructor with no variable on the left side
| ids | the set of variables |
| rhs_ids | indicate whether the ids are on the right side of the conditioning bar or not |
| ordered_ids | indicates whether the ids in rhs_ids should be considered as an ordered set or an unordered set |
References ids().
| gum::learning::IdCondSet::IdCondSet | ( | NodeId | var1, |
| const std::vector< NodeId > & | rhs_ids, | ||
| const bool | ordered_rhs_ids = false ) |
default constructor with one variable on the left side
| var1 | the variable on the left side of the conditioning bar |
| rhs_ids | the set of variables on the right side of the conditioning bar |
| ordered_rhs_ids | indicates whether the ids in rhs_ids should be considered as an ordered set or an unordered set |
| gum::learning::IdCondSet::IdCondSet | ( | NodeId | var1, |
| NodeId | var2, | ||
| const std::vector< NodeId > & | rhs_ids, | ||
| const bool | ordered_lhs_vars, | ||
| const bool | ordered_rhs_ids = false ) |
default constructor with two variables on the left side
| var1 | the 1st variable on the left side of the conditioning bar |
| var2 | the 2nd variable on the left side of the conditioning bar |
| rhs_ids | the set of variables on the right side of the conditioning bar |
| ordered_lhs_vars | a Boolean indicating whether {var1,var2} should be considered as an ordered set or not. Typically, in an independence test, this set is unordered. When set to false, |
| ordered_rhs_ids | indicates whether the ids in rhs_ids should be considered as an ordered set or an unordered set |
| ordered_rhs_ids |
| gum::learning::IdCondSet::IdCondSet | ( | NodeId | var1, |
| NodeId | var2, | ||
| NodeId | var3, | ||
| const std::vector< NodeId > & | rhs_ids, | ||
| const bool | ordered_lhs_vars, | ||
| const bool | ordered_rhs_ids = false ) |
default constructor with three variables on the left side
| var1 | the 1st variable on the left side of the conditioning bar |
| var2 | the 2nd variable on the left side of the conditioning bar |
| var3 | the 3rd variable on the left side of the conditioning bar |
| rhs_ids | the set of variables on the right side of the conditioning bar |
| ordered_vars | a Boolean indicating whether {var1,var2,var3} should be considered as an ordered set or not. |
| ordered_rhs_ids | indicates whether the ids in rhs_ids should be considered as an ordered set or an unordered set |
| gum::learning::IdCondSet::IdCondSet | ( | const IdCondSet & | from | ) |
| gum::learning::IdCondSet::IdCondSet | ( | IdCondSet && | from | ) |
|
virtual |
destructor
| iterator gum::learning::IdCondSet::begin | ( | ) | const |
Returns an unsafe begin iterator.
| iterator_safe gum::learning::IdCondSet::beginSafe | ( | ) | const |
Returns a safe begin iterator.
| void gum::learning::IdCondSet::clear | ( | ) |
removes all the nodes from the IdCondSet
|
virtual |
| IdCondSet gum::learning::IdCondSet::conditionalIdCondSet | ( | ) | const |
returns the idSet at the right hand side of the conditioning bar
References IdCondSet().
indicates whether the IdCondSet contains the IdCondSet passed in argument
References IdCondSet().
| bool gum::learning::IdCondSet::empty | ( | ) | const |
indicates whether the IdCondSet contains some nodes or not
| const iterator & gum::learning::IdCondSet::end | ( | ) | const |
Returns the unsafe end iterator.
| const iterator_safe & gum::learning::IdCondSet::endSafe | ( | ) | const |
Returns the safe end iterator.
| void gum::learning::IdCondSet::erase | ( | const NodeId | id | ) |
erase a node in the idset
If the element cannot be found, the function does nothing. In particular, it throws no exception.
indicates whether a given id is contained in the IdCondSet
| bool gum::learning::IdCondSet::hasConditioningSet | ( | ) | const |
indicates whether the idset contains a non-empty conditioning set
| std::size_t gum::learning::IdCondSet::nbLHSIds | ( | ) | const |
returns the number of left hand side ids
| std::size_t gum::learning::IdCondSet::nbRHSIds | ( | ) | const |
returns the number of right hand side ids
returns true if both sets are equal
References IdCondSet().
| NodeId gum::learning::IdCondSet::operator[] | ( | const std::size_t | index | ) | const |
returns the node id stored at a given index
| std::size_t gum::learning::IdCondSet::pos | ( | const NodeId | id | ) | const |
| std::size_t gum::learning::IdCondSet::size | ( | ) | const |
returns the number of variables (both left and right hand side)
returns the pair of conditioned gum::NodeSet and conditioning gum::NodeSet
| std::string gum::learning::IdCondSet::toString | ( | ) | const |
returns the content of the set as a string