Theap Struct Reference

Detailed Description

A generic binary heap.

See Also
heap.h, heap.c.

Definition at line 105 of file heap.h.

Data Fields

Tvector data
 
boolean hasIDs
 
Tvector id2data
 
Tvector data2id
 
unsigned int last
 
boolean(* LessThan )(void *, void *, void *)
 
void * userData
 

Field Documentation

Tvector Theap::data

The binary heap stored as a vector

Definition at line 107 of file heap.h.

Referenced by AddElement2Heap(), CopyHeap(), DeleteHeap(), ExtractMinElement(), GetHeapElement(), HeapDown(), HeapUp(), InitHeap(), ResetHeap(), and UpdateHeapElement().

boolean Theap::hasIDs

TRUE if elements have associated identifiers.

Definition at line 108 of file heap.h.

Referenced by AddElement2Heap(), CopyHeap(), DeleteHeap(), ExtractMinElement(), GetHeapElementWithID(), GetHeapPosition(), HeapDown(), HeapUp(), InitHeap(), ResetHeap(), and UpdateHeapElement().

Tvector Theap::id2data

Used to efficiently retrive the position in the heap of an object given its identifier

Definition at line 109 of file heap.h.

Referenced by AddElement2Heap(), CheckHeap(), CopyHeap(), DeleteHeap(), ExtractMinElement(), GetHeapPosition(), HeapDown(), HeapUp(), InitHeap(), ResetHeap(), and UpdateHeapElement().

Tvector Theap::data2id

Used to efficiently retrive the identifier of the object given its position in the heap

Definition at line 111 of file heap.h.

Referenced by AddElement2Heap(), CheckHeap(), CopyHeap(), DeleteHeap(), ExtractMinElement(), HeapDown(), HeapUp(), InitHeap(), and ResetHeap().

unsigned int Theap::last

Last vector position used so far.

Definition at line 113 of file heap.h.

Referenced by AddElement2Heap(), CheckHeap(), CopyHeap(), ExtractMinElement(), HeapEmpty(), HeapSize(), InitHeap(), ResetHeap(), and UpdateHeapElement().

boolean(* Theap::LessThan)(void *, void *, void *)

The comparison operator to sort the elements in the heap.

Definition at line 114 of file heap.h.

Referenced by CopyHeap(), HeapDown(), HeapUp(), and InitHeap().

void* Theap::userData

Pointer to a user defined block of data that is passed to the LessThan operator as a third parameter. This allows to define complex LessThan operators such as comparision with a prototype and not just direct comparison between the two elements in the heap.

Definition at line 116 of file heap.h.

Referenced by CopyHeap(), HeapDown(), HeapUp(), and InitHeap().