Indexed 2-dimensional arrays using hashing for element access. More...
#include <ogdf/basic/HashArray2D.h>
Inheritance diagram for ogdf::HashArray2D< I1, I2, E, H1, H2 >:Public Types | |
| typedef HashConstIterator2D < I1, I2, E, H1, H2 > | const_iterator |
| The type of const-iterators for 2D-hash arrays. | |
Public Member Functions | |
| HashArray2D () | |
| Creates a 2D-hash array. | |
| HashArray2D (const E &defaultValue, const H1 &hashFunc1=H1(), const H2 &hashFunc2=H2()) | |
| Creates a 2D-hash array and sets the default value to x. | |
| HashArray2D (const HashArray2D< I1, I2, E, H1, H2 > &A) | |
| Copy constructor. | |
| ~HashArray2D () | |
| HashConstIterator2D< I1, I2, E, H1, H2 > | begin () const |
| Returns an iterator pointing to the first element. | |
| void | clear () |
| Undefines all indices. | |
| int | empty () const |
| Returns if any indices are defined. | |
| bool | isDefined (const I1 &i, const I2 &j) const |
| Returns true iff entry (i,j) is defined. | |
| const E & | operator() (const I1 &i, const I2 &j) const |
| Returns a const reference to entry (i,j). | |
| E & | operator() (const I1 &i, const I2 &j) |
| Returns a reference to entry (i,j). | |
| HashArray2D & | operator= (const HashArray2D< I1, I2, E, H1, H2 > &A) |
| Assignment operator. | |
| int | size () const |
| Returns the number of defined elements in the table. | |
| void | undefine (const I1 &i, const I2 &j) |
| Undefines the entry at index (i,j). | |
Private Attributes | |
| E | m_defaultValue |
| The default value of the array. | |
Additional Inherited Members | |
Private Types inherited from ogdf::Hashing< Tuple2< I1, I2 >, E, HashFuncTuple< I1, I2, H1, H2 > > | |
Private Member Functions inherited from ogdf::Hashing< Tuple2< I1, I2 >, E, HashFuncTuple< I1, I2, H1, H2 > > | |
| Hashing (int minTableSize=256, const HashFuncTuple< I1, I2, H1, H2 > &hashFunc=HashFuncTuple< I1, I2, H1, H2 >()) | |
| Creates a hash table for given initial table size minTableSize. | |
| Hashing (const Hashing< Tuple2< I1, I2 >, E > &h) | |
| Copy constructor. | |
| ~Hashing () | |
| 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 > * | fastInsert (const Tuple2< I1, I2 > &key, const E &info) |
| Inserts a new element with key key and information info into the hash table. | |
| HashElement< Tuple2< I1, I2 > , E > * | insert (const Tuple2< I1, I2 > &key, const E &info) |
| Inserts a new element with key key and information info into the hash table. | |
| HashElement< Tuple2< I1, I2 > , E > * | insertByNeed (const Tuple2< I1, I2 > &key, const E &info) |
| Inserts a new element with key key and information info into the hash table. | |
| HashElement< Tuple2< I1, I2 > , E > * | lookup (const Tuple2< I1, I2 > &key) const |
| Returns the hash element with key key in the hash table; returns 0 if no such element. | |
| bool | member (const Tuple2< I1, I2 > &key) const |
| Returns true iff the hash table contains an element with key key. | |
| Hashing< Tuple2< I1, I2 >, E > & | operator= (const Hashing< Tuple2< I1, I2 >, E > &hashing) |
| Assignment operator. | |
| HashElement< Tuple2< I1, I2 > , E > * | firstElement (HashElement< Tuple2< I1, I2 >, E > ***pList) const |
| Returns the first element in the list of all elements in the hash table. | |
| HashElement< Tuple2< I1, I2 > , E > * | nextElement (HashElement< Tuple2< I1, I2 >, E > ***pList, HashElement< Tuple2< I1, I2 >, E > *pElement) const |
| Returns the successor of pElement in the list of all elements in the hash table. | |
Indexed 2-dimensional arrays using hashing for element access.
| I1 | is the first index type. |
| I2 | is the second index type. |
| E | is the element type. |
| H1 | is the hash function type for I1. Optional; uses the class DefHashFunc by default. |
| H2 | is the hash function type for I2. Optional; uses the class DefHashFunc by default. |
A 2D-hash array can be used like a usual 2-dimensional array but with a general index type.
Definition at line 80 of file HashArray2D.h.
| typedef HashConstIterator2D<I1,I2,E,H1,H2> ogdf::HashArray2D< I1, I2, E, H1, H2 >::const_iterator |
The type of const-iterators for 2D-hash arrays.
Reimplemented from ogdf::Hashing< Tuple2< I1, I2 >, E, HashFuncTuple< I1, I2, H1, H2 > >.
Definition at line 84 of file HashArray2D.h.
|
inline |
Creates a 2D-hash array.
Definition at line 87 of file HashArray2D.h.
|
inline |
Creates a 2D-hash array and sets the default value to x.
Definition at line 90 of file HashArray2D.h.
|
inline |
Copy constructor.
Definition at line 97 of file HashArray2D.h.
|
inline |
Definition at line 109 of file HashArray2D.h.
|
inline |
Returns an iterator pointing to the first element.
Reimplemented from ogdf::Hashing< Tuple2< I1, I2 >, E, HashFuncTuple< I1, I2, H1, H2 > >.
Definition at line 139 of file HashArray2D.h.
|
inline |
Undefines all indices.
Reimplemented from ogdf::Hashing< Tuple2< I1, I2 >, E, HashFuncTuple< I1, I2, H1, H2 > >.
Definition at line 156 of file HashArray2D.h.
|
inline |
Returns if any indices are defined.
Reimplemented from ogdf::Hashing< Tuple2< I1, I2 >, E, HashFuncTuple< I1, I2, H1, H2 > >.
Definition at line 150 of file HashArray2D.h.
|
inline |
Returns true iff entry (i,j) is defined.
Definition at line 129 of file HashArray2D.h.
|
inline |
Returns a const reference to entry (i,j).
Definition at line 112 of file HashArray2D.h.
|
inline |
Returns a reference to entry (i,j).
Definition at line 119 of file HashArray2D.h.
|
inline |
Assignment operator.
Definition at line 102 of file HashArray2D.h.
|
inline |
Returns the number of defined elements in the table.
Reimplemented from ogdf::Hashing< Tuple2< I1, I2 >, E, HashFuncTuple< I1, I2, H1, H2 > >.
Definition at line 145 of file HashArray2D.h.
|
inline |
Undefines the entry at index (i,j).
Definition at line 134 of file HashArray2D.h.
|
private |
The default value of the array.
Definition at line 161 of file HashArray2D.h.