63 class H1 = DefHashFunc<I1>,
64 class H2 = DefHashFunc<I2> >
75 explicit HashArray2D(
const E &defaultValue,
const H1 &hashFunc1 = H1(),
const H2 &hashFunc2 = H2()) :
110 return pElement->
info();
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.
void clear()
Undefines all indices.
Declaration and implementation of HashArray class.
int size() const
Returns the number of defined elements in the table.
Const-iterator for 2D-hash arrays.
const I & info() const
Returns the information value.
const E & operator()(const I1 &i, const I2 &j) const
Returns a const reference to entry (i,j).
Declaration of class HashIterator2D.
bool isDefined(const I1 &i, const I2 &j) const
Returns true iff entry (i,j) is defined.
Indexed 2-dimensional arrays using hashing for element access.
E m_defaultValue
The default value of the array.
Tuples of two elements (2-tuples).
HashArray2D & operator=(const HashArray2D< I1, I2, E, H1, H2 > &A)
Assignment operator.
Representation of elements in a hash table.
Declaration and implementation of class Tuple2, Tuple3 and Tuple4.
void undefine(const I1 &i, const I2 &j)
Undefines the entry at index (i,j).
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.
HashConstIterator2D< I1, I2, E, H1, H2 > begin() const
Returns an iterator pointing to the first element.
HashArray2D()
Creates a 2D-hash array.
int empty() const
Returns if any indices are defined.
Hashing with chaining and table doubling.
E & operator()(const I1 &i, const I2 &j)
Returns a reference to entry (i,j).
The namespace for all OGDF objects.
void del(const Tuple2< I1, I2 > &key)
Removes the element with key key from the hash table (does nothing if no such element).
HashArray2D(const E &defaultValue, const H1 &hashFunc1=H1(), const H2 &hashFunc2=H2())
Creates a 2D-hash array and sets the default value to defaultValue.