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 "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 SQRTOFTWO 1.4142136 |
the square root of 2 with sufficient precision 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)
Definition at line 49 of file misc.c.
Referenced by SCIPnormalCDF().
#define GMLNODEWIDTH 120.0 |
Definition at line 475 of file misc.c.
Referenced by SCIPgmlWriteNode(), and SCIPgmlWriteNodeWeight().
#define GMLNODEHEIGTH 30.0 |
Definition at line 476 of file misc.c.
Referenced by SCIPgmlWriteNode(), and SCIPgmlWriteNodeWeight().
#define GMLFONTSIZE 13 |
Definition at line 477 of file misc.c.
Referenced by SCIPgmlWriteArc(), SCIPgmlWriteEdge(), SCIPgmlWriteNode(), and SCIPgmlWriteNodeWeight().
#define GMLNODETYPE "rectangle" |
Definition at line 478 of file misc.c.
Referenced by SCIPgmlWriteNode(), and SCIPgmlWriteNodeWeight().
#define GMLNODEFILLCOLOR "#ff0000" |
Definition at line 479 of file misc.c.
Referenced by SCIPgmlWriteNode(), and SCIPgmlWriteNodeWeight().
#define GMLEDGECOLOR "black" |
Definition at line 480 of file misc.c.
Referenced by SCIPgmlWriteArc(), and SCIPgmlWriteEdge().
#define GMLNODEBORDERCOLOR "#000000" |
Definition at line 481 of file misc.c.
Referenced by SCIPgmlWriteNode(), and SCIPgmlWriteNodeWeight().
#define PQ_PARENT | ( | q | ) | (((q)+1)/2-1) |
Definition at line 1111 of file misc.c.
Referenced by SCIPpqueueInsert(), and SCIPpqueueRemove().
#define PQ_LEFTCHILD | ( | p | ) | (2*(p)+1) |
Definition at line 1112 of file misc.c.
Referenced by SCIPpqueueRemove().
#define PQ_RIGHTCHILD | ( | p | ) | (2*(p)+2) |
Definition at line 1113 of file misc.c.
Referenced by SCIPpqueueRemove().
#define SCIP_MULTIHASH_MAXSIZE 33554431 /* 2^25 - 1*/ |
Definition at line 1557 of file misc.c.
Referenced by multihashResize().
#define SCIP_MULTIHASH_RESIZE_PERCENTAGE 65 |
Definition at line 1558 of file misc.c.
Referenced by SCIPmultihashInsert().
#define SCIP_MULTIHASH_GROW_FACTOR 1.31 |
Definition at line 1559 of file misc.c.
Referenced by multihashResize().
#define ELEM_DISTANCE | ( | pos | ) | (((pos) + hashtable->mask + 1 - (hashtable->hashes[(pos)]>>(hashtable->shift))) & hashtable->mask) |
Definition at line 2588 of file misc.c.
Referenced by hashmapInsert(), hashmapLookup(), hashtableInsert(), SCIPhashmapPrintStatistics(), SCIPhashtablePrintStatistics(), SCIPhashtableRemove(), and SCIPhashtableRetrieve().
#define ELEM_DISTANCE | ( | pos | ) | (((pos) + hashmap->mask + 1 - (hashmap->hashes[(pos)]>>(hashmap->shift))) & hashmap->mask) |
#define SORTTPL_NAMEEXT Ind |
Definition at line 5706 of file misc.c.
Referenced by SORTTPL_NAME().
#define SORTTPL_KEYTYPE int |
Definition at line 5707 of file misc.c.
Referenced by SORTTPL_NAME().
#define SORTTPL_FIELD1TYPE void* |
Definition at line 5708 of file misc.c.
Referenced by SORTTPL_NAME().
#define SORTTPL_FIELD2TYPE int |
Definition at line 5709 of file misc.c.
Referenced by SORTTPL_NAME().
#define SORTTPL_FIELD3TYPE int |
Definition at line 5710 of file misc.c.
Referenced by SORTTPL_NAME().
#define SORTTPL_FIELD2TYPE SCIP_Longint |
#define SORTTPL_FIELD2TYPE SCIP_Longint |
#define SORTTPL_FIELD4TYPE int |
Definition at line 5711 of file misc.c.
Referenced by SORTTPL_NAME().
#define SORTTPL_FIELD2TYPE SCIP_Longint |
#define SORTTPL_FIELD1TYPE SCIP_Longint |
#define SORTTPL_FIELD5TYPE void* |
Definition at line 5712 of file misc.c.
Referenced by 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 6623 of file misc.c.
Referenced by ensureSuccessorsSize().
#define SCIP_RAND_MAX RAND_MAX |
Definition at line 8548 of file misc.c.
Referenced by getRandomInt(), getRandomReal(), and SCIPselectSimpleValue().
#define DEFAULT_SEED UINT32_C(123456789) |
Definition at line 8629 of file misc.c.
Referenced by randomInitialize().
#define DEFAULT_XOR UINT32_C(362436000) |
Definition at line 8630 of file misc.c.
Referenced by randomInitialize().
#define DEFAULT_MWC UINT32_C(521288629) |
Definition at line 8631 of file misc.c.
Referenced by randomInitialize().
#define DEFAULT_CST UINT32_C(7654321) |
Definition at line 8632 of file misc.c.
Referenced by randomInitialize().
|
static |
recomputes regression coefficients from available observation data
regression | regression data structure |
Definition at line 273 of file misc.c.
References SCIP_Regression::corrcoef, EPSZ, SCIP_Regression::intercept, SCIP_Regression::meanx, SCIP_Regression::meany, SCIP_Regression::nobservations, SCIP_INVALID, SCIP_Regression::slope, sqrt(), 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 311 of file misc.c.
References MAX, NULL, 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 429 of file misc.c.
References MAX.
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 913 of file misc.c.
References BMSreallocMemoryArray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_Queue::size, SCIP_Queue::sizefac, and SCIP_Queue::slots.
Referenced by SCIPqueueCreate(), and SCIPqueueInsert().
|
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 1118 of file misc.c.
References BMSreallocMemoryArray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_PQueue::size, SCIP_PQueue::sizefac, and SCIP_PQueue::slots.
Referenced by SCIPpqueueCreate(), and SCIPpqueueInsert().
|
static |
simple and fast 2-universal hash function using multiply and shift
input | key value |
Definition at line 1348 of file misc.c.
Referenced by hashmapLookup(), SCIPhashmapInsert(), SCIPhashmapInsertReal(), SCIPhashmapSetImage(), 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 1370 of file misc.c.
References 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 1392 of file misc.c.
References 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 1416 of file misc.c.
References SCIP_MultiHashList::element, SCIP_MultiHashList::next, and NULL.
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 1447 of file misc.c.
References SCIP_MultiHashList::element, multihashlistFind(), SCIP_MultiHashList::next, NULL, 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 1497 of file misc.c.
References SCIP_MultiHashList::element, multihashlistFind(), SCIP_MultiHashList::next, and NULL.
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 1530 of file misc.c.
References BMSfreeBlockMemory, FALSE, SCIP_MultiHashList::next, NULL, and TRUE.
Referenced by SCIPmultihashRemove().
|
static |
resizing(increasing) the given multihash
multihash | hash table |
Definition at line 1563 of file misc.c.
References 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_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 2129 of file misc.c.
References ELEM_DISTANCE, SCIP_HashTable::hashes, SCIP_HashTable::mask, SCIP_HashTable::nelements, NULL, 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 2201 of file misc.c.
References SCIP_HashTable::blkmem, BMSallocBlockMemoryArray, BMSallocClearBlockMemoryArray, BMSfreeBlockMemoryArray, FALSE, SCIP_HashTable::hashes, hashtableInsert(), 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 2593 of file misc.c.
References ELEM_DISTANCE, SCIP_HashMap::hashes, SCIP_HashMapEntry::image, SCIP_HashMap::mask, SCIP_HashMap::nelements, NULL, SCIP_HashMapEntry::origin, SCIP_KEYALREADYEXISTING, SCIP_OKAY, SCIPswapPointers(), SCIP_HashMap::shift, SCIP_HashMap::slots, and TRUE.
Referenced by hashmapCheckLoad(), SCIPhashmapInsert(), SCIPhashmapInsertReal(), SCIPhashmapSetImage(), 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 2669 of file misc.c.
References ELEM_DISTANCE, FALSE, SCIP_HashMap::hashes, hashvalue(), SCIP_HashMap::mask, NULL, SCIP_HashMapEntry::origin, SCIP_HashMap::shift, SCIP_HashMap::slots, and TRUE.
Referenced by SCIPhashmapExists(), SCIPhashmapGetImage(), 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 2714 of file misc.c.
References SCIP_HashMap::blkmem, BMSallocBlockMemoryArray, BMSallocClearBlockMemoryArray, BMSfreeBlockMemoryArray, FALSE, SCIP_HashMap::hashes, hashmapInsert(), 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(), SCIPhashmapInsertReal(), SCIPhashmapSetImage(), and SCIPhashmapSetImageReal().
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 3183 of file misc.c.
References 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 3203 of file misc.c.
References 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 3227 of file misc.c.
References 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 3241 of file misc.c.
References BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArrayNull, calcGrowSize(), SCIP_RealArray::firstidx, MAX, SCIP_RealArray::maxusedidx, MIN, SCIP_RealArray::minusedidx, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, 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 3396 of file misc.c.
References BMSclearMemoryArray, SCIP_RealArray::firstidx, NULL, SCIP_OKAY, and SCIPdebugMessage.
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 3427 of file misc.c.
References SCIP_RealArray::firstidx, SCIP_RealArray::maxusedidx, NULL, 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 3448 of file misc.c.
References SCIP_RealArray::firstidx, MAX, MIN, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPrealarrayExtend().
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 3517 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 3535 of file misc.c.
References 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 3545 of file misc.c.
References 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 3555 of file misc.c.
References 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 3575 of file misc.c.
References 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 3598 of file misc.c.
References 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 3612 of file misc.c.
References BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArrayNull, calcGrowSize(), SCIP_IntArray::firstidx, MAX, SCIP_IntArray::maxusedidx, MIN, SCIP_IntArray::minusedidx, NULL, SCIP_ALLOC, SCIP_OKAY, SCIPdebugMessage, 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 3767 of file misc.c.
References BMSclearMemoryArray, SCIP_IntArray::firstidx, NULL, SCIP_OKAY, and SCIPdebugMessage.
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 3798 of file misc.c.
References 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 3819 of file misc.c.
References SCIP_IntArray::firstidx, MAX, MIN, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPintarrayExtend().
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 3887 of file misc.c.
References 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 3899 of file misc.c.
References 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 3909 of file misc.c.
References 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 3920 of file misc.c.
References 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 3940 of file misc.c.
References 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 3964 of file misc.c.
References 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 3978 of file misc.c.
References BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArrayNull, BMSmoveMemoryArray, calcGrowSize(), FALSE, SCIP_BoolArray::firstidx, MAX, SCIP_BoolArray::maxusedidx, MIN, SCIP_BoolArray::minusedidx, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_OKAY, SCIPdebugMessage, 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 4135 of file misc.c.
References BMSclearMemoryArray, SCIP_BoolArray::firstidx, NULL, SCIP_OKAY, and SCIPdebugMessage.
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 4166 of file misc.c.
References FALSE, SCIP_BoolArray::firstidx, SCIP_BoolArray::maxusedidx, NULL, 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 4187 of file misc.c.
References FALSE, SCIP_BoolArray::firstidx, MAX, MIN, NULL, SCIP_CALL, SCIP_OKAY, SCIPboolarrayExtend(), and SCIPdebugMessage.
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 4255 of file misc.c.
References 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 4265 of file misc.c.
References 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 4276 of file misc.c.
References 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 4296 of file misc.c.
References 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 4319 of file misc.c.
References 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 4333 of file misc.c.
References BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArrayNull, calcGrowSize(), SCIP_PtrArray::firstidx, MAX, SCIP_PtrArray::maxusedidx, MIN, SCIP_PtrArray::minusedidx, NULL, SCIP_ALLOC, SCIP_OKAY, SCIPdebugMessage, 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 4488 of file misc.c.
References BMSclearMemoryArray, SCIP_PtrArray::firstidx, NULL, SCIP_OKAY, and SCIPdebugMessage.
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 4519 of file misc.c.
References 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 4540 of file misc.c.
References SCIP_PtrArray::firstidx, MAX, MIN, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPptrarrayExtend().
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 4608 of file misc.c.
References 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 4618 of file misc.c.
References SCIP_PtrArray::maxusedidx, and NULL.
Referenced by SCIPgetPtrarrayMaxIdx().
|
static |
profile | resource profile to insert the time point |
neededsize | needed size |
Definition at line 5961 of file misc.c.
References SCIP_Profile::arraysize, 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 5984 of file misc.c.
References SCIP_Profile::arraysize, ensureProfileSize(), 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 6025 of file misc.c.
References SCIP_Profile::arraysize, SCIP_Profile::capacity, FALSE, SCIP_Profile::loads, SCIP_Profile::ntimepoints, NULL, profileInsertTimepoint(), 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 6147 of file misc.c.
References SCIP_Profile::capacity, FALSE, SCIP_Profile::loads, SCIP_Profile::ntimepoints, NULL, 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 6298 of file misc.c.
References SCIP_Profile::capacity, FALSE, SCIP_Profile::loads, SCIP_Profile::ntimepoints, NULL, SCIPdebugMessage, SCIP_Profile::timepoints, and TRUE.
Referenced by SCIPprofileGetLatestFeasibleStart().
|
static |
digraph | directed graph |
idx | index for which the size is ensured |
newsize | needed size |
Definition at line 6627 of file misc.c.
References SCIP_Digraph::arcdata, BMSallocMemoryArray, BMSreallocMemoryArray, 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 6852 of file misc.c.
References FALSE, nnodes, SCIP_Digraph::nsuccessors, NULL, SCIP_Digraph::successors, and TRUE.
Referenced by SCIPdigraphComputeUndirectedComponents(), and SCIPdigraphTopoSortComponents().
|
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 7149 of file misc.c.
References FALSE, MIN, nnodes, SCIP_Digraph::nnodes, SCIP_Digraph::nsuccessors, NULL, SCIP_Digraph::successors, and TRUE.
Referenced by SCIPdigraphComputeDirectedComponents().
|
static |
creates a node for a binary tree
tree | binary tree |
node | pointer to store the created node |
Definition at line 7485 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 7524 of file misc.c.
References 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 7817 of file misc.c.
References NULL, SCIP_MAXSTRLEN, SCIPbtnodeGetLeftchild(), SCIPbtnodeGetRightchild(), SCIPgmlWriteArc(), SCIPgmlWriteNode(), and SCIPsnprintf().
Referenced by 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 8209 of file misc.c.
References 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 8552 of file misc.c.
Referenced by getRandomInt(), getRandomReal(), and SCIPselectSimpleValue().
|
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 8563 of file misc.c.
References getRand(), SCIP_RAND_MAX, and SCIP_Real.
Referenced by SCIPgetRandomInt(), SCIPgetRandomSubset(), SCIPpermuteArray(), and SCIPpermuteIntArray().
|
static |
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 8583 of file misc.c.
References getRand(), SCIP_RAND_MAX, and SCIP_Real.
Referenced by SCIPgetRandomReal().
|
static |
initialize the random number generator with a given start seed
randnumgen | random number generator |
initseed | initial random seed |
Definition at line 8637 of file misc.c.
References 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 SCIPrandomCreate().
|
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 8670 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().
|
static |
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 65 of file misc.c.
Referenced by SCIPstudentTGetCriticalValue().
|
static |
Definition at line 86 of file misc.c.
Referenced by SCIPnormalGetCriticalValue(), and SCIPstudentTGetCriticalValue().
|
static |
the maximum degrees of freedom represented before switching to normal approximation
Definition at line 91 of file misc.c.
Referenced by SCIPstudentTGetCriticalValue().
|
static |
|
static |
|
static |
|
static |
Definition at line 8232 of file misc.c.
Referenced by SCIPcalcIntegralScalar().