Main Page | Modules | Data Structures | File List | Data Fields | Globals

massspec/heap.h

00001 #ifndef _HEAP_H_ 00002 #define _HEAP_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 "massspec.lib" 00007 */ 00008 00009 typedef struct 00010 { 00011 void* node; 00012 int(*cmp)(void *node1, void *node2); 00013 int tail; 00014 int size; 00015 int sof; 00016 char name[12]; 00017 } Heap; 00018 00019 void createHeap(Heap* H, char* name, int size_of_heap, int size_of_element, int(*cmp_function)(void* node1, void* node2)); 00020 void insertHeap(Heap* H, void* newNode); 00021 int heapifyUp(Heap *H, int pos); 00022 int maxChild(Heap *H, int left, int right); 00023 int heapifyDown(Heap *H, int pos); 00024 void extractMax(Heap *H, void* max); 00025 00026 void printHeap(Heap *H); 00027 00028 #endif 00029

Generated on Sun Feb 13 01:05:57 2005 for MapQuant by doxygen 1.3.7