79 virtual void reinit(
int initTableSize) = 0;
83 virtual void resetIndex(
int newIndex,
int oldIndex) = 0;
88 if ((m_pGraph = pG) !=
nullptr) m_it = pG->
registerArray(
this);
98 if (m_pGraph !=
nullptr)
211 return iterator(findFirstKey(),
this);
306 if(adj->
succ() !=
nullptr)
311 return (v !=
nullptr) ? v->
firstAdj() :
nullptr;
316 if(adj->
pred() !=
nullptr)
319 for(v = v->
pred(); v !=
nullptr && v->
lastAdj() ==
nullptr; v = v->
pred())
321 return (v !=
nullptr) ? v->
lastAdj() :
nullptr;
330 while(v !=
nullptr && v->
firstAdj() ==
nullptr)
339 while(v !=
nullptr && v->
lastAdj() ==
nullptr)
iterator end()
Returns an iterator to one-past-last entry in the array.
const_iterator end() const
Returns a const iterator to one-past-last entry in the array.
const Graph * m_pGraph
The associated graph.
virtual void resetIndex(int newIndex, int oldIndex)=0
Virtual function called when the index of an adjacency entry is changed.
void reregister(const Graph *pG)
Associates the array with a new graph.
adjEntry pred() const
Returns the predecessor in the adjacency list.
The parameterized class Array implements dynamic arrays of type E.
node pred() const
Returns the predecessor in the list of all nodes.
const Graph * graphOf() const
Returns a pointer to the associated graph.
void init(const Graph &G, const T &x)
Reinitializes the array. Associates the array with G.
Data type for general directed graphs (adjacency list representation).
iterator begin()
Returns an iterator to the first entry in the array.
virtual void enlargeTable(int newTableSize)=0
Virtual function called when table size has to be enlarged.
void init()
Reinitializes the array to an array with empty index set.
static adjEntry findSuccKey(adjEntry adj)
Returns the key succeeding adj.
INDEX high() const
Returns the maximal array index.
virtual ~AdjEntryArrayBase()
Destructor, unregisters the array.
int maxAdjEntryIndex() const
Returns the largest used adjEntry index.
ListIterator< AdjEntryArrayBase * > m_it
Pointer to list element in the list of all registered adjacency entry arrays which references this ar...
AdjEntryArrayBase()
Initializes an adjacency entry array not associated with a graph.
node firstNode() const
Returns the first node in the list of all nodes.
const_iterator begin() const
Returns a const iterator to the first entry in the array.
Dynamic arrays indexed with adjacency entries.
AdjEntryArray(const Graph &G, const T &x)
Constructs an adjacency entry array associated with G.
void fill(const T &x)
Sets all array elements to x.
node succ() const
Returns the successor in the list of all nodes.
void init(const Graph &G)
Reinitializes the array. Associates the array with G.
AdjEntryArray(const AdjEntryArray< T > &A)
Constructs an adjacency entry array that is a copy of A.
AdjEntryArray< T > & operator=(AdjEntryArray< T > &&a)
Assignment operator (move semantics).
ListIterator< NodeArrayBase * > registerArray(NodeArrayBase *pNodeArray) const
Registers a node array.
void moveRegisterArray(ListIterator< ArrayBase *> it, ArrayBase *pArray) const
Move the registration it of an graph element array to pArray (used with move semantics for graph elem...
void unregisterArray(ListIterator< NodeArrayBase *> it) const
Unregisters a node array.
virtual void reinit(int initTableSize)=0
Virtual function called when table has to be reinitialized.
int adjEntryArrayTableSize() const
Returns the table size of adjEntry arrays associated with this graph.
virtual void reinit(int initTableSize)
Virtual function called when table has to be reinitialized.
virtual void disconnect()
Virtual function called when array is disconnected from the graph.
bool valid() const
Returns true iff the array is associated with a graph.
Abstract base class for adjacency entry arrays.
adjEntry findLastKey() const
Returns the last key (adjacency entry in the graph).
AdjElement * adjEntry
The type of adjacency entries.
void grow(INDEX add, const E &x)
Enlarges the array by add elements and sets new elements to x.
AdjEntryArray(AdjEntryArray< T > &&A)
Constructs an adjacency entry array containing the elements of A (move semantics).
const T & operator[](adjEntry adj) const
Returns a reference to the element with index adj.
AdjEntryArray()
Constructs an empty adjacency entry array associated with no graph.
AdjEntryArrayBase(AdjEntryArrayBase &base)
Moves adjacency entry array base to this adjacency entry array.
const T & operator()(adjEntry adj) const
Returns a reference to the element with index adj.
const_iterator cend() const
Returns a const iterator to one-past-last entry in the array.
adjEntry lastAdj() const
Returns the last entry in the adjacency list.
Class for the representation of nodes.
Encapsulates a pointer to a list element.
node lastNode() const
Returns the last node in the list of all nodes.
#define OGDF_NEW_DELETE
Makes the class use OGDF's memory allocator.
AdjEntryArray< T > & operator=(const AdjEntryArray< T > &A)
Assignment operator.
const T & move(const T &v)
virtual void resetIndex(int newIndex, int oldIndex)
Virtual function called when the index of an adjacency entry is changed.
virtual void enlargeTable(int newTableSize)
Virtual function called when table size has to be enlarged.
virtual void disconnect()=0
Virtual function called when array is disconnected from the graph.
Includes declaration of graph class.
void moveRegister(AdjEntryArrayBase &base)
Moves array registration from base to this array.
T & operator()(adjEntry adj)
Returns a reference to the element with index adj.
adjEntry succ() const
Returns the successor in the adjacency list.
T & operator[](adjEntry adj)
Returns a reference to the element with index adj.
void init()
Reinitializes the array. Associates the array with no graph.
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.
void fill(const E &x)
Sets all elements to x.
The namespace for all OGDF objects.
T m_x
The default value for array elements.
adjEntry findFirstKey() const
Returns the first key (adjacency entry in the graph).
const_iterator cbegin() const
Returns a const iterator to the first entry in the array.
AdjEntryArrayBase(const Graph *pG)
Initializes an adjacency entry array associated with pG.
int index() const
Returns the index of this adjacency element.
static adjEntry findPredKey(adjEntry adj)
Returns the key preceeding adj.
adjEntry firstAdj() const
Returns the first entry in the adjaceny list.
INDEX low() const
Returns the minimal array index.
AdjEntryArray(const Graph &G)
Constructs an adjacency entry array associated with G.
node theNode() const
Returns the node whose adjacency list contains this element.
Class for adjacency list elements.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.