142 int size()
const {
return m_size; }
153 return (adj != entries.
m_adjFirst) ? adj :
nullptr;
204#ifndef OGDF_MEMORY_POOL_NTS
239 bool valid()
const {
return m_cpGraph !=
nullptr; }
252 operator const Graph&()
const {
return getGraph(); }
364 return findCommonFace(v, w, adj, left);
444 operator const Graph&()
const {
return getGraph(); }
446 operator Graph&() {
return getGraph(); }
461 ConstCombinatorialEmbedding::init(G);
Declaration and implementation of AdjEntryArray class.
Class for adjacency list elements.
adjEntry twin() const
Returns the corresponding adjacency element associated with the same edge.
adjEntry faceCycleSucc() const
Returns the cyclic successor in face.
Dynamic arrays indexed with adjacency entries.
Combinatorial embeddings of planar graphs with modification functionality.
void updateMerger(edge e, face fRight, face fLeft)
Update face information after inserting a merger in a copy graph.
node splitNode(adjEntry adjStartLeft, adjEntry adjStartRight)
Splits a node while preserving the order of adjacency entries.
void removeDeg1(node v)
Removes degree-1 node v.
CombinatorialEmbedding()
Creates a combinatorial embedding associated with no graph.
void init(Graph &G)
Initializes the embedding for graph G.
Graph * m_pGraph
The associated graph.
node contract(edge e, bool keepSelfLoops=false)
Contracts edge e while preserving the order of adjacency entries.
face joinFaces(edge e)
Removes edge e and joins the two faces adjacent to e.
CombinatorialEmbedding(const CombinatorialEmbedding &)=delete
void moveBridge(adjEntry adjBridge, adjEntry adjBefore)
Moves a bridge in the graph.
void reverseEdge(edge e)
Reverses edges e and updates embedding.
CombinatorialEmbedding & operator=(const CombinatorialEmbedding &)=delete
CombinatorialEmbedding(Graph &G)
Creates a combinatorial embedding of graph G.
edge addEdgeToIsolatedNode(node v, adjEntry adjTgt)
Inserts a new edge similarly to splitFace without having to call computeFaces again.
edge addEdgeToIsolatedNode(adjEntry adjSrc, node v)
Inserts a new edge similarly to splitFace without having to call computeFaces again.
edge split(edge e)
Splits edge e=(v,w) into e=(v,u) and e'=(u,w) creating a new node u.
void clear()
Removes all nodes, edges, and faces from the graph and the embedding.
edge addEdgeToIsolatedNode(adjEntry adj, node v, bool adjSrc)
Inserts a new edge similarly to splitFace without having to call computeFaces again.
const Graph & getGraph() const
Returns the associated graph.
void unsplit(edge eIn, edge eOut)
Undoes a split operation.
edge splitFace(adjEntry adjSrc, adjEntry adjTgt, bool sourceAfter=false)
Splits a face by inserting a new edge.
Combinatorial embeddings of planar graphs.
const Graph * m_cpGraph
The associated graph.
adjEntry findCommonFace(const node v, const node w, adjEntry &adjW, bool left=true) const
Identifies a common face of two nodes and returns the respective adjacency entry.
face rightFace(adjEntry adj) const
Returns the face to the right of adj, i.e., the face containing adj.
bool isBridge(edge e) const
ConstCombinatorialEmbedding(const Graph &G)
Creates a combinatorial embedding of graph G.
face chooseFace(std::function< bool(face)> includeFace=[](face) { return true;}, bool isFastTest=true) const
Returns a random face.
face firstFace() const
Returns the first face in the list of all faces.
std::mutex m_mutexRegArrays
The critical section for protecting shared acces to register/unregister methods.
face maximalFace() const
Returns a face of maximal size.
bool valid() const
Returns whether the embedding is associated with a graph.
int faceArrayTableSize() const
Returns the table size of face arrays associated with this embedding.
face externalFace() const
Returns the external face.
void computeFaces()
Computes the list of faces.
face createFaceElement(adjEntry adjFirst)
Create a new face.
virtual ~ConstCombinatorialEmbedding()
Destructor.
void reinitArrays()
Reinitialize associated face arrays.
void moveRegisterArray(ListIterator< FaceArrayBase * > it, FaceArrayBase *pFaceArray) const
Move the registration it of a node array to pFaceArray (used with move semantics for face arrays).
void init(const Graph &G)
Initializes the embedding for graph G.
ListIterator< FaceArrayBase * > registerArray(FaceArrayBase *pFaceArray) const
Registers the face array pFaceArray.
face lastFace() const
Returns the last face in the list of all faces.
int maxFaceIndex() const
Returns the largest used face index.
void setExternalFace(face f)
Sets the external face to f.
const Graph & getGraph() const
Returns the associated graph of the combinatorial embedding.
ConstCombinatorialEmbedding()
Creates a combinatorial embedding associated with no graph.
face leftFace(adjEntry adj) const
Returns the face to the left of adj, i.e., the face containing the twin of adj.
void unregisterArray(ListIterator< FaceArrayBase * > it) const
Unregisters the face array identified by it.
ConstCombinatorialEmbedding(const ConstCombinatorialEmbedding &C)
Copy constructor.
adjEntry findCommonFace(const node v, const node w, bool left=true) const
Identifies a common face of two nodes and returns the respective adjacency entry.
AdjEntryArray< face > m_rightFace
The face to which an adjacency entry belongs.
int m_faceArrayTableSize
The current table size of face arrays.
int m_faceIdCount
The index assigned to the next created face.
int numberOfFaces() const
Returns the number of faces.
internal::GraphObjectContainer< FaceElement > faces
The container containing all face objects.
ListPure< FaceArrayBase * > m_regFaceArrays
The external face.
ConstCombinatorialEmbedding & operator=(const ConstCombinatorialEmbedding &C)
Assignment operator.
Class for the representation of edges.
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Abstract base class for face arrays.
Faces in a combinatorial embedding.
FaceElement(adjEntry adjFirst, int id)
Creates a face with given first adjacency element adjFirst and face index id.
face pred() const
Returns the predecessor in the list of all faces.
int size() const
Returns the size of the face, i.e., the number of edges in the face.
static int compare(const FaceElement &x, const FaceElement &y)
Standard Comparer.
int m_size
The size of the face.
adjEntry nextFaceEdge(adjEntry adj) const
Returns the successor of adj in the list of all adjacency elements in the face.
face succ() const
Returns the successor in the list of all faces.
internal::FaceAdjContainer entries
Container maintaining the adjacency entries in the face.
adjEntry firstAdj() const
Returns the first adjacency element in the face.
int index() const
Returns the index of the face.
int m_id
The index of the face.
Copies of graphs supporting edge splitting.
Data type for general directed graphs (adjacency list representation).
Encapsulates a pointer to a list element.
Class for the representation of nodes.
Container for the adjacency entries in a face.
FaceAdjContainer(adjEntry adjFirst)
Forward iterator for adjacency entries in a face.
bool operator!=(const FaceAdjIterator &other) const
FaceAdjIterator & operator=(const FaceAdjIterator &)=default
bool operator==(const FaceAdjIterator &other) const
FaceAdjIterator & operator++()
FaceAdjIterator(const FaceAdjIterator &)=default
FaceAdjIterator(adjEntry adj)
FaceAdjIterator(adjEntry adjFirst, adjEntry adj)
adjEntry operator*() const
The base class for objects used by (hyper)graphs.
Lists of graph objects (like nodes, edges, etc.).
T * head() const
Returns the first element in the list.
T * tail() const
Returns the last element in the list.
int size() const
Returns the size of the list.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
#define OGDF_AUGMENT_COMPARER(type)
Add this macro to your class to turn it into a full comparer.
#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.
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.