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