miscellaneous methods
Definition in file misc.c.
#include <assert.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <ctype.h>
#include <math.h>
#include <strings.h>
#include "scip/def.h"
#include "scip/pub_message.h"
#include "scip/misc.h"
#include "scip/intervalarith.h"
#include "scip/pub_misc.h"
#include "scip/struct_misc.h"
#include "scip/sorttpl.c"
Go to the source code of this file.
Variables | |
static const SCIP_Real | studentt_quartiles [] |
static const SCIP_Real | studentt_quartilesabove [] |
static const int | studentt_maxdf = sizeof(studentt_quartiles)/(5 * sizeof(SCIP_Real)) |
static int | primetable [] |
static const int | primetablesize = sizeof(primetable)/sizeof(int) |
static const SCIP_Real | simplednoms [] |
static const SCIP_Real | scalars [] = {3.0, 5.0, 7.0, 9.0, 11.0, 13.0, 15.0, 17.0, 19.0} |
static const int | nscalars = 9 |
#define GMLNODEWIDTH 120.0 |
Definition at line 490 of file misc.c.
Referenced by SCIPgmlWriteNode(), and SCIPgmlWriteNodeWeight().
#define GMLNODEHEIGTH 30.0 |
Definition at line 491 of file misc.c.
Referenced by SCIPgmlWriteNode(), and SCIPgmlWriteNodeWeight().
#define GMLFONTSIZE 13 |
Definition at line 492 of file misc.c.
Referenced by SCIPgmlWriteArc(), SCIPgmlWriteEdge(), SCIPgmlWriteNode(), and SCIPgmlWriteNodeWeight().
#define GMLNODETYPE "rectangle" |
Definition at line 493 of file misc.c.
Referenced by SCIPgmlWriteNode(), and SCIPgmlWriteNodeWeight().
#define GMLNODEFILLCOLOR "#ff0000" |
Definition at line 494 of file misc.c.
Referenced by SCIPgmlWriteNode(), and SCIPgmlWriteNodeWeight().
#define GMLEDGECOLOR "black" |
Definition at line 495 of file misc.c.
Referenced by SCIPgmlWriteArc(), and SCIPgmlWriteEdge().
#define GMLNODEBORDERCOLOR "#000000" |
Definition at line 496 of file misc.c.
Referenced by SCIPgmlWriteNode(), and SCIPgmlWriteNodeWeight().
#define PQ_PARENT | ( | q | ) |
Definition at line 1274 of file misc.c.
Referenced by SCIPnodepqInsert(), SCIPpqueueDelPos(), and SCIPpqueueInsert().
#define PQ_LEFTCHILD | ( | p | ) |
Definition at line 1275 of file misc.c.
Referenced by SCIPnodepqBound(), and SCIPpqueueDelPos().
#define PQ_RIGHTCHILD | ( | p | ) |
Definition at line 1276 of file misc.c.
Referenced by SCIPnodepqBound(), and SCIPpqueueDelPos().
#define SCIP_MULTIHASH_MAXSIZE 33554431 /* 2^25 - 1*/ |
Definition at line 1841 of file misc.c.
Referenced by multihashResize().
#define SCIP_MULTIHASH_RESIZE_PERCENTAGE 65 |
Definition at line 1842 of file misc.c.
Referenced by SCIPmultihashInsert().
#define SCIP_MULTIHASH_GROW_FACTOR 1.31 |
Definition at line 1843 of file misc.c.
Referenced by multihashResize().
#define ELEM_DISTANCE | ( | pos | ) |
Definition at line 2409 of file misc.c.
Referenced by hashmapInsert(), hashmapLookup(), hashsetInsert(), hashtableInsert(), SCIPhashmapPrintStatistics(), SCIPhashsetExists(), SCIPhashsetRemove(), SCIPhashtablePrintStatistics(), SCIPhashtableRemove(), and SCIPhashtableRetrieve().
#define ELEM_DISTANCE | ( | pos | ) |
#define ELEM_DISTANCE | ( | pos | ) |
#define SORTTPL_NAMEEXT Ind |
Definition at line 5561 of file misc.c.
Referenced by SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), and SORTTPL_NAME().
#define SORTTPL_KEYTYPE int |
Definition at line 5562 of file misc.c.
Referenced by SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), and SORTTPL_NAME().
#define SORTTPL_FIELD1TYPE void* |
Definition at line 5577 of file misc.c.
Referenced by SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), and SORTTPL_NAME().
#define SORTTPL_FIELD2TYPE int |
Definition at line 5610 of file misc.c.
Referenced by SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), and SORTTPL_NAME().
#define SORTTPL_FIELD3TYPE int |
Definition at line 5628 of file misc.c.
Referenced by SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), and SORTTPL_NAME().
#define SORTTPL_FIELD4TYPE SCIP_Bool |
Definition at line 5638 of file misc.c.
Referenced by SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), and SORTTPL_NAME().
#define SORTTPL_FIELD2TYPE SCIP_Longint |
#define SORTTPL_FIELD2TYPE SCIP_Longint |
#define SORTTPL_FIELD2TYPE SCIP_Longint |
#define SORTTPL_FIELD1TYPE SCIP_Longint |
#define SORTTPL_FIELD5TYPE void* |
Definition at line 5871 of file misc.c.
Referenced by SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), SORTTPL_NAME(), and SORTTPL_NAME().
#define SORTTPL_FIELD2TYPE SCIP_Longint |
#define SORTTPL_FIELD2TYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_FIELD2TYPE SCIP_Longint |
#define SORTTPL_FIELD2TYPE SCIP_Longint |
#define SORTTPL_FIELD2TYPE SCIP_Longint |
#define SORTTPL_FIELD1TYPE SCIP_Longint |
#define SORTTPL_FIELD2TYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define SORTTPL_KEYTYPE SCIP_Longint |
#define STARTSUCCESSORSSIZE 5 |
Definition at line 7614 of file misc.c.
Referenced by ensureSuccessorsSize().
#define SCIP_RAND_MAX RAND_MAX |
Definition at line 9937 of file misc.c.
Referenced by getRandomInt(), getRandomInt(), and getRandomReal().
#define DEFAULT_XOR UINT32_C(362436000) |
Definition at line 10019 of file misc.c.
Referenced by SCIPrandomSetSeed().
#define DEFAULT_MWC UINT32_C(521288629) |
Definition at line 10020 of file misc.c.
Referenced by SCIPrandomSetSeed().
#define DEFAULT_CST UINT32_C(7654321) |
Definition at line 10021 of file misc.c.
Referenced by SCIPrandomSetSeed().
|
static |
recomputes regression coefficients from available observation data
regression | regression data structure |
Definition at line 288 of file misc.c.
References assert(), SCIP_Regression::corrcoef, EPSZ, SCIP_Regression::intercept, SCIP_Regression::meanx, SCIP_Regression::meany, SCIP_Regression::nobservations, SCIP_INVALID, SCIP_Regression::slope, SCIP_Regression::sumxy, SCIP_Regression::variancesumx, and SCIP_Regression::variancesumy.
Referenced by SCIPregressionAddObservation(), and SCIPregressionRemoveObservation().
|
static |
value | current value to be added to incremental statistics |
meanptr | pointer to value of current mean |
sumvarptr | pointer to the value of the current variance sum term |
nobservations | total number of observations |
add | TRUE if the value should be added, FALSE for removing it |
Definition at line 326 of file misc.c.
References assert(), MAX, NULL, SCIP_Bool, and SCIP_Real.
Referenced by SCIPregressionAddObservation(), and SCIPregressionRemoveObservation().
|
static |
calculate memory size for dynamically allocated arrays (copied from scip/set.c)
initsize | initial size of array |
growfac | growing factor of array |
num | minimum number of entries to store |
Definition at line 444 of file misc.c.
References assert(), MAX, and SCIP_Real.
Referenced by SCIPboolarrayExtend(), SCIPintarrayExtend(), SCIPptrarrayExtend(), and SCIPrealarrayExtend().
|
static |
resizes element memory to hold at least the given number of elements
queue | pointer to a queue |
minsize | minimal number of storable elements |
Definition at line 977 of file misc.c.
References assert(), BMSreallocMemoryArray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_Queue::size, SCIP_Queue::sizefac, and SCIP_Queue::slots.
Referenced by queueCheckSize(), and SCIPqueueCreate().
|
static |
reallocates slots if queue is necessary
queue | queue |
Definition at line 1043 of file misc.c.
References assert(), BMSmoveMemoryArray, SCIP_Queue::firstfree, SCIP_Queue::firstused, queueResize(), SCIP_CALL, SCIP_OKAY, SCIP_Queue::size, and SCIP_Queue::slots.
Referenced by SCIPqueueInsert(), and SCIPqueueInsertUInt().
|
static |
checks and adjusts marker of first free and first used slot
queue | queue |
Definition at line 1068 of file misc.c.
References SCIP_Queue::firstfree, SCIP_Queue::firstused, and SCIP_Queue::size.
Referenced by SCIPqueueInsert(), and SCIPqueueInsertUInt().
|
static |
resizes element memory to hold at least the given number of elements
pqueue | pointer to a priority queue |
minsize | minimal number of storable elements |
Definition at line 1281 of file misc.c.
References assert(), BMSreallocMemoryArray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_PQueue::size, SCIP_PQueue::sizefac, and SCIP_PQueue::slots.
Referenced by SCIPpqueueCreate(), and SCIPpqueueInsert().
|
static |
assign element to new slot in priority queue
pqueue | priority queue |
elem | element whose position changes |
oldpos | old position or -1 if elem is newly inserted |
newpos | new position |
Definition at line 1347 of file misc.c.
References NULL, and SCIP_PQueue::slots.
Referenced by SCIPpqueueDelPos(), and SCIPpqueueInsert().
|
static |
simple and fast 2-universal hash function using multiply and shift
input | key value |
Definition at line 1632 of file misc.c.
Referenced by hashmapLookup(), SCIPhashmapInsert(), SCIPhashmapInsertInt(), SCIPhashmapInsertReal(), SCIPhashmapSetImage(), SCIPhashmapSetImageInt(), SCIPhashmapSetImageReal(), SCIPhashtableInsert(), SCIPhashtableRemove(), SCIPhashtableRetrieve(), and SCIPhashtableSafeInsert().
|
static |
appends element to the multihash list
multihashlist | pointer to hash list |
blkmem | block memory |
element | element to append to the list |
Definition at line 1654 of file misc.c.
References assert(), BMSallocBlockMemory, SCIP_MultiHashList::element, SCIP_MultiHashList::next, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by multihashResize(), and SCIPmultihashInsert().
|
static |
frees a multihash list entry and all its successors
multihashlist | pointer to multihash list to free |
blkmem | block memory |
Definition at line 1676 of file misc.c.
References assert(), BMSfreeBlockMemory, SCIP_MultiHashList::next, and NULL.
Referenced by SCIPmultihashFree(), and SCIPmultihashRemoveAll().
|
static |
finds multihash list entry pointing to element with given key in the multihash list, returns NULL if not found
multihashlist | multihash list |
userptr | user pointer |
keyval | hash value of key |
key | key to retrieve |
Definition at line 1700 of file misc.c.
References assert(), SCIP_MultiHashList::element, SCIP_MultiHashList::next, NULL, and SCIP_DECL_HASHKEYEQ.
Referenced by multihashlistRetrieve(), multihashlistRetrieveNext(), and SCIPmultihashExists().
|
static |
retrieves element with given key from the multihash list, or NULL
multihashlist | hash list |
userptr | user pointer |
keyval | hash value of key |
key | key to retrieve |
Definition at line 1731 of file misc.c.
References assert(), SCIP_MultiHashList::element, h, multihashlistFind(), NULL, SCIP_DECL_HASHKEYEQ, and SCIPerrorMessage.
Referenced by SCIPmultihashRetrieve().
|
static |
retrieves element with given key from the multihash list, or NULL returns pointer to multihash table list entry
multihashlist | on input: hash list to search; on exit: hash list entry corresponding to element after retrieved one, or NULL |
userptr | user pointer |
keyval | hash value of key |
key | key to retrieve |
Definition at line 1781 of file misc.c.
References assert(), h, multihashlistFind(), NULL, and SCIP_DECL_HASHKEYEQ.
Referenced by SCIPmultihashRetrieveNext().
|
static |
removes element from the multihash list
multihashlist | pointer to hash list |
blkmem | block memory |
element | element to remove from the list |
Definition at line 1814 of file misc.c.
References assert(), BMSfreeBlockMemory, FALSE, SCIP_MultiHashList::next, NULL, SCIP_Bool, and TRUE.
Referenced by SCIPmultihashRemove().
|
static |
resizing(increasing) the given multihash
multihash | hash table |
Definition at line 1847 of file misc.c.
References assert(), SCIP_MultiHash::blkmem, BMSallocClearBlockMemoryArray, BMSfreeBlockMemoryArray, SCIP_MultiHashList::element, FALSE, SCIP_MultiHash::lists, MAX, MIN, multihashlistAppend(), SCIP_MultiHash::nelements, SCIP_MultiHashList::next, SCIP_MultiHash::nlists, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_Longint, SCIP_LONGINT_FORMAT, SCIP_MULTIHASH_GROW_FACTOR, SCIP_MULTIHASH_MAXSIZE, SCIP_OKAY, SCIPdebugMessage, SCIPmultihashGetLoad(), SCIPmultihashRemoveAll(), TRUE, and SCIP_MultiHash::userptr.
Referenced by SCIPmultihashInsert().
|
static |
inserts element in hash table (multiple inserts of same element overrides previous one)
hashtable | hash table |
element | element to insert into the table |
key | key of element |
hashval | hash value of element |
override | should element be overridden or an error be returned if already existing |
Definition at line 2413 of file misc.c.
References assert(), ELEM_DISTANCE, FALSE, SCIP_HashTable::hashes, SCIP_HashTable::mask, SCIP_HashTable::nelements, NULL, SCIP_Bool, SCIP_KEYALREADYEXISTING, SCIP_OKAY, SCIPswapPointers(), SCIP_HashTable::shift, SCIP_HashTable::slots, TRUE, and SCIP_HashTable::userptr.
Referenced by hashtableCheckLoad(), SCIPhashtableInsert(), and SCIPhashtableSafeInsert().
|
static |
check if the load factor of the hashtable is too high and rebuild if necessary
hashtable | hash table |
Definition at line 2497 of file misc.c.
References assert(), SCIP_HashTable::blkmem, BMSallocBlockMemoryArray, BMSallocClearBlockMemoryArray, BMSfreeBlockMemoryArray, FALSE, SCIP_HashTable::hashes, hashtableInsert(), i, SCIP_HashTable::mask, SCIP_HashTable::nelements, NULL, SCIP_ALLOC, SCIP_CALL_ABORT, SCIP_OKAY, SCIPswapPointers(), SCIP_HashTable::shift, SCIP_HashTable::slots, and SCIP_HashTable::userptr.
Referenced by SCIPhashtableInsert(), and SCIPhashtableSafeInsert().
|
static |
inserts element in hash table
hashmap | hash map |
origin | element to insert into the table |
image | key of element |
hashval | hash value of element |
override | should element be overridden or error be returned if already existing |
Definition at line 2905 of file misc.c.
References assert(), ELEM_DISTANCE, SCIP_HashMap::hashes, SCIP_HashMapEntry::image, SCIP_HashMap::mask, SCIP_HashMap::nelements, NULL, SCIP_HashMapEntry::origin, SCIP_Bool, SCIP_KEYALREADYEXISTING, SCIP_OKAY, SCIPswapPointers(), SCIP_HashMap::shift, SCIP_HashMap::slots, and TRUE.
Referenced by hashmapCheckLoad(), SCIPhashmapInsert(), SCIPhashmapInsertInt(), SCIPhashmapInsertReal(), SCIPhashmapSetImage(), SCIPhashmapSetImageInt(), and SCIPhashmapSetImageReal().
|
static |
lookup origin in the hashmap. If element is found returns true and the position of the element, otherwise returns FALSE.
hashmap | hash table |
origin | origin to lookup |
pos | pointer to store position of element, if exists |
Definition at line 2981 of file misc.c.
References assert(), ELEM_DISTANCE, FALSE, SCIP_HashMap::hashes, hashvalue(), SCIP_HashMap::mask, NULL, SCIP_HashMapEntry::origin, SCIP_Bool, SCIP_HashMap::shift, SCIP_HashMap::slots, and TRUE.
Referenced by SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPhashmapGetImageInt(), SCIPhashmapGetImageReal(), and SCIPhashmapRemove().
|
static |
check if the load factor of the hashmap is too high and rebuild if necessary
hashmap | hash table |
Definition at line 3026 of file misc.c.
References assert(), SCIP_HashMap::blkmem, BMSallocBlockMemoryArray, BMSallocClearBlockMemoryArray, BMSfreeBlockMemoryArray, FALSE, SCIP_HashMap::hashes, hashmapInsert(), i, SCIP_HashMap::mask, SCIP_HashMap::nelements, NULL, SCIP_ALLOC, SCIP_CALL_ABORT, SCIP_OKAY, SCIPswapPointers(), SCIP_HashMap::shift, and SCIP_HashMap::slots.
Referenced by SCIPhashmapInsert(), SCIPhashmapInsertInt(), SCIPhashmapInsertReal(), SCIPhashmapSetImage(), SCIPhashmapSetImageInt(), and SCIPhashmapSetImageReal().
|
static |
hashset | the hash set |
element | element to calculate position for |
Definition at line 3661 of file misc.c.
References SCIP_HashSet::shift.
Referenced by hashsetInsert(), SCIPhashsetExists(), SCIPhashsetPrintStatistics(), and SCIPhashsetRemove().
|
static |
hashset | hash set |
element | element to insert |
Definition at line 3670 of file misc.c.
References assert(), ELEM_DISTANCE, hashSetDesiredPos(), SCIP_HashSet::nelements, NULL, SCIPhashsetGetNSlots(), SCIPswapPointers(), SCIP_HashSet::slots, and TRUE.
Referenced by hashsetCheckLoad(), and SCIPhashsetInsert().
|
static |
check if the load factor of the hash set is too high and rebuild if necessary
hashset | hash set |
blkmem | block memory used to store hash set entries |
Definition at line 3721 of file misc.c.
References assert(), BMSallocClearBlockMemoryArray, BMSfreeBlockMemoryArray, hashsetInsert(), i, SCIP_HashSet::nelements, NULL, SCIP_ALLOC, SCIP_OKAY, SCIPhashsetGetNSlots(), SCIPswapPointers(), SCIP_HashSet::shift, and SCIP_HashSet::slots.
Referenced by SCIPhashsetInsert().
SCIP_RETCODE SCIPrealarrayCreate | ( | SCIP_REALARRAY ** | realarray, |
BMS_BLKMEM * | blkmem ) |
creates a dynamic array of real values
realarray | pointer to store the real array |
blkmem | block memory |
Definition at line 4033 of file misc.c.
References assert(), BMSallocBlockMemory, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPcreateRealarray(), SCIPrealarrayCopy(), SCIPsolCreate(), SCIPsolCreateOriginal(), SCIPsolCreatePartial(), and SCIPsolCreateUnknown().
SCIP_RETCODE SCIPrealarrayCopy | ( | SCIP_REALARRAY ** | realarray, |
BMS_BLKMEM * | blkmem, | ||
SCIP_REALARRAY * | sourcerealarray ) |
creates a copy of a dynamic array of real values
realarray | pointer to store the copied real array |
blkmem | block memory |
sourcerealarray | dynamic real array to copy |
Definition at line 4053 of file misc.c.
References assert(), BMSduplicateBlockMemoryArray, SCIP_RealArray::firstidx, SCIP_RealArray::maxusedidx, SCIP_RealArray::minusedidx, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPrealarrayCreate(), SCIP_RealArray::vals, and SCIP_RealArray::valssize.
Referenced by SCIPsolCopy().
SCIP_RETCODE SCIPrealarrayFree | ( | SCIP_REALARRAY ** | realarray | ) |
frees a dynamic array of real values
realarray | pointer to the real array |
Definition at line 4077 of file misc.c.
References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, NULL, and SCIP_OKAY.
Referenced by SCIPfreeRealarray(), and SCIPsolFree().
SCIP_RETCODE SCIPrealarrayExtend | ( | SCIP_REALARRAY * | realarray, |
int | arraygrowinit, | ||
SCIP_Real | arraygrowfac, | ||
int | minidx, | ||
int | maxidx ) |
extends dynamic array to be able to store indices from minidx to maxidx
realarray | dynamic real array |
arraygrowinit | initial size of array |
arraygrowfac | growing factor of array |
minidx | smallest index to allocate storage for |
maxidx | largest index to allocate storage for |
Definition at line 4091 of file misc.c.
References assert(), SCIP_RealArray::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArrayNull, calcGrowSize(), SCIP_RealArray::firstidx, i, MAX, SCIP_RealArray::maxusedidx, MIN, SCIP_RealArray::minusedidx, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIP_RealArray::vals, and SCIP_RealArray::valssize.
Referenced by SCIPextendRealarray(), SCIPlpSumRows(), and SCIPrealarraySetVal().
SCIP_RETCODE SCIPrealarrayClear | ( | SCIP_REALARRAY * | realarray | ) |
clears a dynamic real array
realarray | dynamic real array |
Definition at line 4246 of file misc.c.
References assert(), BMSclearMemoryArray, SCIP_RealArray::firstidx, SCIP_RealArray::maxusedidx, SCIP_RealArray::minusedidx, NULL, SCIP_OKAY, SCIPdebugMessage, SCIP_RealArray::vals, and SCIP_RealArray::valssize.
Referenced by SCIPclearRealarray(), and SCIPlpSumRows().
SCIP_Real SCIPrealarrayGetVal | ( | SCIP_REALARRAY * | realarray, |
int | idx ) |
gets value of entry in dynamic array
realarray | dynamic real array |
idx | array index to get value for |
Definition at line 4277 of file misc.c.
References assert(), SCIP_RealArray::firstidx, SCIP_RealArray::maxusedidx, NULL, SCIP_Real, SCIP_RealArray::vals, and SCIP_RealArray::valssize.
Referenced by SCIPgetRealarrayVal(), SCIPrealarrayIncVal(), solGetArrayVal(), and solIncArrayVal().
SCIP_RETCODE SCIPrealarraySetVal | ( | SCIP_REALARRAY * | realarray, |
int | arraygrowinit, | ||
SCIP_Real | arraygrowfac, | ||
int | idx, | ||
SCIP_Real | val ) |
sets value of entry in dynamic array
realarray | dynamic real array |
arraygrowinit | initial size of array |
arraygrowfac | growing factor of array |
idx | array index to set value for |
val | value to set array index to |
Definition at line 4298 of file misc.c.
References assert(), SCIP_RealArray::firstidx, MAX, SCIP_RealArray::maxusedidx, MIN, SCIP_RealArray::minusedidx, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPrealarrayExtend(), SCIP_RealArray::vals, and SCIP_RealArray::valssize.
Referenced by SCIPrealarrayIncVal(), SCIPsetRealarrayVal(), SCIPsolMarkPartial(), solIncArrayVal(), and solSetArrayVal().
SCIP_RETCODE SCIPrealarrayIncVal | ( | SCIP_REALARRAY * | realarray, |
int | arraygrowinit, | ||
SCIP_Real | arraygrowfac, | ||
int | idx, | ||
SCIP_Real | incval ) |
increases value of entry in dynamic array
realarray | dynamic real array |
arraygrowinit | initial size of array |
arraygrowfac | growing factor of array |
idx | array index to increase value for |
incval | value to increase array index |
Definition at line 4367 of file misc.c.
References SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPrealarrayGetVal(), and SCIPrealarraySetVal().
Referenced by SCIPincRealarrayVal(), SCIPlpSumRows(), and solIncArrayVal().
int SCIPrealarrayGetMinIdx | ( | SCIP_REALARRAY * | realarray | ) |
returns the minimal index of all stored non-zero elements
realarray | dynamic real array |
Definition at line 4385 of file misc.c.
References assert(), SCIP_RealArray::minusedidx, and NULL.
Referenced by SCIPgetRealarrayMinIdx().
int SCIPrealarrayGetMaxIdx | ( | SCIP_REALARRAY * | realarray | ) |
returns the maximal index of all stored non-zero elements
realarray | dynamic real array |
Definition at line 4395 of file misc.c.
References assert(), SCIP_RealArray::maxusedidx, and NULL.
Referenced by SCIPgetRealarrayMaxIdx().
SCIP_RETCODE SCIPintarrayCreate | ( | SCIP_INTARRAY ** | intarray, |
BMS_BLKMEM * | blkmem ) |
creates a dynamic array of int values
intarray | pointer to store the int array |
blkmem | block memory |
Definition at line 4405 of file misc.c.
References assert(), BMSallocBlockMemory, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPcreateIntarray(), and SCIPintarrayCopy().
SCIP_RETCODE SCIPintarrayCopy | ( | SCIP_INTARRAY ** | intarray, |
BMS_BLKMEM * | blkmem, | ||
SCIP_INTARRAY * | sourceintarray ) |
creates a copy of a dynamic array of int values
intarray | pointer to store the copied int array |
blkmem | block memory |
sourceintarray | dynamic int array to copy |
Definition at line 4425 of file misc.c.
References assert(), BMSduplicateBlockMemoryArray, SCIP_IntArray::firstidx, SCIP_IntArray::maxusedidx, SCIP_IntArray::minusedidx, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPintarrayCreate(), SCIP_IntArray::vals, and SCIP_IntArray::valssize.
SCIP_RETCODE SCIPintarrayFree | ( | SCIP_INTARRAY ** | intarray | ) |
frees a dynamic array of int values
intarray | pointer to the int array |
Definition at line 4448 of file misc.c.
References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, NULL, and SCIP_OKAY.
Referenced by SCIPfreeIntarray().
SCIP_RETCODE SCIPintarrayExtend | ( | SCIP_INTARRAY * | intarray, |
int | arraygrowinit, | ||
SCIP_Real | arraygrowfac, | ||
int | minidx, | ||
int | maxidx ) |
extends dynamic array to be able to store indices from minidx to maxidx
intarray | dynamic int array |
arraygrowinit | initial size of array |
arraygrowfac | growing factor of array |
minidx | smallest index to allocate storage for |
maxidx | largest index to allocate storage for |
Definition at line 4462 of file misc.c.
References assert(), SCIP_IntArray::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArrayNull, calcGrowSize(), SCIP_IntArray::firstidx, i, MAX, SCIP_IntArray::maxusedidx, MIN, SCIP_IntArray::minusedidx, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIP_IntArray::vals, and SCIP_IntArray::valssize.
Referenced by SCIPextendIntarray(), and SCIPintarraySetVal().
SCIP_RETCODE SCIPintarrayClear | ( | SCIP_INTARRAY * | intarray | ) |
clears a dynamic int array
intarray | dynamic int array |
Definition at line 4617 of file misc.c.
References assert(), BMSclearMemoryArray, SCIP_IntArray::firstidx, SCIP_IntArray::maxusedidx, SCIP_IntArray::minusedidx, NULL, SCIP_OKAY, SCIPdebugMessage, SCIP_IntArray::vals, and SCIP_IntArray::valssize.
Referenced by SCIPclearIntarray().
int SCIPintarrayGetVal | ( | SCIP_INTARRAY * | intarray, |
int | idx ) |
gets value of entry in dynamic array
intarray | dynamic int array |
idx | array index to get value for |
Definition at line 4648 of file misc.c.
References assert(), SCIP_IntArray::firstidx, SCIP_IntArray::maxusedidx, NULL, SCIP_IntArray::vals, and SCIP_IntArray::valssize.
Referenced by SCIPgetIntarrayVal(), and SCIPintarrayIncVal().
SCIP_RETCODE SCIPintarraySetVal | ( | SCIP_INTARRAY * | intarray, |
int | arraygrowinit, | ||
SCIP_Real | arraygrowfac, | ||
int | idx, | ||
int | val ) |
sets value of entry in dynamic array
intarray | dynamic int array |
arraygrowinit | initial size of array |
arraygrowfac | growing factor of array |
idx | array index to set value for |
val | value to set array index to |
Definition at line 4669 of file misc.c.
References assert(), SCIP_IntArray::firstidx, MAX, SCIP_IntArray::maxusedidx, MIN, SCIP_IntArray::minusedidx, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPintarrayExtend(), SCIP_IntArray::vals, and SCIP_IntArray::valssize.
Referenced by SCIPintarrayIncVal(), and SCIPsetIntarrayVal().
SCIP_RETCODE SCIPintarrayIncVal | ( | SCIP_INTARRAY * | intarray, |
int | arraygrowinit, | ||
SCIP_Real | arraygrowfac, | ||
int | idx, | ||
int | incval ) |
increases value of entry in dynamic array
intarray | dynamic int array |
arraygrowinit | initial size of array |
arraygrowfac | growing factor of array |
idx | array index to increase value for |
incval | value to increase array index |
Definition at line 4737 of file misc.c.
References SCIP_Real, SCIPintarrayGetVal(), and SCIPintarraySetVal().
Referenced by SCIPincIntarrayVal().
int SCIPintarrayGetMinIdx | ( | SCIP_INTARRAY * | intarray | ) |
returns the minimal index of all stored non-zero elements
intarray | dynamic int array |
Definition at line 4749 of file misc.c.
References assert(), SCIP_IntArray::minusedidx, and NULL.
Referenced by SCIPgetIntarrayMinIdx().
int SCIPintarrayGetMaxIdx | ( | SCIP_INTARRAY * | intarray | ) |
returns the maximal index of all stored non-zero elements
intarray | dynamic int array |
Definition at line 4759 of file misc.c.
References assert(), SCIP_IntArray::maxusedidx, and NULL.
Referenced by SCIPgetIntarrayMaxIdx().
SCIP_RETCODE SCIPboolarrayCreate | ( | SCIP_BOOLARRAY ** | boolarray, |
BMS_BLKMEM * | blkmem ) |
creates a dynamic array of bool values
boolarray | pointer to store the bool array |
blkmem | block memory |
Definition at line 4770 of file misc.c.
References assert(), BMSallocBlockMemory, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPboolarrayCopy(), SCIPcreateBoolarray(), SCIPsolCreate(), SCIPsolCreateOriginal(), SCIPsolCreatePartial(), and SCIPsolCreateUnknown().
SCIP_RETCODE SCIPboolarrayCopy | ( | SCIP_BOOLARRAY ** | boolarray, |
BMS_BLKMEM * | blkmem, | ||
SCIP_BOOLARRAY * | sourceboolarray ) |
creates a copy of a dynamic array of bool values
boolarray | pointer to store the copied bool array |
blkmem | block memory |
sourceboolarray | dynamic bool array to copy |
Definition at line 4790 of file misc.c.
References assert(), BMSduplicateBlockMemoryArray, SCIP_BoolArray::firstidx, SCIP_BoolArray::maxusedidx, SCIP_BoolArray::minusedidx, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPboolarrayCreate(), SCIP_BoolArray::vals, and SCIP_BoolArray::valssize.
Referenced by SCIPsolCopy().
SCIP_RETCODE SCIPboolarrayFree | ( | SCIP_BOOLARRAY ** | boolarray | ) |
frees a dynamic array of bool values
boolarray | pointer to the bool array |
Definition at line 4814 of file misc.c.
References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, NULL, and SCIP_OKAY.
Referenced by SCIPfreeBoolarray(), and SCIPsolFree().
SCIP_RETCODE SCIPboolarrayExtend | ( | SCIP_BOOLARRAY * | boolarray, |
int | arraygrowinit, | ||
SCIP_Real | arraygrowfac, | ||
int | minidx, | ||
int | maxidx ) |
extends dynamic array to be able to store indices from minidx to maxidx
boolarray | dynamic bool array |
arraygrowinit | initial size of array |
arraygrowfac | growing factor of array |
minidx | smallest index to allocate storage for |
maxidx | largest index to allocate storage for |
Definition at line 4828 of file misc.c.
References assert(), SCIP_BoolArray::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArrayNull, BMSmoveMemoryArray, calcGrowSize(), FALSE, SCIP_BoolArray::firstidx, i, MAX, SCIP_BoolArray::maxusedidx, MIN, SCIP_BoolArray::minusedidx, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIP_BoolArray::vals, and SCIP_BoolArray::valssize.
Referenced by SCIPboolarraySetVal(), and SCIPextendBoolarray().
SCIP_RETCODE SCIPboolarrayClear | ( | SCIP_BOOLARRAY * | boolarray | ) |
clears a dynamic bool array
boolarray | dynamic bool array |
Definition at line 4985 of file misc.c.
References assert(), BMSclearMemoryArray, SCIP_BoolArray::firstidx, SCIP_BoolArray::maxusedidx, SCIP_BoolArray::minusedidx, NULL, SCIP_OKAY, SCIPdebugMessage, SCIP_BoolArray::vals, and SCIP_BoolArray::valssize.
Referenced by SCIPclearBoolarray(), and solClearArrays().
SCIP_Bool SCIPboolarrayGetVal | ( | SCIP_BOOLARRAY * | boolarray, |
int | idx ) |
gets value of entry in dynamic array
boolarray | dynamic bool array |
idx | array index to get value for |
Definition at line 5016 of file misc.c.
References assert(), FALSE, SCIP_BoolArray::firstidx, SCIP_BoolArray::maxusedidx, NULL, SCIP_Bool, SCIP_BoolArray::vals, and SCIP_BoolArray::valssize.
Referenced by SCIPgetBoolarrayVal(), SCIPsolGetVal(), SCIPsolIncVal(), SCIPsolRound(), SCIPsolSetVal(), solGetArrayVal(), solIncArrayVal(), and solUnlinkVar().
SCIP_RETCODE SCIPboolarraySetVal | ( | SCIP_BOOLARRAY * | boolarray, |
int | arraygrowinit, | ||
SCIP_Real | arraygrowfac, | ||
int | idx, | ||
SCIP_Bool | val ) |
sets value of entry in dynamic array
boolarray | dynamic bool array |
arraygrowinit | initial size of array |
arraygrowfac | growing factor of array |
idx | array index to set value for |
val | value to set array index to |
Definition at line 5037 of file misc.c.
References assert(), FALSE, SCIP_BoolArray::firstidx, MAX, SCIP_BoolArray::maxusedidx, MIN, SCIP_BoolArray::minusedidx, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPboolarrayExtend(), SCIPdebugMessage, SCIP_BoolArray::vals, and SCIP_BoolArray::valssize.
Referenced by SCIPsetBoolarrayVal(), SCIPsolMarkPartial(), solIncArrayVal(), and solSetArrayVal().
int SCIPboolarrayGetMinIdx | ( | SCIP_BOOLARRAY * | boolarray | ) |
returns the minimal index of all stored non-zero elements
boolarray | dynamic bool array |
Definition at line 5105 of file misc.c.
References assert(), SCIP_BoolArray::minusedidx, and NULL.
Referenced by SCIPgetBoolarrayMinIdx().
int SCIPboolarrayGetMaxIdx | ( | SCIP_BOOLARRAY * | boolarray | ) |
returns the maximal index of all stored non-zero elements
boolarray | dynamic bool array |
Definition at line 5115 of file misc.c.
References assert(), SCIP_BoolArray::maxusedidx, and NULL.
Referenced by SCIPgetBoolarrayMaxIdx().
SCIP_RETCODE SCIPptrarrayCreate | ( | SCIP_PTRARRAY ** | ptrarray, |
BMS_BLKMEM * | blkmem ) |
creates a dynamic array of pointer values
ptrarray | pointer to store the ptr array |
blkmem | block memory |
Definition at line 5126 of file misc.c.
References assert(), BMSallocBlockMemory, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPcreatePtrarray(), and SCIPptrarrayCopy().
SCIP_RETCODE SCIPptrarrayCopy | ( | SCIP_PTRARRAY ** | ptrarray, |
BMS_BLKMEM * | blkmem, | ||
SCIP_PTRARRAY * | sourceptrarray ) |
creates a copy of a dynamic array of pointer values
ptrarray | pointer to store the copied ptr array |
blkmem | block memory |
sourceptrarray | dynamic ptr array to copy |
Definition at line 5146 of file misc.c.
References assert(), BMSduplicateBlockMemoryArray, SCIP_PtrArray::firstidx, SCIP_PtrArray::maxusedidx, SCIP_PtrArray::minusedidx, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPptrarrayCreate(), SCIP_PtrArray::vals, and SCIP_PtrArray::valssize.
SCIP_RETCODE SCIPptrarrayFree | ( | SCIP_PTRARRAY ** | ptrarray | ) |
frees a dynamic array of pointer values
ptrarray | pointer to the ptr array |
Definition at line 5169 of file misc.c.
References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, NULL, and SCIP_OKAY.
Referenced by SCIPfreePtrarray().
SCIP_RETCODE SCIPptrarrayExtend | ( | SCIP_PTRARRAY * | ptrarray, |
int | arraygrowinit, | ||
SCIP_Real | arraygrowfac, | ||
int | minidx, | ||
int | maxidx ) |
extends dynamic array to be able to store indices from minidx to maxidx
ptrarray | dynamic ptr array |
arraygrowinit | initial size of array |
arraygrowfac | growing factor of array |
minidx | smallest index to allocate storage for |
maxidx | largest index to allocate storage for |
Definition at line 5183 of file misc.c.
References assert(), SCIP_PtrArray::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArrayNull, calcGrowSize(), SCIP_PtrArray::firstidx, i, MAX, SCIP_PtrArray::maxusedidx, MIN, SCIP_PtrArray::minusedidx, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIP_PtrArray::vals, and SCIP_PtrArray::valssize.
Referenced by SCIPextendPtrarray(), and SCIPptrarraySetVal().
SCIP_RETCODE SCIPptrarrayClear | ( | SCIP_PTRARRAY * | ptrarray | ) |
clears a dynamic pointer array
ptrarray | dynamic ptr array |
Definition at line 5338 of file misc.c.
References assert(), BMSclearMemoryArray, SCIP_PtrArray::firstidx, SCIP_PtrArray::maxusedidx, SCIP_PtrArray::minusedidx, NULL, SCIP_OKAY, SCIPdebugMessage, SCIP_PtrArray::vals, and SCIP_PtrArray::valssize.
Referenced by SCIPclearPtrarray().
void * SCIPptrarrayGetVal | ( | SCIP_PTRARRAY * | ptrarray, |
int | idx ) |
gets value of entry in dynamic array
ptrarray | dynamic ptr array |
idx | array index to get value for |
Definition at line 5369 of file misc.c.
References assert(), SCIP_PtrArray::firstidx, SCIP_PtrArray::maxusedidx, NULL, SCIP_PtrArray::vals, and SCIP_PtrArray::valssize.
Referenced by SCIPgetPtrarrayVal().
SCIP_RETCODE SCIPptrarraySetVal | ( | SCIP_PTRARRAY * | ptrarray, |
int | arraygrowinit, | ||
SCIP_Real | arraygrowfac, | ||
int | idx, | ||
void * | val ) |
sets value of entry in dynamic array
ptrarray | dynamic ptr array |
arraygrowinit | initial size of array |
arraygrowfac | growing factor of array |
idx | array index to set value for |
val | value to set array index to |
Definition at line 5390 of file misc.c.
References assert(), SCIP_PtrArray::firstidx, MAX, SCIP_PtrArray::maxusedidx, MIN, SCIP_PtrArray::minusedidx, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPptrarrayExtend(), SCIP_PtrArray::vals, and SCIP_PtrArray::valssize.
Referenced by SCIPsetPtrarrayVal().
int SCIPptrarrayGetMinIdx | ( | SCIP_PTRARRAY * | ptrarray | ) |
returns the minimal index of all stored non-zero elements
ptrarray | dynamic ptr array |
Definition at line 5458 of file misc.c.
References assert(), SCIP_PtrArray::minusedidx, and NULL.
Referenced by SCIPgetPtrarrayMinIdx().
int SCIPptrarrayGetMaxIdx | ( | SCIP_PTRARRAY * | ptrarray | ) |
returns the maximal index of all stored non-zero elements
ptrarray | dynamic ptr array |
Definition at line 5468 of file misc.c.
References assert(), SCIP_PtrArray::maxusedidx, and NULL.
Referenced by SCIPgetPtrarrayMaxIdx().
|
static |
helper method to create a profile
profile | pointer to store the resource profile |
capacity | resource capacity |
Definition at line 6736 of file misc.c.
References BMSallocMemory, BMSallocMemoryArray, BMSclearMemory, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPprofileCreate().
|
static |
profile | resource profile to insert the time point |
neededsize | needed size |
Definition at line 6899 of file misc.c.
References SCIP_Profile::arraysize, assert(), BMSreallocMemoryArray, SCIP_Profile::loads, SCIP_ALLOC, SCIP_OKAY, and SCIP_Profile::timepoints.
Referenced by profileInsertTimepoint().
|
static |
inserts the given time point into the resource profile if it this time point does not exists yet; returns its position in the time point array
profile | resource profile to insert the time point |
timepoint | time point to insert |
pos | pointer to store the insert position |
Definition at line 6922 of file misc.c.
References SCIP_Profile::arraysize, assert(), ensureProfileSize(), i, SCIP_Profile::loads, SCIP_Profile::ntimepoints, NULL, SCIP_CALL, SCIP_OKAY, SCIPprofileFindLeft(), SCIPsortedvecInsertIntInt(), and SCIP_Profile::timepoints.
Referenced by profileUpdate().
|
static |
updates the resource profile due to inserting of a core
profile | resource profile to update |
left | left side of core interval |
right | right side of core interval |
demand | demand of the core |
pos | pointer to store the first position were it gets infeasible |
infeasible | pointer to store if the update is infeasible |
Definition at line 6963 of file misc.c.
References SCIP_Profile::arraysize, assert(), SCIP_Profile::capacity, FALSE, i, SCIP_Profile::loads, SCIP_Profile::ntimepoints, NULL, profileInsertTimepoint(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIP_Profile::timepoints, and TRUE.
Referenced by SCIPprofileDeleteCore(), and SCIPprofileInsertCore().
|
static |
returns TRUE if the core (given by its demand and during) can be inserted at the given time point; otherwise FALSE
profile | resource profile to use |
pos | pointer to store the position in the profile to start the serch |
lst | latest start time |
duration | duration of the core |
demand | demand of the core |
infeasible | pointer store if the corer cannot be inserted |
Definition at line 7085 of file misc.c.
References assert(), SCIP_Profile::capacity, FALSE, SCIP_Profile::loads, SCIP_Profile::ntimepoints, NULL, SCIP_Bool, SCIPdebugMessage, SCIP_Profile::timepoints, and TRUE.
Referenced by SCIPprofileGetEarliestFeasibleStart().
|
static |
returns TRUE if the core (given by its demand and during) can be inserted at the given time point; otherwise FALSE
profile | resource profile to use |
pos | pointer to store the position in the profile to start the search |
ect | earliest completion time |
duration | duration of the core |
demand | demand of the core |
infeasible | pointer store if the corer cannot be inserted |
Definition at line 7235 of file misc.c.
References assert(), SCIP_Profile::capacity, FALSE, SCIP_Profile::loads, SCIP_Profile::ntimepoints, NULL, SCIP_Bool, SCIPdebugMessage, SCIP_Profile::timepoints, and TRUE.
Referenced by SCIPprofileGetLatestFeasibleStart().
SCIP_RETCODE SCIPdigraphCreate | ( | SCIP_DIGRAPH ** | digraph, |
BMS_BLKMEM * | blkmem, | ||
int | nnodes ) |
creates directed graph structure
digraph | pointer to store the created directed graph |
blkmem | block memory to store the data |
nnodes | number of nodes |
Definition at line 7380 of file misc.c.
References assert(), BMSallocBlockMemory, BMSallocClearBlockMemoryArray, FALSE, nnodes, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPcreateDigraph().
SCIP_RETCODE SCIPdigraphCopy | ( | SCIP_DIGRAPH ** | targetdigraph, |
SCIP_DIGRAPH * | sourcedigraph, | ||
BMS_BLKMEM * | targetblkmem ) |
copies directed graph structure
targetdigraph | pointer to store the copied directed graph |
sourcedigraph | source directed graph |
targetblkmem | block memory to store the target block memory, or NULL to use the same the same block memory as used for the sourcedigraph |
Definition at line 7457 of file misc.c.
References SCIP_Digraph::arcdata, SCIP_Digraph::articulations, SCIP_Digraph::articulationscheck, assert(), SCIP_Digraph::blkmem, BMSallocBlockMemory, BMSallocClearBlockMemoryArray, BMSduplicateBlockMemoryArray, SCIP_Digraph::components, SCIP_Digraph::componentstarts, FALSE, i, SCIP_Digraph::narticulations, SCIP_Digraph::ncomponents, nnodes, SCIP_Digraph::nnodes, SCIP_Digraph::nodedata, SCIP_Digraph::nsuccessors, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_OKAY, SCIP_Digraph::successors, and TRUE.
Referenced by SCIPcopyDigraph().
|
static |
ensures that successors array of one node in a directed graph is big enough
digraph | directed graph |
idx | index for which the size is ensured |
newsize | needed size |
Definition at line 7618 of file misc.c.
References SCIP_Digraph::arcdata, assert(), SCIP_Digraph::blkmem, BMSallocBlockMemoryArray, BMSreallocBlockMemoryArray, MAX, nnodes, NULL, SCIP_ALLOC, SCIP_OKAY, STARTSUCCESSORSSIZE, SCIP_Digraph::successors, and SCIP_Digraph::successorssize.
Referenced by SCIPdigraphAddArc(), and SCIPdigraphAddArcSafe().
|
static |
performs depth-first-search in the given directed graph from the given start node
digraph | directed graph |
startnode | node to start the depth-first-search |
visited | array to store for each node, whether it was already visited |
dfsstack | array of size number of nodes to store the stack; only needed for performance reasons |
stackadjvisited | array of size number of nodes to store the number of adjacent nodes already visited for each node on the stack; only needed for performance reasons |
dfsnodes | array of nodes that can be reached starting at startnode, in reverse dfs order |
ndfsnodes | pointer to store number of nodes that can be reached starting at startnode |
Definition at line 7857 of file misc.c.
References assert(), FALSE, nnodes, SCIP_Digraph::nsuccessors, NULL, SCIP_Bool, SCIP_Digraph::successors, and TRUE.
Referenced by SCIPdigraphComputeUndirectedComponents(), and SCIPdigraphTopoSortComponents().
|
static |
checks for articulation points in a given directed graph through a recursive depth-first-search. starts from a given start node and keeps track of the nodes' discovery time in search for back edges.
digraph | directed graph |
startnode | node to start the depth-first-search |
visited | array to store for each node, whether it was already visited |
tdisc | array of size number of nodes to store each node's discovery time |
mindisc | array of size number of nodes to store the discovery time of the earliest discovered vertex to which startnode (or any node in the subtree rooted at it) is having a back edge |
parent | array to store the parent of each node in the DFS tree |
articulationflag | array to mark whether a node is identified as an articulation point |
time | current discovery time in the DFS |
Definition at line 7936 of file misc.c.
References assert(), FALSE, findArticulationPointsUtil(), MIN, SCIP_Digraph::narticulations, nnodes, NULL, SCIP_Bool, SCIPdigraphGetNSuccessors(), SCIPdigraphGetSuccessors(), and TRUE.
Referenced by findArticulationPointsUtil(), and SCIPdigraphGetArticulationPoints().
|
static |
digraph | directed graph |
v | node to start the algorithm |
lowlink | array to store lowlink values |
dfsidx | array to store dfs indices |
stack | array to store a stack |
stacksize | pointer to store the size of the stack |
unprocessed | array to store which node is unprocessed yet |
nodeinstack | array to store which nodes are in the stack |
maxdfs | pointer to store index for DFS |
strongcomponents | array to store for each node the strongly connected component to which it belongs (components are numbered 0 to nstrongcomponents - 1); |
nstrongcomponents | pointer to store the number of computed components so far |
strongcompstartidx | array to store the start index of the computed components |
nstorednodes | pointer to store the number of already stored nodes |
Definition at line 8324 of file misc.c.
References assert(), FALSE, i, MIN, nnodes, SCIP_Digraph::nnodes, SCIP_Digraph::nsuccessors, NULL, SCIP_Bool, SCIP_Digraph::successors, tarjan(), TRUE, and w.
Referenced by SCIPdigraphComputeDirectedComponents(), and tarjan().
|
static |
creates a node for a binary tree
tree | binary tree |
node | pointer to store the created node |
Definition at line 8664 of file misc.c.
References SCIP_Bt::blkmem, BMSallocBlockMemory, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPbtnodeCreate().
|
static |
frees a tree leaf
tree | binary tree |
node | pointer to node which has to be freed |
Definition at line 8703 of file misc.c.
References assert(), SCIP_Bt::blkmem, BMSfreeBlockMemory, and NULL.
Referenced by SCIPbtnodeFree().
|
static |
prints the rooted subtree of the given binary tree node in GML format into the given file
node | binary tree node |
file | file to write to |
nnodes | pointer to count the number of nodes |
Definition at line 8996 of file misc.c.
References assert(), btPrintSubtree(), nnodes, NULL, SCIP_MAXSTRLEN, SCIPbtnodeGetLeftchild(), SCIPbtnodeGetRightchild(), SCIPgmlWriteArc(), SCIPgmlWriteNode(), and SCIPsnprintf().
Referenced by btPrintSubtree(), and SCIPbtPrintGml().
|
static |
checks, whether the given scalar scales the given value to an integral number with error in the given bounds
val | value that should be scaled to an integral value |
scalar | scalar that should be tried |
mindelta | minimal relative allowed difference of scaled coefficient s*c and integral i |
maxdelta | maximal relative allowed difference of scaled coefficient s*c and integral i |
Definition at line 9532 of file misc.c.
References assert(), SCIP_Bool, SCIP_Real, and SCIPrelDiff().
Referenced by SCIPcalcIntegralScalar().
|
static |
returns a random number between 0 and SCIP_RAND_MAX
seedp | pointer to seed value |
Definition at line 9941 of file misc.c.
Referenced by getRandomInt(), and getRandomReal().
|
static |
returns a random integer between minrandval and maxrandval
minrandval | minimal value to return |
maxrandval | maximal value to return |
seedp | pointer to seed value |
Definition at line 9952 of file misc.c.
References assert(), getRand(), SCIP_RAND_MAX, and SCIP_Real.
Referenced by SCIPgetRandomInt(), SCIPgetRandomSubset(), SCIPpermuteArray(), and SCIPpermuteIntArray().
returns a random real between minrandval and maxrandval
minrandval | minimal value to return |
maxrandval | maximal value to return |
seedp | pointer to seed value |
Definition at line 9972 of file misc.c.
References assert(), getRand(), SCIP_RAND_MAX, and SCIP_Real.
Referenced by SCIPgetRandomReal().
void SCIPrandomSetSeed | ( | SCIP_RANDNUMGEN * | randnumgen, |
unsigned int | initseed ) |
initializes a random number generator with a given start seed
randnumgen | random number generator |
initseed | initial random seed |
Definition at line 10025 of file misc.c.
References assert(), SCIP_RandNumGen::cst_seed, DEFAULT_CST, DEFAULT_MWC, DEFAULT_SEED, DEFAULT_XOR, MAX, SCIP_RandNumGen::mwc_seed, NULL, SCIPhashTwo, SCIP_RandNumGen::seed, and SCIP_RandNumGen::xor_seed.
Referenced by SCIPbanditReset(), SCIPdivesetReset(), SCIPrandomCreate(), and SCIPsetRandomSeed().
|
static |
returns a random number between 0 and UINT32_MAX
implementation of KISS random number generator developed by George Marsaglia. KISS is combination of three different random number generators:
KISS has a period of 2^123 and passes all statistical test part of BigCrush-Test of TestU01 [1].
[1] http://dl.acm.org/citation.cfm?doid=1268776.1268777
randnumgen | random number generator |
Definition at line 10056 of file misc.c.
References SCIP_RandNumGen::cst_seed, SCIP_RandNumGen::mwc_seed, SCIP_RandNumGen::seed, and SCIP_RandNumGen::xor_seed.
Referenced by SCIPrandomGetInt(), and SCIPrandomGetReal().
SCIP_RETCODE SCIPrandomCreate | ( | SCIP_RANDNUMGEN ** | randnumgen, |
BMS_BLKMEM * | blkmem, | ||
unsigned int | initialseed ) |
creates and initializes a random number generator
randnumgen | random number generator |
blkmem | block memory |
initialseed | initial random seed |
Definition at line 10079 of file misc.c.
References assert(), BMSallocBlockMemory, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPrandomSetSeed().
Referenced by SCIPbanditCreate(), SCIPcreateRandom(), SCIPdivesetCreate(), SCIPreoptCreate(), and SCIPsepastoreCreate().
void SCIPrandomFree | ( | SCIP_RANDNUMGEN ** | randnumgen, |
BMS_BLKMEM * | blkmem ) |
frees a random number generator
randnumgen | random number generator |
blkmem | block memory |
Definition at line 10095 of file misc.c.
References assert(), BMSfreeBlockMemory, and NULL.
Referenced by divesetFree(), SCIPbanditFree(), SCIPfreeRandom(), SCIPreoptFree(), and SCIPsepastoreFree().
SCIP_RETCODE SCIPdisjointsetCreate | ( | SCIP_DISJOINTSET ** | djset, |
BMS_BLKMEM * | blkmem, | ||
int | ncomponents ) |
creates a disjoint set (union find) structure djset
for ncomponents
many components (of size one)
djset | disjoint set (union find) data structure |
blkmem | block memory |
ncomponents | number of components |
Definition at line 11260 of file misc.c.
References assert(), BMSallocBlockMemory, BMSallocBlockMemoryArray, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdisjointsetClear().
Referenced by SCIPcliquetableComputeCliqueComponents(), SCIPcomputeComponentsSym(), and SCIPcreateDisjointset().
void SCIPdisjointsetFree | ( | SCIP_DISJOINTSET ** | djset, |
BMS_BLKMEM * | blkmem ) |
frees the disjoint set (union find) data structure
djset | pointer to disjoint set (union find) data structure |
blkmem | block memory |
Definition at line 11378 of file misc.c.
References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArray, NULL, SCIP_DisjointSet::parents, SCIP_DisjointSet::size, and SCIP_DisjointSet::sizes.
Referenced by SCIPcliquetableComputeCliqueComponents(), SCIPcliquetableFree(), SCIPcomputeComponentsSym(), and SCIPfreeDisjointset().
|
static |
< contains all critical values for a one-sided two sample t-test up to 15 degrees of freedom a critical value represents a threshold for rejecting the null-hypothesis in hypothesis testing at a certain confidence level;
access through method SCIPstudentTGetCriticalValue()
source: German Wikipedia
for confidence levels c = 0.75 0.875 0.90 0.95 0.975 (one-sided) 0.50 0.750 0.80 0.90 0.950 (two-sided) critical values for higher degrees of freedom of Student-T distribution for the same error probabilities; infact, these are critical values of the standard normal distribution with mean 0 and variance 1
Definition at line 80 of file misc.c.
Referenced by SCIPstudentTGetCriticalValue().
|
static |
Definition at line 101 of file misc.c.
Referenced by SCIPnormalGetCriticalValue(), and SCIPstudentTGetCriticalValue().
|
static |
the maximum degrees of freedom represented before switching to normal approximation
Definition at line 106 of file misc.c.
Referenced by SCIPstudentTGetCriticalValue().
|
static |
table of some prime numbers
Definition at line 1576 of file misc.c.
Referenced by SCIPcalcMultihashSize().
|
static |
Definition at line 1628 of file misc.c.
Referenced by SCIPcalcMultihashSize().
|
static |
Definition at line 9391 of file misc.c.
Referenced by SCIPrealToRational().
|
static |