Include file:
#include "mcrl2/atermpp/indexed_set.h
atermpp::
indexed_set
¶Indexed set.
free_positions
¶
hashtable
¶
m_keys
¶
max_load
¶
nr_of_insertions_until_next_rehash
¶
sizeMinus1
¶
npos
¶A constant that if returned as an index means that the index does not exist.
put_in_hashtable
(const ELEMENT &key, std::size_t n)¶
resize_hashtable
()¶
clear
()¶Clear the hash table in the set. This function clears the hash table in the set, but does not release the memory. Using indexed_set_reset instead of indexed_set_destroy is preferable when indexed sets of approximately the same size are being used.
defined
(std::size_t index) const¶Indicates whether a certain index is defined.
Parameters:
Returns: The element in the set with the given index.
erase
(const ELEMENT &key)¶Remove an element from set.
The element with the indicated key is removed from the indexed set, and if a number was assigned to it, this number is freed to be reassigned to another element, that may be put into the set at some later instance.
Parameters:
Returns: whether the element was successfully removed.
get
(std::size_t index) const¶Retrieve the element at index in set. This function must be invoked with a valid index and it returns the elem assigned to this index. If it is invoked with an invalid index, effects are not predictable.
Parameters:
Returns: The element in the set with the given index.
index
(const ELEMENT &elem) const¶Find the index of elem in set. The index assigned to elem is returned, except when elem is not in the set, in which case the return value is indexed_set::npos, i.e. the largest number in std::size_t.
Parameters:
Returns: The index of the element.
indexed_set
(std::size_t initial_size = 100, unsigned int max_load_pct = 75)¶Create a new indexed_set.
Parameters:
operator[]
(const ELEMENT &elem)¶Find the index of elem in set. The index assigned to elem is returned. When elem is not in the set, it will be added first.
Parameters:
Returns: The index of the element.
put
(const ELEMENT &key)¶Enter an element with the indicated key into the set.
This functions enters an element with the indicated key into the set. If elem was already in the set the previously assigned index of key is returned, and the boolean is set to false. If key did not yet occur in set a new number is assigned, and the boolean is set to true. This number can either be the number of an element that has been removed, or, if such a number is not available, the lowest non used number is assigned to elem and returned. The lowest number that is used is 0.
Parameters:
Returns: A pair denoting the index of the element in the set, and a boolean denoting whether the term was already contained in the set.
size
() const¶Returns the size of the indexed set.