45template<
class T,
class X,
class Y>
47template<
class T,
class X,
class Y>
49template<
class T,
class X,
class Y>
51template<
class T,
class X,
class Y>
54template<
class T,
class X,
class Y>
62 friend class PQTree<T, X, Y>;
513template<
class T,
class X,
class Y>
515 if (m_leftEndmost ==
oldEnd) {
518 }
else if (m_rightEndmost ==
oldEnd) {
537template<
class T,
class X,
class Y>
539 if (m_sibLeft ==
oldSib) {
542 }
else if (m_sibRight ==
oldSib) {
554template<
class T,
class X,
class Y>
556 m_identificationNumber =
count;
558 m_pertChildCount = 0;
560 m_debugTreeNumber = 0;
561 m_parentType = PQNodeType::Undefined;
564 m_firstFull =
nullptr;
566 m_sibRight =
nullptr;
567 m_referenceChild =
nullptr;
568 m_referenceParent =
nullptr;
569 m_leftEndmost =
nullptr;
570 m_rightEndmost =
nullptr;
583template<
class T,
class X,
class Y>
585 m_identificationNumber =
count;
587 m_pertChildCount = 0;
589 m_debugTreeNumber = 0;
590 m_parentType = PQNodeType::Undefined;
593 m_firstFull =
nullptr;
595 m_sibRight =
nullptr;
596 m_referenceChild =
nullptr;
597 m_referenceParent =
nullptr;
598 m_leftEndmost =
nullptr;
599 m_rightEndmost =
nullptr;
604 m_pointerToInfo =
nullptr;
Declaration of doubly linked lists and iterators.
Declaration and implementation of the class PQNodeRoot.
Doubly linked lists (maintaining the length of the list).
The class template PQInternalKey is a derived class of class template PQBasicKey.
The class template PQLeafKey is a derived class of class template PQBasicKey.
The class template PQBasicKey is an abstract base class.
virtual void mark(PQNodeMark)=0
mark() sets the variable PQLeaf::m_mark in the derived class PQLeaf and PQInternalNode.
virtual PQNodeType type() const =0
Returns the variable PQInternalNode::m_type in the derived class PQLeaf and PQInternalNode.
bool setNodeInfo(PQNodeKey< T, X, Y > *pointerToInfo)
Sets the pointer m_pointerToInfo to the specified adress of pointerToInfo.
PQNode< T, X, Y > * referenceParent() const
Returns the pointer to the parent if node is a reference child.
PQNodeKey< T, X, Y > * getNodeInfo() const
Returns the identification number of a node.
PQNode< T, X, Y > * m_referenceChild
Stores a pointer to one child, the reference child of the doubly linked cirkular list of children of ...
PQNodeType m_parentType
Stores the type of the parent which can be either a P- or Q-node.
bool changeSiblings(PQNode< T, X, Y > *oldSib, PQNode< T, X, Y > *newSib)
The function changeSiblings() replaces the old sibling oldSib of the node by a new sibling newSib.
PQNode(int count)
The (second) constructor is called, if no information is available or neccessary.
PQNode< T, X, Y > * getEndmost(SibDirection side) const
Returns one of the endmost children of node, if node is a Q-node.
virtual PQNodeStatus status() const =0
Returns the variable PQLeaf::m_status in the derived class PQLeaf and PQInternalNode.
void childCount(int count)
Sets the number of children of a node.
PQNode(int count, PQNodeKey< T, X, Y > *infoPtr)
The (first) constructor combines the node with its information and will automatically set the PQBasic...
void pertChildCount(int count)
Sets the number of pertinent children of a node.
PQNode< T, X, Y > * getEndmost(PQNode< T, X, Y > *other) const
Returns one of the endmost children of node, if node is a Q-node.
SibDirection putSibling(PQNode< T, X, Y > *newSib)
The default function putSibling() stores a new sibling at a free sibling pointer of the node.
SibDirection putSibling(PQNode< T, X, Y > *newSib, SibDirection preference)
The function putSibling() with preference stores a new sibling at a free sibling pointer of the node.
void parentType(PQNodeType newParentType)
Sets the type of the parent of a node.
virtual bool setKey(PQLeafKey< T, X, Y > *pointerToKey)=0
Sets a specified pointer variable in a derived class to the specified adress of pointerToKey that is ...
int m_identificationNumber
Each node that has been introduced once into the tree gets a unique number.
PQNode< T, X, Y > * referenceChild() const
Returns a pointer to the reference child if node is a P-node.
PQNode< T, X, Y > * m_rightEndmost
Stores the right endmost child of a Q-node.
int childCount() const
Returns the number of children of a node.
PQNode< T, X, Y > * m_sibLeft
Stores a pointer ot the left sibling of PQNode.
PQNode< T, X, Y > * m_leftEndmost
virtual ~PQNode()
The destructor does not delete any accompanying information class as PQLeafKey, PQNodeKey and PQInter...
int identificationNumber() const
Returns the identification number of a node.
bool changeEndmost(PQNode< T, X, Y > *oldEnd, PQNode< T, X, Y > *newEnd)
The function changeEndmost() replaces the old endmost child oldEnd of the node by a new child newEnd.
virtual bool setInternal(PQInternalKey< T, X, Y > *pointerToInternal)=0
PQNodeKey< T, X, Y > * m_pointerToInfo
Stores a pointer to the corresponding information of the node.
PQNode< T, X, Y > * m_referenceParent
Is a pointer to the parent, in case that the parent is a P-node and the node itself is its reference ...
PQNode< T, X, Y > * m_firstFull
Stores a pointer to the first full child of a Q-node.
List< PQNode< T, X, Y > * > * fullChildren
Stores all full children of a node during a reduction.
virtual PQLeafKey< T, X, Y > * getKey() const =0
getKey() returns a pointer to the PQLeafKeyof a node, in case that the node is supposed to have a key...
virtual PQNodeMark mark() const =0
mark() returns the variable PQLeaf::m_mark in the derived class PQLeaf and PQInternalNode.
virtual void status(PQNodeStatus)=0
Sets the variable PQLeaf::m_status in the derived class PQLeaf and PQInternalNode.
int m_pertLeafCount
Stores the number of pertinent leaves in the frontier of the node.
PQNode< T, X, Y > * getNextSib(PQNode< T, X, Y > *other) const
The function getNextSib() returns one of the siblings of the node.
virtual PQInternalKey< T, X, Y > * getInternal() const =0
getInternal() returns a pointer to the PQInternalKey information of a node, in case that the node is ...
PQNode< T, X, Y > * m_parent
Is a pointer to the parent.
PQNode< T, X, Y > * getSib(SibDirection side) const
The function getSib() returns one of the siblings of the node.
List< PQNode< T, X, Y > * > * partialChildren
Stores all partial children of a node during a reduction.
PQNodeType parentType() const
Returns the type of the parent of a node.
PQNode< T, X, Y > * m_sibRight
Stores a pointer ot the right sibling of PQNode.
int m_pertChildCount
Stores the number of pertinent children of the node.
int m_debugTreeNumber
Needed for debuging purposes.
PQNode< T, X, Y > * parent() const
The function parent() returns a pointer to the parent of a node.
int pertChildCount() const
Returs the number of pertinent children of a node.
bool endmostChild() const
The function endmostChild() checks if a node is endmost child of a Q-node.
virtual void type(PQNodeType)=0
Sets the variable PQInternalNode::m_type in the derived class PQLeaf and PQInternalNode.
PQNode< T, X, Y > * parent(PQNode< T, X, Y > *newParent)
Sets the parent pointer of a node.
The class template PQNodeKey is a derived class of class template PQBasicKey.
The class PQNodeRoot is used as a base class of the class PQNode.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.