Open
Graph Drawing
Framework

 v.2012.05
 

ogdf::DeletingTop10Heap< X, Priority, STATICCOMPARER, INDEX > Class Template Reference

A variant of Top10Heap which deletes the elements that get rejected from the heap. More...

#include <ogdf/basic/MinHeap.h>

Inheritance diagram for ogdf::DeletingTop10Heap< X, Priority, STATICCOMPARER, INDEX >:
ogdf::Top10Heap< Prioritized< X *, Priority >, INDEX > ogdf::BinaryHeapSimple< X, INDEX >

List of all members.

Public Member Functions

 DeletingTop10Heap (int size)
 Construct a DeletingTop10Heap of given maximal capacity.
void pushAndDelete (X *x, Priority p)
 Inserts the element x into the heap with priority val and deletes the element with smallest priority if the heap is full.
void insertAndDelete (X *x, Priority p)
 Alternative name for pushAndDelete().
void pushAndDeleteNoRedundancy (X *x, Priority p)
 Analogous to pushandDelete(), but furthermore rejects (and deletes) an element if an equal element is already in the heap.
void insertAndDeleteNoRedundancy (X *x, Priority p)
 Alternative name for pushAndKillNoRedundancy().

Detailed Description

template<class X, class Priority = double, class STATICCOMPARER = StdComparer<X>, class INDEX = int>
class ogdf::DeletingTop10Heap< X, Priority, STATICCOMPARER, INDEX >

A variant of Top10Heap which deletes the elements that get rejected from the heap.

The datastructure of course requires the stored data-elements to be pointers (in order to be deletable when rejected). Hence the template parameter only specifies the data-type, without stating axplicitly that we considere pointers to the structure.

The datastructure also allows for non-duplicate insertions, i.e., a new element can be rejected if it is already in the heap. Note that only the compare function has to work

Definition at line 294 of file MinHeap.h.


Constructor & Destructor Documentation

template<class X , class Priority = double, class STATICCOMPARER = StdComparer<X>, class INDEX = int>
ogdf::DeletingTop10Heap< X, Priority, STATICCOMPARER, INDEX >::DeletingTop10Heap ( int  size) [inline]

Construct a DeletingTop10Heap of given maximal capacity.

Definition at line 297 of file MinHeap.h.


Member Function Documentation

template<class X , class Priority = double, class STATICCOMPARER = StdComparer<X>, class INDEX = int>
void ogdf::DeletingTop10Heap< X, Priority, STATICCOMPARER, INDEX >::insertAndDelete ( X *  x,
Priority  p 
) [inline]

Alternative name for pushAndDelete().

Definition at line 311 of file MinHeap.h.

template<class X , class Priority = double, class STATICCOMPARER = StdComparer<X>, class INDEX = int>
void ogdf::DeletingTop10Heap< X, Priority, STATICCOMPARER, INDEX >::insertAndDeleteNoRedundancy ( X *  x,
Priority  p 
) [inline]

Alternative name for pushAndKillNoRedundancy().

Definition at line 332 of file MinHeap.h.

template<class X , class Priority = double, class STATICCOMPARER = StdComparer<X>, class INDEX = int>
void ogdf::DeletingTop10Heap< X, Priority, STATICCOMPARER, INDEX >::pushAndDelete ( X *  x,
Priority  p 
) [inline]

Inserts the element x into the heap with priority val and deletes the element with smallest priority if the heap is full.

Like the Top10Heap, this function pushes the element x onto the heap with priority val, and extracts the element with smallest priority if the heap was already full. In contrast to the Top10Heap, this element which leaves the heap (or x itself if its priority was below all the priorities in the heap) gets deleted, i.e., removed from memory.

Definition at line 304 of file MinHeap.h.

template<class X , class Priority = double, class STATICCOMPARER = StdComparer<X>, class INDEX = int>
void ogdf::DeletingTop10Heap< X, Priority, STATICCOMPARER, INDEX >::pushAndDeleteNoRedundancy ( X *  x,
Priority  p 
) [inline]

Analogous to pushandDelete(), but furthermore rejects (and deletes) an element if an equal element is already in the heap.

This function takes linear time in the worst case, and uses the compare function of the specified COMP template paremeter class, which can be any function returning true if two objects should be considered equal, and false otherwise.

Definition at line 319 of file MinHeap.h.


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