47#ifndef GUM_LEARNING_ID_SET_H
48#define GUM_LEARNING_ID_SET_H
183#ifndef DOXYGEN_SHOULD_SKIP_THIS
190 std::size_t _index_{std::size_t(0)};
196 friend class IdCondSet;
236 IdCondSet(
const std::vector< NodeId >&
ids,
const bool rhs_ids,
const bool ordered_ids);
246 const std::vector< NodeId >& rhs_ids,
247 const bool ordered_rhs_ids =
false);
263 const std::vector< NodeId >& rhs_ids,
264 const bool ordered_lhs_vars,
265 const bool ordered_rhs_ids =
false);
281 const std::vector< NodeId >& rhs_ids,
282 const bool ordered_lhs_vars,
283 const bool ordered_rhs_ids =
false);
408#ifndef DOXYGEN_SHOULD_SKIP_THIS
415 std::size_t _nb_lhs_ids_{std::size_t(0)};
All hash functions should inherit from this class.
Size operator()(const learning::IdCondSet &key) const final
computes the hashed value of a key
static Size castToSize(const learning::IdCondSet &key)
Returns the value of a key as a Size.
This class should be useless as only its specializations should be used.
The iterators for IdSets.
virtual ~IdCondSetIterator()
destructor
NodeId & reference
types for STL compliance
std::forward_iterator_tag iterator_category
types for STL compliance
const NodeId * const_pointer
types for STL compliance
IdCondSetIterator()
default constructor
IdCondSetIterator(const IdCondSet &idset)
Constructor for a begin.
NodeId value_type
types for STL compliance
IdCondSetIterator & operator++()
Makes the iterator point to the next element in the IdCondSet.
IdCondSetIterator(IdCondSetIterator &&from)
move constructor
NodeId operator*() const
Gives access to the content of the iterator.
std::size_t pos() const
Returns the position of the iterator in the IdCondSet.
bool operator!=(const IdCondSetIterator &from) const
Checks whether two iterators point toward different elements.
IdCondSetIterator(const IdCondSetIterator &from)
Copy constructor.
const NodeId & const_reference
types for STL compliance
std::ptrdiff_t difference_type
types for STL compliance
IdCondSetIterator & operator=(IdCondSetIterator &&from)
move operator
IdCondSetIterator & operator=(const IdCondSetIterator &from)
copy operator
bool operator==(const IdCondSetIterator &from) const
Checks whether two iterators point toward the same elements.
NodeId * pointer
types for STL compliance
IdCondSetIterator & operator+=(const std::size_t i)
Makes the iterator point to i elements further in the IdCondSet.
IdCondSetIterator operator+(const std::size_t i)
Returns a new iterator pointing to i further elements in the IdCondSet.
A class for storing a pair of sets of NodeIds, the second one corresponding to a conditional set.
bool contains(const IdCondSet &set) const
indicates whether the IdCondSet contains the IdCondSet passed in argument
bool empty() const
indicates whether the IdCondSet contains some nodes or not
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
IdCondSetIterator iterator_safe
IdCondSetIterator const_iterator
std::size_t nbRHSIds() const
returns the number of right hand side ids
std::size_t pos(const NodeId id) const
returns the position of a given node in the IdCondSet
void clear()
removes all the nodes from the IdCondSet
bool operator!=(const IdCondSet &from) const
returns true if the sets differ
virtual ~IdCondSet()
destructor
std::string toString() const
returns the content of the set as a string
const iterator_safe & endSafe() const
Returns the safe end iterator.
NodeId operator[](const std::size_t index) const
returns the node id stored at a given index
std::pair< NodeSet, NodeSet > toNodeSets() const
returns the pair of conditioned gum::NodeSet and conditioning gum::NodeSet
virtual IdCondSet * clone() const
virtual copy constructor
bool exists(const NodeId id) const
indicates whether a given id is contained in the IdCondSet
IdCondSetIterator const_iterator_safe
IdCondSet(const IdCondSet &from)
copy constructor
void erase(const NodeId id)
erase a node in the idset
IdCondSet & operator=(IdCondSet &&from)
move operator
std::size_t size() const
returns the number of variables (both left and right hand side)
IdCondSet & operator=(const IdCondSet &from)
copy operator
IdCondSet(NodeId var1, const std::vector< NodeId > &rhs_ids, const bool ordered_rhs_ids=false)
default constructor with one variable on the left side
bool operator==(const IdCondSet &from) const
returns true if both sets are equal
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
iterator begin() const
Returns an unsafe begin iterator.
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
iterator_safe beginSafe() const
Returns a safe begin iterator.
IdCondSet(IdCondSet &&from)
move constructor
IdCondSet(const std::vector< NodeId > &ids, const bool rhs_ids, const bool ordered_ids)
default constructor with no variable on the left side
const iterator & end() const
Returns the unsafe end iterator.
IdCondSet()
default constructor
IdCondSetIterator iterator
std::size_t nbLHSIds() const
returns the number of left hand side ids
bool hasConditioningSet() const
indicates whether the idset contains a non-empty conditioning set
some utils for topology : NodeId, Edge, Arc and consorts ...
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
Template implementation of idSets.
include the inlined functions if necessary
std::ostream & operator<<(std::ostream &stream, const IdCondSet &idset)
the display operator
gum is the global namespace for all aGrUM entities
Header file of gum::Sequence, a class for storing (ordered) sequences of objects.