RNAlib-2.4.14
heap.h File Reference

Implementation of an abstract heap data structure. More...

Go to the source code of this file.

Typedefs

typedef struct vrna_heap_s * vrna_heap_t
 An abstract heap data structure. More...
 
typedef int( vrna_callback_heap_cmp) (const void *a, const void *b, void *data)
 Heap compare function prototype. More...
 
typedef size_t( vrna_callback_heap_get_pos) (const void *a, void *data)
 Retrieve the position of a particular heap entry within the heap. More...
 
typedef void( vrna_callback_heap_set_pos) (const void *a, size_t pos, void *data)
 Store the position of a particular heap entry within the heap. More...
 

Functions

vrna_heap_t vrna_heap_init (size_t n, vrna_callback_heap_cmp *cmp, vrna_callback_heap_get_pos *get_entry_pos, vrna_callback_heap_set_pos *set_entry_pos, void *data)
 Initialize a heap data structure. More...
 
void vrna_heap_free (vrna_heap_t h)
 Free memory occupied by a heap data structure. More...
 
size_t vrna_heap_size (struct vrna_heap_s *h)
 Get the size of a heap data structure, i.e. the number of stored elements. More...
 
void vrna_heap_insert (vrna_heap_t h, void *v)
 Insert an element into the heap. More...
 
void * vrna_heap_pop (vrna_heap_t h)
 Pop (remove and return) the object at the root of the heap. More...
 
const void * vrna_heap_top (vrna_heap_t h)
 Get the object at the root of the heap. More...
 
void * vrna_heap_remove (vrna_heap_t h, const void *v)
 Remove an arbitrary element within the heap. More...
 
void * vrna_heap_update (vrna_heap_t h, void *v)
 Update an arbitrary element within the heap. More...
 

Detailed Description

Implementation of an abstract heap data structure.