Go to the source code of this file.
◆ pqDelete
| #define pqDelete |
( |
|
pq, |
|
|
|
handle |
|
) |
| __gl_pqSortDelete(pq,handle) |
◆ pqDeletePriorityQ
| #define pqDeletePriorityQ |
( |
|
pq | ) |
__gl_pqSortDeletePriorityQ(pq) |
◆ pqExtractMin
| #define pqExtractMin |
( |
|
pq | ) |
__gl_pqSortExtractMin(pq) |
◆ PQhandle
◆ pqInit
| #define pqInit |
( |
|
pq | ) |
__gl_pqSortInit(pq) |
◆ pqInsert
| #define pqInsert |
( |
|
pq, |
|
|
|
key |
|
) |
| __gl_pqSortInsert(pq,key) |
◆ pqIsEmpty
| #define pqIsEmpty |
( |
|
pq | ) |
__gl_pqSortIsEmpty(pq) |
◆ PQkey
◆ pqMinimum
| #define pqMinimum |
( |
|
pq | ) |
__gl_pqSortMinimum(pq) |
◆ pqNewPriorityQ
| #define pqNewPriorityQ |
( |
|
leq | ) |
__gl_pqSortNewPriorityQ(leq) |
◆ PriorityQ
◆ PQhandle
◆ PQkey
◆ PriorityQ
◆ pqDelete()
235{
238 long curr;
239
240 assert( hCurr >= 1 && hCurr <= pq->max && h[hCurr].key != NULL );
241
242 curr = h[hCurr].
node;
245
246 if( curr <= -- pq->size ) {
247 if( curr <= 1 ||
LEQ( h[n[curr>>1].handle].key, h[n[curr].handle].key )) {
249 } else {
251 }
252 }
256}
#define LEQ(x, y)
Definition priorityq-heap.c:54
static void FloatDown(PriorityQ *pq, long curr)
Definition priorityq-heap.c:96
static void FloatUp(PriorityQ *pq, long curr)
Definition priorityq-heap.c:126
PQhandle handle
Definition priorityq-heap.h:83
PQkey key
Definition priorityq-heap.h:84
PQhandle node
Definition priorityq-heap.h:84
Definition priorityq-heap.h:84
Definition priorityq-heap.h:83
PQnode * nodes
Definition priorityq-heap.h:87
PQhandleElem * handles
Definition priorityq-heap.h:88
PQhandle freeList
Definition priorityq-heap.h:90
long size
Definition priorityq-heap.h:89
◆ pqDeletePriorityQ()
89{
93}
#define memFree
Definition memalloc.h:41
◆ pqExtractMin()
212{
217
221
225
226 if( -- pq->
size > 0 ) {
228 }
229 }
231}
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half() min(const half &a, const half &b)
Definition Half.h:507
long PQhandle
Definition priorityq-heap.h:80
void * PQkey
Definition priorityq-heap.h:79
◆ pqInit()
150{
151 long i;
152
153
154
155 for( i = pq->
size; i >= 1; --i ) {
157 }
159}
#define TRUE
Definition priorityq-heap.c:43
int initialized
Definition priorityq-heap.h:91
◆ pqInsert()
164{
165 long curr;
167
169 if( (curr*2) > pq->
max ) {
172
173
176 (size_t)
177 ((pq->
max + 1) *
sizeof( pq->
nodes[0] )));
178 if (pq->
nodes == NULL) {
179 pq->
nodes = saveNodes;
180 return LONG_MAX;
181 }
183 (size_t)
188 return LONG_MAX;
189 }
190 }
191
193 free_handle = curr;
194 } else {
197 }
198
202
205 }
206 assert(free_handle != LONG_MAX);
207 return free_handle;
208}
#define memRealloc
Definition memalloc.h:40
long max
Definition priorityq-heap.h:89
◆ pqIsEmpty()
◆ pqMinimum()
◆ pqNewPriorityQ()
59{
61 if (pq == NULL) return NULL;
62
66 if (pq->
nodes == NULL) {
68 return NULL;
69 }
70
75 return NULL;
76 }
77
81
84 return pq;
85}
#define memAlloc
Definition memalloc.h:48
#define INIT_SIZE
Definition priorityq-heap.c:40
#define FALSE
Definition priorityq-heap.c:46
Definition priorityq-heap.h:86
int(* leq)(PQkey key1, PQkey key2)
Definition priorityq-heap.h:92