heap.c
Go to the documentation of this file.
boolean LessThanID(void *a, void *b, void *userData) Comparison operator for identifiers. Definition: heap.c:214 unsigned int VectorSize(Tvector *vector) Gets the number of elements in a vector. Definition: vector.c:169 void * GetVectorElement(unsigned int i, Tvector *vector) Returns a pointer to a vector element. Definition: vector.c:269 unsigned int GetHeapPosition(unsigned int id, Theap *heap) Returns the current position in the heap of an element given its identifier. Definition: heap.c:348 boolean LessThanPtr(void *a, void *b, void *userData) Comparison operator for pointers. Definition: heap.c:231 void RemoveVectorElement(unsigned int i, Tvector *vector) Removes an element from the vector. Definition: vector.c:285 boolean LessThanDouble(void *a, void *b, void *userData) Comparison operator for doubles. Definition: heap.c:219 void ExtractVectorElement(unsigned int i, void *e, Tvector *vector) Extracts an element from a vector. Definition: vector.c:341 boolean HeapDown(unsigned int i, Theap *heap) Moves an element down in the heap. Definition: heap.c:159 void AddElement2Heap(unsigned int id, void *e, Theap *heap) Adds an element to the heap. Definition: heap.c:294 Error and warning functions. Definition of a binary heap used to implement priority queues. boolean LessThanDoublePair(void *a, void *b, void *userData) Comparison operator for paris of doubles. Definition: heap.c:224 void * GetHeapElement(unsigned int i, Theap *heap) Returns a pointer to a heap element. Definition: heap.c:331 #define HEAP_PARENT(i) Returns the identifier of a parent node in a binary heap. Definition: heap.c:25 Definitions of constants and macros used in several parts of the cuik library. void InitVector(unsigned int ele_size, void(*Copy)(void *, void *), void(*Delete)(void *), unsigned int max_ele, Tvector *vector) Constructor. Definition: vector.c:100 void SetVectorElement(unsigned int i, void *e, Tvector *vector) Adds an element to the vector in a given position. Definition: vector.c:234 void InitHeap(unsigned int ele_size, void(*Copy)(void *, void *), void(*Delete)(void *), boolean(*LessThan)(void *, void *, void *), void *userData, boolean hasIDs, unsigned int max_ele, Theap *heap) Constructor. Definition: heap.c:237 #define NO_UINT Used to denote an identifier that has not been initialized. Definition: defines.h:435 unsigned int ExtractMinElement(void *e, Theap *heap) Extracts and removes the minimal element of a heap. Definition: heap.c:356 void * GetHeapElementWithID(unsigned int id, Theap *heap) Returns a pointer to a heap element given the element identifier. Definition: heap.c:340 void SwapVectorElements(unsigned int i, unsigned int j, Tvector *vector) Swaps two elements in a vector. Definition: vector.c:298 void UpdateHeapElement(unsigned int id, void *e, Theap *heap) Updates the position of an element in the heap. Definition: heap.c:308 |
Follow us!