28 #ifndef GUM_LEARNING_ID_SET_H 29 #define GUM_LEARNING_ID_SET_H 34 #include <type_traits> 47 template <
template <
typename >
class ALLOC >
56 template <
template <
typename >
class ALLOC = std::allocator >
159 std::size_t
pos()
const;
164 #ifndef DOXYGEN_SHOULD_SKIP_THIS 171 std::size_t __index{std::size_t(0)};
177 friend class IdSet< ALLOC >;
196 template <
template <
typename >
class ALLOC = std::allocator >
197 class IdSet :
private ALLOC< NodeId > {
222 IdSet(
const std::vector<
NodeId, ALLOC< NodeId > >& ids,
224 const bool ordered_ids,
235 const std::vector<
NodeId, ALLOC< NodeId > >& rhs_ids,
236 const bool ordered_rhs_ids =
false,
253 const std::vector<
NodeId, ALLOC< NodeId > >& rhs_ids,
254 const bool ordered_lhs_vars,
255 const bool ordered_rhs_ids =
false,
272 const std::vector<
NodeId, ALLOC< NodeId > >& rhs_ids,
273 const bool ordered_lhs_vars,
274 const bool ordered_rhs_ids =
false,
313 NodeId operator[](
const std::size_t index)
const;
368 std::size_t nbLHSIds()
const;
371 std::size_t nbRHSIds()
const;
380 std::size_t size()
const;
387 bool exists(
const NodeId id)
const;
392 void erase(
const NodeId id);
395 bool hasConditioningSet()
const;
401 std::string toString()
const;
409 #ifndef DOXYGEN_SHOULD_SKIP_THIS 416 std::size_t __nb_lhs_ids{std::size_t(0)};
426 template <
template <
typename >
class ALLOC >
427 std::ostream& operator<<(std::ostream& stream, const IdSet< ALLOC >& idset);
433 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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.