36#include <ogdf/basic/internal/config_autogen.h>
47class CombinatorialEmbedding;
48class ConstCombinatorialEmbedding;
81 m_head = m_tail =
nullptr;
89 int size()
const {
return m_size; }
92 bool empty()
const {
return m_size == 0; }
99 m_tail = m_tail->
m_next = pX;
101 m_tail = m_head = pX;
151 void sort(
const LIST& newOrder) {
154 sort(
begin(newOrder),
end(newOrder));
165 for (
auto it =
begin; it !=
end; ++it) {
167 if ((p->
m_prev = pPred) !=
nullptr) {
172 (m_tail = pPred)->m_next =
nullptr;
195 }
else if (pY->
m_next == pX) {
237 A[0] =
A[m_size + 1] =
nullptr;
241 for (pX = m_head; pX; pX = pX->
m_next) {
245 A.permute(1, m_size, rng);
247 for (i = 1; i <= m_size; i++) {
270 OGDF_ASSERT((m_head ==
nullptr) == (m_tail ==
nullptr));
272 if (m_head !=
nullptr) {
316 OGDF_ALLOCATOR::deallocateList(
sizeof(T),
m_head,
m_tail);
378 OGDF_ALLOCATOR::deallocateList(
sizeof(T),
m_head,
m_tail);
409template<
class GraphObject>
Declaration and implementation of Array class and Array algorithms.
Basic declarations, included by all source files.
The parameterized class Array implements dynamic arrays of type E.
Representation of clustered graphs.
Combinatorial embeddings of planar graphs with modification functionality.
Combinatorial embeddings of planar graphs.
Data type for general directed graphs (adjacency list representation).
The base class for objects used by (hyper)graphs.
GraphElement * m_next
The successor in the list.
GraphElement * m_prev
The predecessor in the list.
Base class for GraphElement lists.
void sort(IT begin, IT end)
Sorts the list according to the range defined by two iterators.
void pushBack(GraphElement *pX)
Adds element pX at the end of the list.
int m_size
The size of the list.
bool empty() const
Returns true iff the list is empty.
void insertAfter(GraphElement *pX, GraphElement *pY)
Inserts element pX after element pY.
GraphListBase()
Constructs an empty list.
void insertBefore(GraphElement *pX, GraphElement *pY)
Inserts element pX before element pY.
~GraphListBase()
Destruction.
void sort(const LIST &newOrder)
Sorts the list according to newOrder.
void consistencyCheck() const
Asserts consistency of this list.
GraphElement * m_head
Pointer to the first element in the list.
int size() const
Returns the size of the list.
void reverse()
Reverses the order of the list elements.
void del(GraphElement *pX)
Removes element pX from the list.
void permute()
Permutes all list elements.
GraphElement * m_tail
Pointer to the last element in the list.
void permute(RNG &rng)
Permutes all list elements.
void swap(GraphElement *pX, GraphElement *pY)
Exchanges the positions of pX and pY in the list.
Lists of graph objects (like nodes, edges, etc.).
T * head() const
Returns the first element in the list.
void move(T *pX, GraphList< T > &L, T *pY, Direction dir)
Moves element pX to list L and inserts it before or after pY.
~GraphList()
Destruction: deletes all elements.
void delPure(T *pX)
Only removes element pX from the list; does not delete it.
T * tail() const
Returns the last element in the list.
reverse_iterator rend() const
Returns a reverse iterator to the one-before-first element in the container.
void del(T *pX)
Removes element pX from the list and deletes it.
bool empty() const
Returns true iff the list is empty.
void clear()
Removes all elements from the list and deletes them.
iterator begin() const
Returns an iterator to the first element in the container.
void insertBefore(T *pX, T *pY)
Inserts element pX before element pY.
void move(T *pX, GraphList< T > &L)
Moves element pX to list L and inserts it at the end.
reverse_iterator rbegin() const
Returns a reverse iterator to the last element in the container.
void pushBack(T *pX)
Adds element pX at the end of the list.
void insertAfter(T *pX, T *pY)
Inserts element pX after element pY.
void moveBefore(T *pX, T *pY)
Moves element pX from its current position to a position before pY.
GraphReverseIterator< T * > reverse_iterator
Provides a bidirectional reverse iterator to an object in the container.
GraphList()
Constructs an empty list.
T * value_type
The value type (a pointer to a specific graph object)
iterator end() const
Returns an iterator to the one-past-last element in the container.
int size() const
Returns the size of the list.
void moveAfter(T *pX, T *pY)
Moves element pX from its current position to a position after pY.
void swap(T *pX, T *pY)
Exchanges the positions of pX and pY in the list.
GraphIterator< T * > iterator
Provides a bidirectional iterator to an object in the container.
Public read-only interface for lists of graph objects.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Decralation of graph iterators.
#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.
long unsigned int randomSeed()
Returns a random value suitable as initial seed for a random number engine.
Declaration of memory manager for allocating small pieces of memory.
The namespace for all OGDF objects.
HypergraphRegistry< HypernodeElement >::iterator begin(const HypergraphRegistry< HypernodeElement > &self)
HypergraphRegistry< HypernodeElement >::iterator end(const HypergraphRegistry< HypernodeElement > &self)