Institut de Robòtica i Informàtica Industrial
KRD Group

The CuikSuite Project

Theap Struct Reference

A generic binary heap. More...

#include <heap.h>

Collaboration diagram for Theap:

Data Fields

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

Detailed Description

A generic binary heap.

See also:
heap.h, heap.c.

Definition at line 88 of file heap.h.


Field Documentation

The binary heap stored as a vector

Definition at line 90 of file heap.h.

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

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

Definition at line 92 of file heap.h.

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

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

Definition at line 94 of file heap.h.

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

unsigned int Theap::last

Last vector position used so far.

Definition at line 96 of file heap.h.

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

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

The comparison operator to sort the elements in the heap.

Definition at line 97 of file heap.h.

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

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 99 of file heap.h.

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


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