ATLAS Offline Software
binary-heap.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2005-2008, Simon Howard
4 
5 Permission to use, copy, modify, and/or distribute this software
6 for any purpose with or without fee is hereby granted, provided
7 that the above copyright notice and this permission notice appear
8 in all copies.
9 
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
14 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
16 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
17 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 
19  */
20 
38 #ifndef ALGORITHM_BINARY_HEAP_H
39 #define ALGORITHM_BINARY_HEAP_H
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
53 typedef enum {
57 
62 
67 typedef void *BinaryHeapValue;
68 
73 #define BINARY_HEAP_NULL ((void *) 0)
74 
86  BinaryHeapValue value2);
87 
92 typedef struct _BinaryHeap BinaryHeap;
93 
105  BinaryHeapCompareFunc compare_func);
106 
114 
126 
136 
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif /* #ifndef ALGORITHM_BINARY_HEAP_H */
151 
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
BinaryHeapType
BinaryHeapType
Heap type.
Definition: binary-heap.h:53
BinaryHeapCompareFunc
int(* BinaryHeapCompareFunc)(BinaryHeapValue value1, BinaryHeapValue value2)
Type of function used to compare values in a binary heap.
Definition: binary-heap.h:85
BinaryHeapValue
void * BinaryHeapValue
A value stored in a BinaryHeap.
Definition: binary-heap.h:67
athena.value
value
Definition: athena.py:122
BINARY_HEAP_TYPE_MIN
@ BINARY_HEAP_TYPE_MIN
A minimum heap.
Definition: binary-heap.h:56
binary_heap_insert
int binary_heap_insert(BinaryHeap *heap, BinaryHeapValue value)
Insert a value into a binary heap.
binary_heap_num_entries
int binary_heap_num_entries(BinaryHeap *heap)
Find the number of values stored in a binary heap.
binary_heap_free
void binary_heap_free(BinaryHeap *heap)
Destroy a binary heap.
BINARY_HEAP_TYPE_MAX
@ BINARY_HEAP_TYPE_MAX
A maximum heap.
Definition: binary-heap.h:60
binary_heap_pop
BinaryHeapValue binary_heap_pop(BinaryHeap *heap)
Remove the first value from a binary heap.
BinaryHeap
struct _BinaryHeap BinaryHeap
A binary heap data structure.
Definition: binary-heap.h:92
binary_heap_new
BinaryHeap * binary_heap_new(BinaryHeapType heap_type, BinaryHeapCompareFunc compare_func)
Create a new BinaryHeap.