Detailed Description
circular FIFO queue
Functions | |
SCIP_EXPORT SCIP_RETCODE | SCIPqueueCreate (SCIP_QUEUE **queue, int initsize, SCIP_Real sizefac) |
SCIP_EXPORT void | SCIPqueueFree (SCIP_QUEUE **queue) |
SCIP_EXPORT void | SCIPqueueClear (SCIP_QUEUE *queue) |
SCIP_EXPORT SCIP_RETCODE | SCIPqueueInsert (SCIP_QUEUE *queue, void *elem) |
SCIP_EXPORT SCIP_RETCODE | SCIPqueueInsertUInt (SCIP_QUEUE *queue, unsigned int elem) |
SCIP_EXPORT void * | SCIPqueueRemove (SCIP_QUEUE *queue) |
SCIP_EXPORT unsigned int | SCIPqueueRemoveUInt (SCIP_QUEUE *queue) |
SCIP_EXPORT void * | SCIPqueueFirst (SCIP_QUEUE *queue) |
SCIP_EXPORT unsigned int | SCIPqueueFirstUInt (SCIP_QUEUE *queue) |
SCIP_EXPORT SCIP_Bool | SCIPqueueIsEmpty (SCIP_QUEUE *queue) |
SCIP_EXPORT int | SCIPqueueNElems (SCIP_QUEUE *queue) |
Function Documentation
◆ SCIPqueueCreate()
SCIP_EXPORT SCIP_RETCODE SCIPqueueCreate | ( | SCIP_QUEUE ** | queue, |
int | initsize, | ||
SCIP_Real | sizefac | ||
) |
creates a (circular) queue, best used if the size will be fixed or will not be increased that much
- Parameters
-
queue pointer to the new queue initsize initial number of available element slots sizefac memory growing factor applied, if more element slots are needed
Definition at line 933 of file misc.c.
References BMSallocMemory, MAX, NULL, queueResize(), SCIP_ALLOC, SCIP_CALL, and SCIP_OKAY.
Referenced by createReopttree(), graph_trail(), reduce_daSlackPrune(), reduce_simple_sap(), reduce_sl(), and SCIPprobdataWriteSolution().
◆ SCIPqueueFree()
SCIP_EXPORT void SCIPqueueFree | ( | SCIP_QUEUE ** | queue | ) |
frees queue, but not the data elements themselves
- Parameters
-
queue pointer to a queue
Definition at line 957 of file misc.c.
References BMSfreeMemory, BMSfreeMemoryArray, and NULL.
Referenced by freeReoptTree(), graph_trail(), reduce_daSlackPrune(), reduce_simple_sap(), reduce_sl(), and SCIPprobdataWriteSolution().
◆ SCIPqueueClear()
SCIP_EXPORT void SCIPqueueClear | ( | SCIP_QUEUE * | queue | ) |
clears the queue, but doesn't free the data elements themselves
- Parameters
-
queue queue
Definition at line 968 of file misc.c.
References SCIP_Queue::firstfree, SCIP_Queue::firstused, and NULL.
Referenced by clearReoptnodes().
◆ SCIPqueueInsert()
SCIP_EXPORT SCIP_RETCODE SCIPqueueInsert | ( | SCIP_QUEUE * | queue, |
void * | elem | ||
) |
inserts pointer element at the end of the queue
- Parameters
-
queue queue elem element to be inserted
Definition at line 1019 of file misc.c.
References SCIP_Queue::firstfree, SCIP_Queue::firstused, NULL, SCIP_QUEUEELEMENT::ptr, queueCheckMarker(), queueCheckSize(), SCIP_CALL, SCIP_OKAY, SCIP_Queue::size, and SCIP_Queue::slots.
Referenced by graph_trail(), reduce_daSlackPrune(), reduce_simple_sap(), reduce_sl(), and SCIPprobdataWriteSolution().
◆ SCIPqueueInsertUInt()
SCIP_EXPORT SCIP_RETCODE SCIPqueueInsertUInt | ( | SCIP_QUEUE * | queue, |
unsigned int | elem | ||
) |
inserts unsigned integer element at the end of the queue
- Parameters
-
queue queue elem element to be inserted
Definition at line 1045 of file misc.c.
References SCIP_Queue::firstfree, SCIP_Queue::firstused, NULL, queueCheckMarker(), queueCheckSize(), SCIP_CALL, SCIP_OKAY, SCIP_Queue::size, SCIP_Queue::slots, and SCIP_QUEUEELEMENT::uinteger.
Referenced by clearReoptnodes(), createReopttree(), deleteChildrenBelow(), dryBranch(), reopttreeCheckMemory(), SCIPreoptDeleteNode(), and shrinkNode().
◆ SCIPqueueRemove()
SCIP_EXPORT void* SCIPqueueRemove | ( | SCIP_QUEUE * | queue | ) |
removes and returns the first element of the queue, or NULL if no element exists
removes and returns the first pointer element of the queue, or NULL if no element exists
- Parameters
-
queue queue
Definition at line 1070 of file misc.c.
References SCIP_Queue::firstfree, SCIP_Queue::firstused, NULL, SCIP_QUEUEELEMENT::ptr, SCIP_Queue::size, and SCIP_Queue::slots.
Referenced by graph_trail(), reduce_daSlackPrune(), reduce_simple_sap(), reduce_sl(), and SCIPprobdataWriteSolution().
◆ SCIPqueueRemoveUInt()
SCIP_EXPORT unsigned int SCIPqueueRemoveUInt | ( | SCIP_QUEUE * | queue | ) |
removes and returns the first unsigned integer element of the queue, or UNIT_MAX if no element exists
removes and returns the first unsigned integer element of the queue, or UINT_MAX if no element exists
- Parameters
-
queue queue
Definition at line 1104 of file misc.c.
References SCIP_Queue::firstfree, SCIP_Queue::firstused, NULL, SCIP_Queue::size, SCIP_Queue::slots, and SCIP_QUEUEELEMENT::uinteger.
Referenced by addNode(), SCIPreoptApplyCompression(), and SCIPreoptSplitRoot().
◆ SCIPqueueFirst()
SCIP_EXPORT void* SCIPqueueFirst | ( | SCIP_QUEUE * | queue | ) |
returns the first element of the queue without removing it, or NULL if no element exists
- Parameters
-
queue queue
Definition at line 1138 of file misc.c.
References SCIP_Queue::firstfree, SCIP_Queue::firstused, NULL, SCIP_QUEUEELEMENT::ptr, SCIP_Queue::size, and SCIP_Queue::slots.
◆ SCIPqueueFirstUInt()
SCIP_EXPORT unsigned int SCIPqueueFirstUInt | ( | SCIP_QUEUE * | queue | ) |
returns the first unsigned integer element of the queue without removing it, or UINT_MAX if no element exists
- Parameters
-
queue queue
Definition at line 1156 of file misc.c.
References SCIP_Queue::firstfree, SCIP_Queue::firstused, NULL, SCIP_Queue::size, SCIP_Queue::slots, and SCIP_QUEUEELEMENT::uinteger.
◆ SCIPqueueIsEmpty()
SCIP_EXPORT SCIP_Bool SCIPqueueIsEmpty | ( | SCIP_QUEUE * | queue | ) |
returns whether the queue is empty
- Parameters
-
queue queue
Definition at line 1174 of file misc.c.
References SCIP_Queue::firstfree, SCIP_Queue::firstused, NULL, and SCIP_Queue::size.
Referenced by graph_trail(), reduce_daSlackPrune(), reduce_simple_sap(), reduce_sl(), reopttreeCheckMemory(), and SCIPprobdataWriteSolution().
◆ SCIPqueueNElems()
SCIP_EXPORT int SCIPqueueNElems | ( | SCIP_QUEUE * | queue | ) |
returns the number of elements in the queue
- Parameters
-
queue queue
Definition at line 1187 of file misc.c.
References SCIP_Queue::firstfree, SCIP_Queue::firstused, NULL, and SCIP_Queue::size.
Referenced by clearReoptnodes(), createReoptnode(), and createReopttree().