46template<
class T,
class X,
class Y>
48template<
class T,
class X,
class Y>
50template<
class T,
class X,
class Y>
52template<
class T,
class X,
class Y>
55template<
class T,
class X,
class Y>
63 friend class PQTree<T, X, Y>;
305 if (pointerToInfo !=
nullptr) {
514template<
class T,
class X,
class Y>
516 if (m_leftEndmost == oldEnd) {
517 m_leftEndmost = newEnd;
519 }
else if (m_rightEndmost == oldEnd) {
520 m_rightEndmost = newEnd;
538template<
class T,
class X,
class Y>
540 if (m_sibLeft == oldSib) {
543 }
else if (m_sibRight == oldSib) {
555template<
class T,
class X,
class Y>
557 m_identificationNumber = count;
559 m_pertChildCount = 0;
561 m_debugTreeNumber = 0;
562 m_parentType = PQNodeType::Undefined;
565 m_firstFull =
nullptr;
567 m_sibRight =
nullptr;
568 m_referenceChild =
nullptr;
569 m_referenceParent =
nullptr;
570 m_leftEndmost =
nullptr;
571 m_rightEndmost =
nullptr;
576 m_pointerToInfo = infoPtr;
584template<
class T,
class X,
class Y>
586 m_identificationNumber = count;
588 m_pertChildCount = 0;
590 m_debugTreeNumber = 0;
591 m_parentType = PQNodeType::Undefined;
594 m_firstFull =
nullptr;
596 m_sibRight =
nullptr;
597 m_referenceChild =
nullptr;
598 m_referenceParent =
nullptr;
599 m_leftEndmost =
nullptr;
600 m_rightEndmost =
nullptr;
605 m_pointerToInfo =
nullptr;
Declaration of doubly linked lists and iterators.
Declaration and implementation of the class PQNodeRoot.
Basic declarations, included by all source files.
Doubly linked lists (maintaining the length of the list).
void setNodePointer(PQNode< T, X, Y > *pqNode)
The function setNodePointer() sets the private member m_nodePointer.
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.
The namespace for all OGDF objects.