Open
Graph Drawing
Framework

 v.2012.07
 

ogdf::HyperGraph Class Reference

#include <ogdf/basic/HyperGraph.h>

List of all members.

Classes

class  AdjArray
 Dynamic arrays indexed with adjacency entries. More...
class  AdjElement
 Representation of adjacency elements. More...
class  ArrayController
 Array controllers manage the graph arrays of an element. More...
class  ArrayControllerTypes
class  EdgeArray
 Dynamic arrays indexed with hyper edges. More...
class  EdgeElement
 Representation of hyper edges. More...
class  GraphArray
class  GraphArrayBase
class  NodeArray
 Dynamic arrays indexed with nodes. More...
class  NodeElement
 Representation of node elements. More...

Public Types

typedef EdgeElementedge
typedef NodeElementnode

Public Member Functions

 HyperGraph ()
 Creates an empty hyper graph.
AdjElementaddNode (NodeElement *pNode, EdgeElement *pEdge, bool checkIfAlreadyExists=false)
 Makes pNode and pEdge incident; returns the corresponding AdjElement.
void clear ()
 Clears the graph.
void delAdjElement (AdjElement *pAdj)
 Removes one endpoint pAdj from a hyper edge.
void delAdjElement (NodeElement *pNode, EdgeElement *pEdge)
 Removes the endpoint pNode from the hyper edge pEdge.
void delEdge (EdgeElement *pEdge)
 Deletes hyper edge pEdge.
void delNode (NodeElement *pNode)
 Deletes node pNode.
AdjElementfindAdjElement (NodeElement *pNode, EdgeElement *pEdge) const
 Returns the AdjElement for pNode and pEdge.
AdjElementnewAdjElement (NodeElement *pNode, EdgeElement *pEdge)
 Creates a new AdjElement which makes pNode and pEdge incident.
EdgeElementnewEdge ()
 Creates a new edge which is not incident to any nodes.
EdgeElementnewEdge (NodeElement *pNode1, NodeElement *pNode2)
 Creates a new edge which is incident to the two nodes pNode1, pNode2.
NodeElementnewNode ()
 Creates a new node.
int numberOfEdges () const
int numberOfNodes () const
void removeNode (NodeElement *pNode, EdgeElement *pEdge, bool removeDuplicates=false)
 If pNode and pEdge are incident, the corresponding AdjElement is removed.

Protected Member Functions

AdjElementallocateAdjElement ()
 Allocates a new AdjElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.
EdgeElementallocateEdgeElement ()
 Allocates a new EdgeElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.
NodeElementallocateNodeElement ()
 Allocates a new NodeElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.
void freeAdjElement (AdjElement *pAdj)
 Frees a used AdjElement.
void freeEdgeElement (EdgeElement *pEdge)
 Frees a used EdgeElement.
void freeNodeElement (NodeElement *pNode)
 Frees a used NodeElement.
void registerArray (GraphArrayBase< NodeElement > *pArray)
void registerArray (GraphArrayBase< EdgeElement > *pArray)
void registerArray (GraphArrayBase< AdjElement > *pArray)
void unregisterArray (GraphArrayBase< NodeElement > *pArray)
void unregisterArray (GraphArrayBase< EdgeElement > *pArray)
void unregisterArray (GraphArrayBase< AdjElement > *pArray)

Protected Attributes

EFreeListIndexPool< AdjElement,&AdjElement::m_pNext_nodeAdj,&AdjElement::m_indexm_adjAllocator
ArrayController< AdjElementm_adjArrayController
 controller for adj arrays
EFreeListIndexPool
< EdgeElement,&EdgeElement::m_pNext,&EdgeElement::m_index
m_edgeAllocator
ArrayController< EdgeElementm_edgeArrayController
 controller for edge arrays
EFreeListIndexPool
< NodeElement,&NodeElement::m_pNext,&NodeElement::m_index
m_nodeAllocator
ArrayController< NodeElementm_nodeArrayController
 controller for node arrays
int m_numEdges
int m_numNodes
EdgeElementm_pFirstEdge
NodeElementm_pFirstNode
EdgeElementm_pLastEdge
NodeElementm_pLastNode

Friends

class HyperGraphTypes

Detailed Description

Definition at line 57 of file HyperGraph.h.


Member Typedef Documentation

Definition at line 148 of file HyperGraph.h.

Definition at line 147 of file HyperGraph.h.


Constructor & Destructor Documentation

ogdf::HyperGraph::HyperGraph ( )
inline

Creates an empty hyper graph.

Definition at line 666 of file HyperGraph.h.


Member Function Documentation

AdjElement* ogdf::HyperGraph::addNode ( NodeElement pNode,
EdgeElement pEdge,
bool  checkIfAlreadyExists = false 
)
inline

Makes pNode and pEdge incident; returns the corresponding AdjElement.

Definition at line 448 of file HyperGraph.h.

AdjElement* ogdf::HyperGraph::allocateAdjElement ( )
inlineprotected

Allocates a new AdjElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.

Definition at line 354 of file HyperGraph.h.

EdgeElement* ogdf::HyperGraph::allocateEdgeElement ( )
inlineprotected

Allocates a new EdgeElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.

Definition at line 346 of file HyperGraph.h.

NodeElement* ogdf::HyperGraph::allocateNodeElement ( )
inlineprotected

Allocates a new NodeElement using the EFreeListIndexPool and lets the controller check if arrays have to be resized.

Definition at line 338 of file HyperGraph.h.

void ogdf::HyperGraph::clear ( )
inline

Clears the graph.

Definition at line 765 of file HyperGraph.h.

void ogdf::HyperGraph::delAdjElement ( HyperGraph::AdjElement pAdj)
inline

Removes one endpoint pAdj from a hyper edge.

Definition at line 703 of file HyperGraph.h.

void ogdf::HyperGraph::delAdjElement ( NodeElement pNode,
EdgeElement pEdge 
)
inline

Removes the endpoint pNode from the hyper edge pEdge.

Definition at line 441 of file HyperGraph.h.

void ogdf::HyperGraph::delEdge ( HyperGraph::EdgeElement pEdge)
inline

Deletes hyper edge pEdge.

Definition at line 732 of file HyperGraph.h.

void ogdf::HyperGraph::delNode ( HyperGraph::NodeElement pNode)

Deletes node pNode.

Definition at line 746 of file HyperGraph.h.

HyperGraph::AdjElement * ogdf::HyperGraph::findAdjElement ( HyperGraph::NodeElement pNode,
HyperGraph::EdgeElement pEdge 
) const
inline

Returns the AdjElement for pNode and pEdge.

In case pNode and pEdge are not incident the function returns 0.

Note:
The function requires time O(min(degree(pNode), cardinality(pEdge))).
Parameters:
pNodeis the node.
pEdgeis the hyper edge.

Definition at line 711 of file HyperGraph.h.

void ogdf::HyperGraph::freeAdjElement ( AdjElement pAdj)
inlineprotected

Frees a used AdjElement.

Definition at line 374 of file HyperGraph.h.

void ogdf::HyperGraph::freeEdgeElement ( EdgeElement pEdge)
inlineprotected

Frees a used EdgeElement.

Definition at line 368 of file HyperGraph.h.

void ogdf::HyperGraph::freeNodeElement ( NodeElement pNode)
inlineprotected

Frees a used NodeElement.

Definition at line 362 of file HyperGraph.h.

HyperGraph::AdjElement * ogdf::HyperGraph::newAdjElement ( HyperGraph::NodeElement pNode,
HyperGraph::EdgeElement pEdge 
)
inline

Creates a new AdjElement which makes pNode and pEdge incident.

Note:
This function does not check if pNode and pEdge are already incident. Hypergraphs can deal with duplicate AdjElements. However, for reasons of clarity it is not a good idea to make use of it.
Parameters:
pNodeis the node.
pEdgeis the hyper edge.

Definition at line 691 of file HyperGraph.h.

HyperGraph::EdgeElement * ogdf::HyperGraph::newEdge ( )
inline

Creates a new edge which is not incident to any nodes.

Definition at line 682 of file HyperGraph.h.

EdgeElement* ogdf::HyperGraph::newEdge ( NodeElement pNode1,
NodeElement pNode2 
)
inline

Creates a new edge which is incident to the two nodes pNode1, pNode2.

Definition at line 419 of file HyperGraph.h.

HyperGraph::NodeElement * ogdf::HyperGraph::newNode ( )
inline

Creates a new node.

Definition at line 673 of file HyperGraph.h.

int ogdf::HyperGraph::numberOfEdges ( ) const
inline

Definition at line 762 of file HyperGraph.h.

int ogdf::HyperGraph::numberOfNodes ( ) const
inline

Definition at line 760 of file HyperGraph.h.

void ogdf::HyperGraph::registerArray ( GraphArrayBase< NodeElement > *  pArray)
inlineprotected

Definition at line 328 of file HyperGraph.h.

void ogdf::HyperGraph::registerArray ( GraphArrayBase< EdgeElement > *  pArray)
inlineprotected

Definition at line 329 of file HyperGraph.h.

void ogdf::HyperGraph::registerArray ( GraphArrayBase< AdjElement > *  pArray)
inlineprotected

Definition at line 330 of file HyperGraph.h.

void ogdf::HyperGraph::removeNode ( NodeElement pNode,
EdgeElement pEdge,
bool  removeDuplicates = false 
)
inline

If pNode and pEdge are incident, the corresponding AdjElement is removed.

Note:
The function requires time O(min(degree(pNode), cardinality(pEdge))).
Parameters:
pNodeis the node.
pEdgeis the hyper edge.
removeDuplicatesis a flag, if it is set the function will remove any existing duplicates too.

Definition at line 466 of file HyperGraph.h.

void ogdf::HyperGraph::unregisterArray ( GraphArrayBase< NodeElement > *  pArray)
inlineprotected

Definition at line 333 of file HyperGraph.h.

void ogdf::HyperGraph::unregisterArray ( GraphArrayBase< EdgeElement > *  pArray)
inlineprotected

Definition at line 334 of file HyperGraph.h.

void ogdf::HyperGraph::unregisterArray ( GraphArrayBase< AdjElement > *  pArray)
inlineprotected

Definition at line 335 of file HyperGraph.h.


Friends And Related Function Documentation

friend class HyperGraphTypes
friend

Definition at line 59 of file HyperGraph.h.


Member Data Documentation

EFreeListIndexPool< AdjElement, &AdjElement::m_pNext_nodeAdj, &AdjElement::m_index > ogdf::HyperGraph::m_adjAllocator
protected

Definition at line 176 of file HyperGraph.h.

ArrayController<AdjElement> ogdf::HyperGraph::m_adjArrayController
protected

controller for adj arrays

Definition at line 326 of file HyperGraph.h.

EFreeListIndexPool< EdgeElement, &EdgeElement::m_pNext, &EdgeElement::m_index > ogdf::HyperGraph::m_edgeAllocator
protected

Definition at line 170 of file HyperGraph.h.

ArrayController<EdgeElement> ogdf::HyperGraph::m_edgeArrayController
protected

controller for edge arrays

Definition at line 325 of file HyperGraph.h.

EFreeListIndexPool< NodeElement, &NodeElement::m_pNext, &NodeElement::m_index > ogdf::HyperGraph::m_nodeAllocator
protected

Definition at line 164 of file HyperGraph.h.

ArrayController<NodeElement> ogdf::HyperGraph::m_nodeArrayController
protected

controller for node arrays

Definition at line 324 of file HyperGraph.h.

int ogdf::HyperGraph::m_numEdges
protected

Definition at line 157 of file HyperGraph.h.

int ogdf::HyperGraph::m_numNodes
protected

Definition at line 153 of file HyperGraph.h.

EdgeElement* ogdf::HyperGraph::m_pFirstEdge
protected

Definition at line 155 of file HyperGraph.h.

NodeElement* ogdf::HyperGraph::m_pFirstNode
protected

Definition at line 151 of file HyperGraph.h.

EdgeElement* ogdf::HyperGraph::m_pLastEdge
protected

Definition at line 156 of file HyperGraph.h.

NodeElement* ogdf::HyperGraph::m_pLastNode
protected

Definition at line 152 of file HyperGraph.h.


The documentation for this class was generated from the following file: