#include <climits>
#include "memalloc"
#include "geom"
Go to the source code of this file.
|
#define | tools_glutess_priorityq |
|
#define | PQkey PQHeapKey |
|
#define | PQhandle PQHeapHandle |
|
#define | PriorityQ PriorityQHeap |
|
#define | pqNewPriorityQ(leq) __gl_pqHeapNewPriorityQ(leq) |
|
#define | pqDeletePriorityQ(pq) __gl_pqHeapDeletePriorityQ(pq) |
|
#define | pqInit(pq) __gl_pqHeapInit(pq) |
|
#define | pqInsert(pq, key) __gl_pqHeapInsert(pq,key) |
|
#define | pqMinimum(pq) __gl_pqHeapMinimum(pq) |
|
#define | pqExtractMin(pq) __gl_pqHeapExtractMin(pq) |
|
#define | pqDelete(pq, handle) __gl_pqHeapDelete(pq,handle) |
|
#define | pqIsEmpty(pq) __gl_pqHeapIsEmpty(pq) |
|
#define | __gl_pqHeapMinimum(pq) ((pq)->handles[(pq)->nodes[1].handle].key) |
|
#define | __gl_pqHeapIsEmpty(pq) ((pq)->size == 0) |
|
#define | LEQ(x, y) VertLeq((GLUvertex *)x, (GLUvertex *)y) |
|
#define | PQkey PQSortKey |
|
#define | PQhandle PQSortHandle |
|
#define | PriorityQ PriorityQSort |
|
#define | pqNewPriorityQ(leq) __gl_pqSortNewPriorityQ(leq) |
|
#define | pqDeletePriorityQ(pq) __gl_pqSortDeletePriorityQ(pq) |
|
#define | pqInit(pq) __gl_pqSortInit(pq) |
|
#define | pqInsert(pq, key) __gl_pqSortInsert(pq,key) |
|
#define | pqMinimum(pq) __gl_pqSortMinimum(pq) |
|
#define | pqExtractMin(pq) __gl_pqSortExtractMin(pq) |
|
#define | pqDelete(pq, handle) __gl_pqSortDelete(pq,handle) |
|
#define | pqIsEmpty(pq) __gl_pqSortIsEmpty(pq) |
|
#define | LT(x, y) (! LEQ(y,x)) |
|
#define | GT(x, y) (! LEQ(x,y)) |
|
#define | pq_Swap(a, b) do{PQkey *tmp = *a; *a = *b; *b = tmp;} while(false) |
|
◆ __gl_pqHeapIsEmpty
#define __gl_pqHeapIsEmpty |
( |
|
pq | ) |
((pq)->size == 0) |
◆ __gl_pqHeapMinimum
#define __gl_pqHeapMinimum |
( |
|
pq | ) |
((pq)->handles[(pq)->nodes[1].handle].key) |
◆ GT
#define GT |
( |
|
x, |
|
|
|
y |
|
) |
| (! LEQ(x,y)) |
◆ LEQ
◆ LT
#define LT |
( |
|
x, |
|
|
|
y |
|
) |
| (! LEQ(y,x)) |
◆ pq_Swap
#define pq_Swap |
( |
|
a, |
|
|
|
b |
|
) |
| do{PQkey *tmp = *a; *a = *b; *b = tmp;} while(false) |
◆ pqDelete [1/2]
◆ pqDelete [2/2]
◆ pqDeletePriorityQ [1/2]
◆ pqDeletePriorityQ [2/2]
◆ pqExtractMin [1/2]
◆ pqExtractMin [2/2]
◆ PQhandle [1/2]
typedef PQHeapHandle PQhandle PQHeapHandle |
◆ PQhandle [2/2]
◆ pqInit [1/2]
◆ pqInit [2/2]
◆ pqInsert [1/2]
◆ pqInsert [2/2]
◆ pqIsEmpty [1/2]
◆ pqIsEmpty [2/2]
◆ PQkey [1/2]
typedef PQHeapKey PQkey PQHeapKey |
◆ PQkey [2/2]
◆ pqMinimum [1/2]
◆ pqMinimum [2/2]
◆ pqNewPriorityQ [1/2]
◆ pqNewPriorityQ [2/2]
◆ PriorityQ [1/2]
◆ PriorityQ [2/2]
◆ tools_glutess_priorityq
#define tools_glutess_priorityq |
◆ PQhandle
◆ PQkey
◆ PriorityQ
◆ INIT_SIZE()
Definition at line 77 of file priorityq.
78 static const long s_value = 32;
◆ pqDelete()
Definition at line 263 of file priorityq.
269 assert( hCurr >= 1 && hCurr <= pq->max && h[hCurr].key != NULL );
271 curr = h[hCurr].
node;
275 if( curr <= -- pq->
size ) {
276 if( curr <= 1 ||
LEQ( h[n[curr>>1].handle].key, h[n[curr].handle].key )) {
◆ pqDeletePriorityQ()
◆ pqExtractMin()
◆ pqInit()
Definition at line 178 of file priorityq.
184 for( i = pq->
size; i >= 1; --i ) {
◆ pqInsert()
Definition at line 192 of file priorityq.
198 if( (curr*2) > pq->
max ) {
206 ((pq->
max + 1) *
sizeof( pq->
nodes[0] )));
207 if (pq->
nodes == NULL) {
208 pq->
nodes = saveNodes;
235 assert(free != LONG_MAX);
◆ pqIsEmpty()
◆ pqMinimum()
Definition at line 533 of file priorityq.
535 PQkey sortMin, heapMin;
537 if( pq->
size == 0 ) {
543 if(
LEQ( heapMin, sortMin )) {
◆ pqNewPriorityQ()
Definition at line 87 of file priorityq.
90 if (pq == NULL)
return NULL;
95 if (pq->
nodes == NULL) {
◆ static_FloatDown()
inline void static_FloatDown |
( |
PriorityQ * |
pq, |
|
|
long |
curr |
|
) |
| |
Definition at line 125 of file priorityq.
135 if( child < pq->
size &&
LEQ( h[n[child+1].handle].key,
136 h[n[child].handle].key )) {
140 assert(child <= pq->max);
143 if( child > pq->
size ||
LEQ( h[hCurr].key, h[hChild].key )) {
145 h[hCurr].
node = curr;
149 h[hChild].
node = curr;
◆ static_FloatUp()
inline void static_FloatUp |
( |
PriorityQ * |
pq, |
|
|
long |
curr |
|
) |
| |
Definition at line 155 of file priorityq.
165 hParent = n[parent].
handle;
166 if( parent == 0 ||
LEQ( h[hParent].key, h[hCurr].key )) {
168 h[hCurr].
node = curr;
172 h[hParent].
node = curr;