priority queue with O(1) access to the minimum element
Functions | |
SCIP_RETCODE | SCIPpqueueCreate (SCIP_PQUEUE **pqueue, int initsize, SCIP_Real sizefac, SCIP_DECL_SORTPTRCOMP((*ptrcomp))) |
void | SCIPpqueueFree (SCIP_PQUEUE **pqueue) |
void | SCIPpqueueClear (SCIP_PQUEUE *pqueue) |
SCIP_RETCODE | SCIPpqueueInsert (SCIP_PQUEUE *pqueue, void *elem) |
void * | SCIPpqueueRemove (SCIP_PQUEUE *pqueue) |
void * | SCIPpqueueFirst (SCIP_PQUEUE *pqueue) |
int | SCIPpqueueNElems (SCIP_PQUEUE *pqueue) |
void ** | SCIPpqueueElems (SCIP_PQUEUE *pqueue) |
SCIP_RETCODE SCIPpqueueCreate | ( | SCIP_PQUEUE ** | pqueue, |
int | initsize, | ||
SCIP_Real | sizefac, | ||
SCIP_DECL_SORTPTRCOMP((*ptrcomp)) | |||
) |
creates priority queue
pqueue | pointer to a priority queue |
initsize | initial number of available element slots |
sizefac | memory growing factor applied, if more element slots are needed |
Definition at line 1135 of file misc.c.
References BMSallocMemory, MAX, NULL, pqueueResize(), SCIP_ALLOC, SCIP_CALL, and SCIP_OKAY.
Referenced by initData(), initProblem(), nodepairqueueCreate(), and SCIPconflictCreate().
void SCIPpqueueFree | ( | SCIP_PQUEUE ** | pqueue | ) |
frees priority queue, but not the data elements themselves
pqueue | pointer to a priority queue |
Definition at line 1160 of file misc.c.
References BMSfreeMemory, BMSfreeMemoryArray, and NULL.
Referenced by freeProblem(), nodepairqueueFree(), SCIP_DECL_PROPEXITSOL(), and SCIPconflictFree().
void SCIPpqueueClear | ( | SCIP_PQUEUE * | pqueue | ) |
clears the priority queue, but doesn't free the data elements themselves
pqueue | priority queue |
Definition at line 1171 of file misc.c.
References SCIP_PQueue::len, and NULL.
Referenced by conflictClear().
SCIP_RETCODE SCIPpqueueInsert | ( | SCIP_PQUEUE * | pqueue, |
void * | elem | ||
) |
inserts element into priority queue
pqueue | priority queue |
elem | element to be inserted |
Definition at line 1181 of file misc.c.
References SCIP_PQueue::len, NULL, PQ_PARENT, pqueueResize(), SCIP_CALL, SCIP_OKAY, and SCIP_PQueue::slots.
Referenced by conflictQueueBound(), createAndSplitProblem(), nodepairqueueCreate(), propagateVbounds(), SCIP_DECL_EVENTEXEC(), and solveProblem().
void* SCIPpqueueRemove | ( | SCIP_PQUEUE * | pqueue | ) |
removes and returns best element from the priority queue
pqueue | priority queue |
Definition at line 1208 of file misc.c.
References SCIP_PQueue::len, NULL, PQ_LEFTCHILD, PQ_PARENT, PQ_RIGHTCHILD, and SCIP_PQueue::slots.
Referenced by conflictFirstCand(), conflictRemoveCand(), nodepairqueueRemove(), propagateVbounds(), and solveProblem().
void* SCIPpqueueFirst | ( | SCIP_PQUEUE * | pqueue | ) |
returns the best element of the queue without removing it
pqueue | priority queue |
Definition at line 1249 of file misc.c.
References SCIP_PQueue::len, NULL, and SCIP_PQueue::slots.
Referenced by conflictFirstCand(), and nodepairqueueIsEmpty().
int SCIPpqueueNElems | ( | SCIP_PQUEUE * | pqueue | ) |
returns the number of elements in the queue
pqueue | priority queue |
Definition at line 1263 of file misc.c.
References SCIP_PQueue::len, and NULL.
Referenced by conflictAddConflictset(), conflictAnalyze(), conflictCreateReconvergenceConss(), conflictFirstCand(), conflictRemoveCand(), conflictResolveBound(), propagateVbounds(), SCIP_DECL_EVENTEXEC(), SCIPconflictAnalyze(), SCIPisPropagatedVbounds(), and solveProblem().
void** SCIPpqueueElems | ( | SCIP_PQUEUE * | pqueue | ) |
returns the elements of the queue; changing the returned array may destroy the queue's ordering!
pqueue | priority queue |
Definition at line 1274 of file misc.c.
References SCIP_PQueue::len, NULL, and SCIP_PQueue::slots.
Referenced by conflictAddConflictset(), and conflictResolveBound().