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

priority_queue.h File Reference

#include <volume_io/arrays.h>

Include dependency graph for priority_queue.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define PRIORITY_QUEUE_STRUCT(type)
#define INITIALIZE_PRIORITY_QUEUE(q)
#define INSERT_IN_PRIORITY_QUEUE(q, entry, priority)
#define NUMBER_IN_PRIORITY_QUEUE(q)   ((q).n_entries - 1)
#define IS_PRIORITY_QUEUE_EMPTY(q)   (NUMBER_IN_PRIORITY_QUEUE(q) == 0)
#define REMOVE_FROM_PRIORITY_QUEUE(q, entry, priority)
#define GET_TOP_PRIORITY(q)   ( IS_PRIORITY_QUEUE_EMPTY(q) ? 0.0 : (Real) (q).priorities[1] )
#define DELETE_PRIORITY_QUEUE(q)


Define Documentation

#define DELETE_PRIORITY_QUEUE  ) 
 

Value:

{ \ if( (q).n_alloced > 0 ) \ { \ FREE( (q).entries ); \ FREE( (q).priorities ); \ } \ }

Definition at line 232 of file priority_queue.h.

Referenced by compute_distances_from_point(), and delete_leaf_queue().

#define GET_TOP_PRIORITY  )     ( IS_PRIORITY_QUEUE_EMPTY(q) ? 0.0 : (Real) (q).priorities[1] )
 

Definition at line 216 of file priority_queue.h.

#define INITIALIZE_PRIORITY_QUEUE  ) 
 

Value:

{ \ (q).n_alloced = 0; \ (q).n_entries = 1; \ (q).priorities = NULL; \ (q).entries = NULL; \ }

Definition at line 71 of file priority_queue.h.

Referenced by compute_distances_from_point(), and create_leaf_queue().

#define INSERT_IN_PRIORITY_QUEUE q,
entry,
priority   ) 
 

Value:

{ \ int _index, _next_index; \ \ SET_ARRAY_SIZE( (q).entries, (q).n_alloced, \ (q).n_entries+1, DEFAULT_CHUNK_SIZE ); \ SET_ARRAY_SIZE( (q).priorities, (q).n_alloced, \ (q).n_entries+1, DEFAULT_CHUNK_SIZE ); \ \ _index = (q).n_entries; \ \ while( _index > 1 ) \ { \ _next_index = _index >> 1; \ if( (Real) (q).priorities[_next_index] > (Real) (priority) ) \ break; \ (q).priorities[_index] = (float) (q).priorities[_next_index]; \ (q).entries[_index] = (q).entries[_next_index]; \ _index = _next_index; \ } \ \ (q).priorities[_index] = (float) (priority); \ (q).entries[_index] = entry; \ \ ++(q).n_entries; \ \ (q).n_alloced = (q).n_entries; \ }

Definition at line 94 of file priority_queue.h.

Referenced by compute_distances_from_point(), and insert_in_leaf_queue().

#define IS_PRIORITY_QUEUE_EMPTY  )     (NUMBER_IN_PRIORITY_QUEUE(q) == 0)
 

Definition at line 151 of file priority_queue.h.

Referenced by compute_distances_from_point(), and leaf_queue_empty().

#define NUMBER_IN_PRIORITY_QUEUE  )     ((q).n_entries - 1)
 

Definition at line 136 of file priority_queue.h.

#define PRIORITY_QUEUE_STRUCT type   ) 
 

Value:

struct \ { \ int n_alloced; \ int n_entries; \ float *priorities; \ type *entries; \ }

Definition at line 49 of file priority_queue.h.

Referenced by compute_distances_from_point().

#define REMOVE_FROM_PRIORITY_QUEUE q,
entry,
priority   ) 
 

Definition at line 170 of file priority_queue.h.

Referenced by compute_distances_from_point(), and remove_from_leaf_queue().


Generated on Wed Jul 28 09:11:15 2004 for BICPL by doxygen 1.3.7