|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
58 template<
class I1,
class I2,
class E,
class H1 = DefHashFunc<I1>,
class H2 = DefHashFunc<I2>>
68 explicit HashArray2D(
const E& defaultValue,
const H1& hashFunc1 = H1(),
69 const H2& hashFunc2 = H2())
106 return pElement->
info();
The namespace for all OGDF objects.
Const-iterator for 2D-hash arrays.
HashElement< Tuple2< I1, I2 >, E > * fastInsert(const Tuple2< I1, I2 > &key, const E &info)
Inserts a new element with key key and information info into the hash table.
Declaration of classes used for hashing.
Indexed 2-dimensional arrays using hashing for element access.
Tuples of two elements (2-tuples).
HashConstIterator2D< I1, I2, E, H1, H2 > begin() const
Returns an iterator pointing to the first element.
Hashing with chaining and table doubling.
E m_defaultValue
The default value of the array.
HashArray2D(const E &defaultValue, const H1 &hashFunc1=H1(), const H2 &hashFunc2=H2())
Creates a 2D-hash array and sets the default value to defaultValue.
HashArray2D & operator=(const HashArray2D< I1, I2, E, H1, H2 > &A)
Assignment operator.
void clear()
Undefines all indices.
void undefine(const I1 &i, const I2 &j)
Undefines the entry at index (i,j).
HashArray2D()
Creates a 2D-hash array.
Declaration of class HashIterator2D.
E & operator()(const I1 &i, const I2 &j)
Returns a reference to entry (i,j).
int empty() const
Returns if any indices are defined.
const E & operator()(const I1 &i, const I2 &j) const
Returns a const reference to entry (i,j).
void del(const Tuple2< I1, I2 > &key)
Removes the element with key key from the hash table (does nothing if no such element).
HashElement< Tuple2< I1, I2 >, E > * lookup(const Tuple2< I1, I2 > &key) const
Returns the hash element with key key in the hash table; returns nullptr if no such element exists.
bool member(const Tuple2< I1, I2 > &key) const
Returns true iff the hash table contains an element with key key.
HashArray2D(const HashArray2D< I1, I2, E, H1, H2 > &A)
Copy constructor.
int size() const
Returns the number of defined elements in the table.
Representation of elements in a hash table.
const I & info() const
Returns the information value.
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.
bool isDefined(const I1 &i, const I2 &j) const
Returns true iff entry (i,j) is defined.