Main MRPT website > C++ reference for MRPT 1.9.9
Classes | Macros | Functions
minpq.h File Reference
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  pq_node
 an element in a minimizing priority queue More...
 
struct  min_pq
 a minimizing priority queue More...
 

Macros

#define MINPQ_INIT_NALLOCD   512
 

Functions

struct min_pqminpq_init ()
 
Creates a new minimizing priority queue. More...
 
int minpq_insert (struct min_pq *min_pq, void *data, int key)
 
Inserts an element into a minimizing priority queue. More...
 
voidminpq_get_min (struct min_pq *min_pq)
 
Returns the element of a minimizing priority queue with the smallest key without removing it from the queue. More...
 
voidminpq_extract_min (struct min_pq *min_pq)
 
Removes and returns the element of a minimizing priority queue with the smallest key. More...
 
void minpq_release (struct min_pq **min_pq)
 
De-allocates the memory held by a minimizing priorioty queue More...
 

Macro Definition Documentation

◆ MINPQ_INIT_NALLOCD

#define MINPQ_INIT_NALLOCD   512

Definition at line 18 of file minpq.h.

Function Documentation

◆ minpq_extract_min()

void* minpq_extract_min ( struct min_pq min_pq)


Removes and returns the element of a minimizing priority queue with the smallest key.

Parameters
min_pqa minimizing priority queue
Returns
Returns the element of min_pq with the smallest key of NULL if min_pq is empty

◆ minpq_get_min()

void* minpq_get_min ( struct min_pq min_pq)


Returns the element of a minimizing priority queue with the smallest key without removing it from the queue.

Parameters
min_pqa minimizing priority queue
Returns
Returns the element of min_pq with the smallest key or NULL if min_pq is empty

◆ minpq_init()

struct min_pq* minpq_init ( )


Creates a new minimizing priority queue.

◆ minpq_insert()

int minpq_insert ( struct min_pq min_pq,
void data,
int  key 
)


Inserts an element into a minimizing priority queue.

Parameters
min_pqa minimizing priority queue
datathe data to be inserted
keythe key to be associated with data
Returns
Returns 0 on success or 1 on failure.

◆ minpq_release()

void minpq_release ( struct min_pq **  min_pq)


De-allocates the memory held by a minimizing priorioty queue

Parameters
min_pqpointer to a minimizing priority queue



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019