#include "gluos.h"
#include <assert.h>
#include "memalloc.h"
#include "priorityq-heap.c"
#include "priorityq-sort.h"
Go to the source code of this file.
◆ GT
◆ LT
◆ Swap
◆ pqDelete()
Definition at line 248 of file priorityq.c.
249{
250 if( curr >= 0 ) {
251 __gl_pqHeapDelete( pq->
heap, curr );
252 return;
253 }
254 curr = -(curr+1);
256
260 }
261}
◆ pqDeletePriorityQ()
◆ pqExtractMin()
Definition at line 203 of file priorityq.c.
204{
205 PQkey sortMin, heapMin;
206
207 if( pq->
size == 0 ) {
208 return __gl_pqHeapExtractMin( pq->
heap );
209 }
213 if(
LEQ( heapMin, sortMin )) {
214 return __gl_pqHeapExtractMin( pq->
heap );
215 }
216 }
217 do {
220 return sortMin;
221}
#define __gl_pqHeapMinimum(pq)
#define __gl_pqHeapIsEmpty(pq)
◆ pqInit()
Definition at line 92 of file priorityq.c.
93{
96 unsigned long seed = 2016473283;
97
98
99
100
101
102
103
104
107
108
109
110
112
115 for( piv = pq->
keys,
i =
p;
i <=
r; ++piv, ++
i ) {
117 }
118
119
120
121
126 while(
r >
p + 10 ) {
127 seed = seed * 1539415821 + 1;
128 i =
p + seed % (
r -
p + 1);
134 do {
135 do { ++
i; }
while(
GT( **
i, *piv ));
136 do { --
j; }
while(
LT( **
j, *piv ));
140 if(
i -
p <
r -
j ) {
143 } else {
146 }
147 }
148
149 for(
i =
p+1;
i <=
r; ++
i ) {
151 for(
j =
i;
j >
p &&
LT( **(
j-1), *piv ); --
j ) {
153 }
155 }
156 }
159 __gl_pqHeapInit( pq->
heap );
160
161#ifndef NDEBUG
164 for(
i =
p;
i <
r; ++
i ) {
166 }
167#endif
168
169 return 1;
170}
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble GLdouble top
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
◆ pqInsert()
Definition at line 174 of file priorityq.c.
175{
176 long curr;
177
179 return __gl_pqHeapInsert( pq->
heap, keyNew );
180 }
184
185
188 (size_t)
189 (pq->
max *
sizeof( pq->
keys[0] )));
193 }
194 }
196 pq->
keys[curr] = keyNew;
197
198
199 return -(curr+1);
200}
◆ pqIsEmpty()
◆ pqMinimum()
Definition at line 224 of file priorityq.c.
225{
226 PQkey sortMin, heapMin;
227
228 if( pq->
size == 0 ) {
230 }
234 if(
LEQ( heapMin, sortMin )) {
235 return heapMin;
236 }
237 }
238 return sortMin;
239}
◆ pqNewPriorityQ()
Definition at line 50 of file priorityq.c.
51{
54
55 pq->
heap = __gl_pqHeapNewPriorityQ( leq );
59 }
60
63 __gl_pqHeapDeletePriorityQ(pq->
heap);
66 }
67
73 return pq;
74}
int(* leq)(PQkey key1, PQkey key2)