Include file:
#include "mcrl2/utilities/hashtable.h
mcrl2::utilities::
hashtable
¶A set that assigns each element an unique index.
mcrl2::utilities::hashtable::
const_reverse_iterator
¶typedef for std::vector< Key >::const_reverse_iterator
begin
()Forward iterator which runs through the elements from the lowest to the largest number.
Complexity is constant per operation.
begin
() constForward iterator which runs through the elements from the lowest to the largest number.
Complexity is constant per operation.
cbegin
() const¶const_iterator going through the elements in the set numbered from zero upwards.
cend
() const¶End of the forward const_iterator.
clear
()Clears the indexed set by removing all its elements. It is not guaranteed that the memory is released too.
crbegin
() const¶Reverse const_iterator going through the elements from the highest to the lowest numbered element.
crend
() const¶End of the reverse const_iterator.
end
()End of the forward iterator.
end
() constEnd of the forward iterator.
erase
(const key_type &key)¶Erases the key assuming that this key is present in the hashtable..
Returns: An iterator to the next key.
find
(const key_type &key)Find the given key and returns an iterator to that position.
hashtable
()¶Constructor of an empty indexed set. Starts with a hashtable of size 128.
hashtable
(std::size_t initial_hashtable_size, const hasher &hash = hasher(), const key_equal &equals = key_equal())¶Constructor of an empty index set. Starts with a hashtable of the indicated size.
Parameters:
initial_hashtable_size The initial size of the hashtable.
hash The hash function.
equals The comparison function for its elements.
insert
(const key_type &key)¶Insert a key in the indexed set and return its index.
If the element was already in the set, the resulting bool is true, and the existing index is returned. Otherwise, the key is inserted in the set, and the next available index is assigned to it.
Parameters:
key The key to be inserted in the set.
Returns: The index of the key and a boolean indicating whether the element was actually inserted.
must_resize
()¶Check whether the hashtable must be resized. This is not automatic and must be done explicitly.
rbegin
()¶Reverse iterator going through the elements in the set from the largest to the smallest index.
resize
()¶Resize the hashtable. This is not done automatically.
size
() constThe number of elements in the indexed set.
Returns: The number of elements in the indexed set.