25 #ifndef GUM_LEARNING_ID_SET_H 26 #define GUM_LEARNING_ID_SET_H 31 #include <type_traits> 44 template <
template <
typename >
class ALLOC >
53 template <
template <
typename >
class ALLOC = std::allocator >
156 std::size_t
pos()
const;
161 #ifndef DOXYGEN_SHOULD_SKIP_THIS 168 std::size_t __index{std::size_t(0)};
174 friend class IdSet< ALLOC >;
193 template <
template <
typename >
class ALLOC = std::allocator >
194 class IdSet :
private ALLOC< NodeId > {
219 IdSet(
const std::vector<
NodeId, ALLOC< NodeId > >& ids,
221 const bool ordered_ids,
232 const std::vector<
NodeId, ALLOC< NodeId > >& rhs_ids,
233 const bool ordered_rhs_ids =
false,
250 const std::vector<
NodeId, ALLOC< NodeId > >& rhs_ids,
251 const bool ordered_lhs_vars,
252 const bool ordered_rhs_ids =
false,
269 const std::vector<
NodeId, ALLOC< NodeId > >& rhs_ids,
270 const bool ordered_lhs_vars,
271 const bool ordered_rhs_ids =
false,
310 NodeId operator[](
const std::size_t index)
const;
365 std::size_t nbLHSIds()
const;
368 std::size_t nbRHSIds()
const;
377 std::size_t size()
const;
384 bool exists(
const NodeId id)
const;
389 void erase(
const NodeId id);
392 bool hasConditioningSet()
const;
398 std::string toString()
const;
406 #ifndef DOXYGEN_SHOULD_SKIP_THIS 413 std::size_t __nb_lhs_ids{std::size_t(0)};
423 template <
template <
typename >
class ALLOC >
424 std::ostream& operator<<(std::ostream& stream, const IdSet< ALLOC >& idset);
430 template <
template <
typename >
class ALLOC >
const NodeId * const_pointer
types for STL compliance
IdSetIterator< ALLOC > operator+(const std::size_t i)
Returns a new iterator pointing to i further elements in the IdSet.
bool operator!=(const IdSetIterator< ALLOC > &from) const
Checks whether two iterators point toward different elements.
IdSetIterator< ALLOC > & operator=(const IdSetIterator< ALLOC > &from)
copy operator
Header file of gum::Sequence, a class for storing (ordered) sequences of objects. ...
The iterators for IdSets.
bool operator==(const IdSetIterator< ALLOC > &from) const
Checks whether two iterators point toward the same elements.
virtual ~IdSetIterator()
destructor
The generic class for storing (ordered) sequences of objects.
ALLOC< NodeId > allocator_type
type for the allocators passed in arguments of methods
A class for storing a pair of sets of NodeIds, the second one corresponding to a conditional set...
Class template representing hashing function of LpCol.
gum is the global namespace for all aGrUM entities
NodeId & reference
types for STL compliance
IdSetIterator< ALLOC > & operator+=(const std::size_t i)
Makes the iterator point to i elements further in the IdSet.
NodeId * pointer
types for STL compliance
Template implementation of idSets.
IdSetIterator()
default constructor
NodeId operator*() const
Gives access to the content of the iterator.
const NodeId & const_reference
types for STL compliance
NodeId value_type
types for STL compliance
All hash functions should inherit from this class.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
IdSetIterator< ALLOC > & operator++()
Makes the iterator point to the next element in the IdSet.
std::forward_iterator_tag iterator_category
types for STL compliance
std::size_t pos() const
Returns the position of the iterator in the IdSet.
Size NodeId
Type for node ids.
std::ptrdiff_t difference_type
types for STL compliance
some utils for topology : NodeId, Edge, Arc and consorts ...