Detailed Description
methods for working with priority queue
Various methods to work with the priority queue
Definition in file gcgpqueue.c.
#include "gcg/gcgpqueue.h"#include "gcg/pub_gcgpqueue.h"#include "gcg/gcg.h"#include "scip/def.h"#include "scip/scip.h"#include "blockmemshell/memory.h"#include <assert.h>Go to the source code of this file.
Macros | |
| #define | PQ_PARENT(q) |
| #define | PQ_LEFTCHILD(p) |
| #define | PQ_RIGHTCHILD(p) |
Functions | |
| static SCIP_RETCODE | pqueueResize (GCG_PQUEUE *pqueue, int minsize) |
| static SCIP_RETCODE | pqueueHeapify (GCG_PQUEUE *pqueue, int pos) |
| SCIP_RETCODE | GCGpqueueCreate (SCIP *scip, GCG_PQUEUE **pqueue, int initsize, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), GCG_LOCK *memorylock) |
| void | GCGpqueueFree (GCG_PQUEUE **pqueue) |
| void | GCGpqueueClear (GCG_PQUEUE *pqueue) |
| SCIP_RETCODE | GCGpqueueInsert (GCG_PQUEUE *pqueue, void *elem) |
| void * | GCGpqueueRemove (GCG_PQUEUE *pqueue) |
| SCIP_RETCODE | GCGpqueueResort (GCG_PQUEUE *pqueue) |
| SCIP_RETCODE | GCGpqueueSetComperator (GCG_PQUEUE *pqueue,) |
| SCIP_RETCODE | GCGpqueueDelete (GCG_PQUEUE *pqueue, int pos, void **elem) |
| void * | GCGpqueueFirst (GCG_PQUEUE *pqueue) |
| int | GCGpqueueNElems (GCG_PQUEUE *pqueue) |
| void ** | GCGpqueueElems (GCG_PQUEUE *pqueue) |
Macro Definition Documentation
◆ PQ_PARENT
| #define PQ_PARENT | ( | q | ) |
Definition at line 55 of file gcgpqueue.c.
Referenced by GCGpqueueDelete(), GCGpqueueInsert(), GCGpqueueRemove(), GCGpqueueResort(), and pqueueHeapify().
◆ PQ_LEFTCHILD
| #define PQ_LEFTCHILD | ( | p | ) |
Definition at line 56 of file gcgpqueue.c.
Referenced by GCGpqueueDelete(), GCGpqueueRemove(), and pqueueHeapify().
◆ PQ_RIGHTCHILD
| #define PQ_RIGHTCHILD | ( | p | ) |
Definition at line 57 of file gcgpqueue.c.
Referenced by GCGpqueueDelete(), GCGpqueueRemove(), and pqueueHeapify().
Function Documentation
◆ pqueueResize()
|
static |
resizes element memory to hold at least the given number of elements
- Parameters
-
pqueue pointer to a priority queue minsize minimal number of storable elements
Definition at line 62 of file gcgpqueue.c.
References assert(), GCG_SET_LOCK, GCG_UNSET_LOCK, pqueueResize(), retcode, GCG_PQueue::scip, GCG_PQueue::size, and GCG_PQueue::slots.
Referenced by GCGpqueueCreate(), GCGpqueueInsert(), and pqueueResize().
◆ pqueueHeapify()
|
static |
heapifies element at position pos into corresponding subtrees
- Parameters
-
pqueue pointer to a priority queue pos heapify element at position pos into corresponding subtrees
Definition at line 87 of file gcgpqueue.c.
References assert(), GCG_PQueue::len, PQ_LEFTCHILD, PQ_PARENT, PQ_RIGHTCHILD, pqueueHeapify(), and GCG_PQueue::slots.
Referenced by GCGpqueueResort(), and pqueueHeapify().