79 virtual void reinit(
int initTableSize) = 0;
86 if ((m_pGraph = pG) !=
nullptr) m_it = pG->
registerArray(
this);
96 if (m_pGraph !=
nullptr)
222 OGDF_DEPRECATED(
"Edge arrays should be indexed by an edge, not an integer index.")
223 const T &operator[](
int index)
const 228 OGDF_DEPRECATED(
"Edge arrays should be indexed by an edge, not an integer index.")
229 T &operator[](
int index)
T & operator()(adjEntry adj)
Returns a reference to the element with index edge of adj.
iterator begin()
Returns an iterator to the first entry in the edge array.
virtual void enlargeTable(int newTableSize)=0
Virtual function called when table size has to be enlarged.
EdgeElement * edge
The type of edges.
const T & operator()(edge e) const
Returns a reference to the element with index e.
The parameterized class Array implements dynamic arrays of type E.
iterator rend()
Returns an iterator to one-before-first entry in the edge array.
const Graph * graphOf() const
Returns a pointer to the associated graph.
void init()
Reinitializes the array. Associates the array with no graph.
Data type for general directed graphs (adjacency list representation).
const_iterator cend() const
Returns a const iterator to one-past-last entry in the edge array.
void init(const Graph &G, const T &x)
Reinitializes the array. Associates the array with G.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
void init()
Reinitializes the array to an array with empty index set.
EdgeArray(const Graph &G)
Constructs an edge array associated with G.
EdgeArray(const Graph &G, const T &x)
Constructs an edge array associated with G.
EdgeArrayBase()
Initializes an edge array not associated with a graph.
INDEX high() const
Returns the maximal array index.
BucketEdgeArray(const EdgeArray< int > &edgeArray)
Constructs a bucket function.
const_iterator begin() const
Returns a const iterator to the first entry in the edge array.
const Graph * m_pGraph
The associated graph.
int index() const
Returns the index of the edge.
iterator end()
Returns an iterator to one-past-last entry in the edge array.
Dynamic arrays indexed with edges.
E * iterator
Provides a random-access iterator that can read or modify any element in an array.
const E * const_iterator
Provides a random-access iterator that can read a const element in an array.
bool valid() const
Returns true iff the array is associated with a graph.
const_iterator rend() const
Returns a const iterator to one-before-first entry in the edge array.
void fill(const T &x)
Sets all array elements to x.
edge lastEdge() const
Returns the last edge in the list of all edges.
const_iterator end() const
Returns a const iterator to one-past-last entry in the edge array.
void reregister(const Graph *pG)
Associates the array with a new graph.
Bucket function for edges.
T & operator[](adjEntry adj)
Returns a reference to the element with index edge of adj.
ListIterator< NodeArrayBase * > registerArray(NodeArrayBase *pNodeArray) const
Registers a node array.
EdgeArray()
Constructs an empty edge array associated with no graph.
void unregisterArray(ListIterator< NodeArrayBase *> it) const
Unregisters a node array.
EdgeArray(const EdgeArray< T > &A)
Constructs an edge array that is a copy of A.
EdgeArrayBase(const Graph *pG)
Initializes an edge array associated with pG.
E value_type
Represents the data type stored in an array element.
int edgeArrayTableSize() const
Returns the table size of edge arrays associated with this graph.
EdgeArray< T > & operator=(const EdgeArray< T > &a)
Assignment operator.
edge firstEdge() const
Returns the first edge in the list of all edges.
ListIterator< EdgeArrayBase * > m_it
Pointer to list element in the list of all registered edge arrays which references this array...
EdgeArrayBase(EdgeArrayBase &base)
Moves edge array base to this edge array.
void init(const Graph &G)
Reinitializes the array. Associates the array with G.
Class for the representation of edges.
EdgeArray< T > & operator=(EdgeArray< T > &&a)
Assignment operator (move semantics).
Encapsulates a pointer to a list element.
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
const T & operator[](adjEntry adj) const
Returns a reference to the element with index edge of adj.
virtual void enlargeTable(int newTableSize)
Virtual function called when table size has to be enlarged.
const T & move(const T &v)
const T & operator[](edge e) const
Returns a reference to the element with index e.
void moveRegister(EdgeArrayBase &base)
Moves array registration from base to this array.
const EdgeArray< int > * m_pEdgeArray
Pointer to edge array.
Pure declaration header, find template implementation in Graph.h.
Abstract base class for bucket functions.
edge pred() const
Returns the predecessor in the list of all edges.
int getBucket(const edge &e) override
Returns bucket of edge e.
virtual void disconnect()=0
Virtual function called when array is disconnected from the graph.
void resize(INDEX newSize, const E &x)
Resizes (enlarges or shrinks) the array to hold newSize elements and sets new elements to x...
static key_type findSuccKey(key_type key)
edge succ() const
Returns the successor in the list of all edges.
iterator rbegin()
Returns an iterator to the last entry in the edge array.
const_iterator rbegin() const
Returns a const iterator to the last entry in the edge array.
const_iterator cbegin() const
Returns a const iterator to the first entry in the edge array.
void moveRegisterArray(ListIterator< NodeArrayBase *> it, NodeArrayBase *pNodeArray) const
Move the registration it of a node array to pNodeArray (used with move semantics for node arrays)...
virtual void reinit(int initTableSize)
Virtual function called when table has to be reinitialized.
#define OGDF_DEPRECATED(reason)
Mark a class / member / function as deprecated.
const_iterator crbegin() const
Returns a const iterator to the last entry in the edge array.
Array< E, INDEX > & operator=(const Array< E, INDEX > &A)
Assignment operator.
const_reference operator[](INDEX i) const
Returns a reference to the element at position i.
Abstract base class for edge arrays.
void fill(const E &x)
Sets all elements to x.
The namespace for all OGDF objects.
const_iterator crend() const
Returns a const iterator to one-before-first entry in the edge array.
int maxEdgeIndex() const
Returns the largest used edge index.
T m_x
The default value for array elements.
T & operator()(edge e)
Returns a reference to the element with index e.
int index() const
Returns the index of this adjacency element.
EdgeArray(EdgeArray< T > &&A)
Constructs an edge array containing the elements of A (move semantics).
INDEX low() const
Returns the minimal array index.
T & operator[](edge e)
Returns a reference to the element with index e.
Class for adjacency list elements.
const T & operator()(adjEntry adj) const
Returns a reference to the element with index edge of adj.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
virtual void reinit(int initTableSize)=0
Virtual function called when table has to be reinitialized.
virtual void disconnect()
Virtual function called when array is disconnected from the graph.
static key_type findPredKey(key_type key)