Main Page | Data Structures | Directories | File List | Globals

mqheap.h

Go to the documentation of this file.
00001 #ifndef _MQHEAP_H_
00002 #define _MQHEAP_H_
00003 
00004 /* Copyright (c) Kyriacos Leptos and the President and Fellows of Harvard University
00005    Release Date: 2004-11-01
00006    Part of the MapQuant suite library "mqbasic.lib" 
00007 */
00008 
00022 struct MQHeap
00023 {
00024     void* node;
00025     int(*cmp)(void *node1, void *node2);
00026     int tail;
00027     int size;
00028     int sof;
00029     char name[12];
00030 };
00031 
00032 typedef struct MQHeap MQHeap;
00033 
00034 void    MQHeap_create(MQHeap* H, char* name, int size_of_heap, int size_of_element, int(*cmp_function)(void* node1, void* node2));
00035 void    MQHeap_insert(MQHeap* H, void* newNode);
00036 int     MQHeap_heapifyUp(MQHeap *H, int pos);
00037 int     MQHeap_maxChild(MQHeap *H, int left, int right);
00038 int     MQHeap_heapifyDown(MQHeap *H, int pos);
00039 void    MQHeap_extractMax(MQHeap *H, void* max);
00040 
00041 void    MQHeap_print(MQHeap *H);
00042 
00043 #endif
00044 

Generated on Tue Feb 7 03:25:43 2006 for libmqbasic by  doxygen 1.4.4