49 #define SQRTOFTWO 1.4142136 66 1.000, 2.414, 3.078, 6.314, 12.706,
67 0.816, 1.604, 1.886, 2.920, 4.303,
68 0.765, 1.423, 1.638, 2.353, 3.182,
69 0.741, 1.344, 1.533, 2.132, 2.776,
70 0.727, 1.301, 1.476, 2.015, 2.571,
71 0.718, 1.273, 1.440, 1.943, 2.447,
72 0.711, 1.254, 1.415, 1.895, 2.365,
73 0.706, 1.240, 1.397, 1.860, 2.306,
74 0.703, 1.230, 1.383, 1.833, 2.262,
75 0.700, 1.221, 1.372, 1.812, 2.228,
76 0.697, 1.214, 1.363, 1.796, 2.201,
77 0.695, 1.209, 1.356, 1.782, 2.179,
78 0.694, 1.204, 1.350, 1.771, 2.160,
79 0.692, 1.200, 1.345, 1.761, 2.145,
80 0.691, 1.197, 1.341, 1.753, 2.131
87 0.674, 1.150, 1.282, 1.645, 1.960
124 if( countx < 1.9 || county < 1.9 )
128 pooledvariance = (countx - 1) * variancex + (county - 1) * variancey;
129 pooledvariance /= (countx + county - 2);
132 pooledvariance =
MAX(pooledvariance, 1e-9);
137 tresult = (meanx - meany) / pooledvariance;
138 tresult *= SQRT(countx * county / (countx + county));
148 #if defined(_WIN32) || defined(_WIN64) 159 sign = (x >= 0) ? 1 : -1;
163 y = 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*
exp(-x*x);
194 assert(variance >= -1e-9);
195 if( variance < 1e-9 )
198 std =
sqrt(variance);
203 if( value < mean + 1e-9 )
208 assert( std != 0.0 );
211 normvalue = (value - mean)/(std *
SQRTOFTWO);
213 SCIPdebugMessage(
" Normalized value %g = ( %g - %g ) / (%g * 1.4142136)\n", normvalue, value, mean, std);
218 if( normvalue < 1e-9 && normvalue > -1e-9 )
220 else if( normvalue > 0 )
224 erfresult =
SCIPerf(normvalue);
225 return erfresult / 2.0 + 0.5;
231 erfresult =
SCIPerf(-normvalue);
233 return 0.5 - erfresult / 2.0;
246 assert(regression != NULL);
256 assert(regression != NULL);
258 return regression->
slope;
266 assert(regression != NULL);
287 regression->
slope = 0.0;
321 assert(meanptr != NULL);
322 assert(sumvarptr != NULL);
323 assert(nobservations > 0 || add);
325 addfactor = add ? 1.0 : -1.0;
328 *meanptr = oldmean + addfactor * (value - oldmean)/(
SCIP_Real)nobservations;
329 *sumvarptr += addfactor * (value - oldmean) * (value - (*meanptr));
332 assert(*sumvarptr >= -1e-6);
333 *sumvarptr =
MAX(0.0, *sumvarptr);
343 assert(regression != NULL);
361 regression->
sumxy -= (x * y);
376 assert(regression != NULL);
382 regression->
sumxy += x * y;
395 regression->
meanx = 0;
397 regression->
sumxy = 0;
398 regression->
meany = 0;
408 assert(regression != NULL);
437 assert(initsize >= 0);
438 assert(growfac >= 1.0);
442 size =
MAX(initsize, num);
448 initsize =
MAX(initsize, 4);
453 while( size < num && size > oldsize )
456 size = (int)(growfac * size + initsize);
460 if( size <= oldsize )
464 assert(size >= initsize);
475 #define GMLNODEWIDTH 120.0 476 #define GMLNODEHEIGTH 30.0 477 #define GMLFONTSIZE 13 478 #define GMLNODETYPE "rectangle" 479 #define GMLNODEFILLCOLOR "#ff0000" 480 #define GMLEDGECOLOR "black" 481 #define GMLNODEBORDERCOLOR "#000000" 489 const char* nodetype,
490 const char* fillcolor,
491 const char* bordercolor
494 assert(file != NULL);
495 assert(label != NULL);
497 fprintf(file,
" node\n");
498 fprintf(file,
" [\n");
499 fprintf(file,
" id %u\n",
id);
500 fprintf(file,
" label \"%s\"\n", label);
501 fprintf(file,
" graphics\n");
502 fprintf(file,
" [\n");
506 if( nodetype != NULL )
507 fprintf(file,
" type \"%s\"\n", nodetype);
511 if( fillcolor != NULL )
512 fprintf(file,
" fill \"%s\"\n", fillcolor);
516 if( bordercolor != NULL )
517 fprintf(file,
" outline \"%s\"\n", bordercolor);
521 fprintf(file,
" ]\n");
522 fprintf(file,
" LabelGraphics\n");
523 fprintf(file,
" [\n");
524 fprintf(file,
" text \"%s\"\n", label);
526 fprintf(file,
" fontName \"Dialog\"\n");
527 fprintf(file,
" anchor \"c\"\n");
528 fprintf(file,
" ]\n");
529 fprintf(file,
" ]\n");
537 const char* nodetype,
538 const char* fillcolor,
539 const char* bordercolor,
543 assert(file != NULL);
544 assert(label != NULL);
546 fprintf(file,
" node\n");
547 fprintf(file,
" [\n");
548 fprintf(file,
" id %u\n",
id);
549 fprintf(file,
" label \"%s\"\n", label);
550 fprintf(file,
" weight %g\n", weight);
551 fprintf(file,
" graphics\n");
552 fprintf(file,
" [\n");
556 if( nodetype != NULL )
557 fprintf(file,
" type \"%s\"\n", nodetype);
561 if( fillcolor != NULL )
562 fprintf(file,
" fill \"%s\"\n", fillcolor);
566 if( bordercolor != NULL )
567 fprintf(file,
" outline \"%s\"\n", bordercolor);
571 fprintf(file,
" ]\n");
572 fprintf(file,
" LabelGraphics\n");
573 fprintf(file,
" [\n");
574 fprintf(file,
" text \"%s\"\n", label);
576 fprintf(file,
" fontName \"Dialog\"\n");
577 fprintf(file,
" anchor \"c\"\n");
578 fprintf(file,
" ]\n");
579 fprintf(file,
" ]\n");
591 assert(file != NULL);
593 fprintf(file,
" edge\n");
594 fprintf(file,
" [\n");
595 fprintf(file,
" source %u\n", source);
596 fprintf(file,
" target %u\n", target);
599 fprintf(file,
" label \"%s\"\n", label);
601 fprintf(file,
" graphics\n");
602 fprintf(file,
" [\n");
605 fprintf(file,
" fill \"%s\"\n", color);
610 fprintf(file,
" ]\n");
614 fprintf(file,
" LabelGraphics\n");
615 fprintf(file,
" [\n");
616 fprintf(file,
" text \"%s\"\n", label);
618 fprintf(file,
" fontName \"Dialog\"\n");
619 fprintf(file,
" anchor \"c\"\n");
620 fprintf(file,
" ]\n");
623 fprintf(file,
" ]\n");
635 assert(file != NULL);
637 fprintf(file,
" edge\n");
638 fprintf(file,
" [\n");
639 fprintf(file,
" source %u\n", source);
640 fprintf(file,
" target %u\n", target);
643 fprintf(file,
" label \"%s\"\n", label);
645 fprintf(file,
" graphics\n");
646 fprintf(file,
" [\n");
649 fprintf(file,
" fill \"%s\"\n", color);
653 fprintf(file,
" targetArrow \"standard\"\n");
654 fprintf(file,
" ]\n");
658 fprintf(file,
" LabelGraphics\n");
659 fprintf(file,
" [\n");
660 fprintf(file,
" text \"%s\"\n", label);
662 fprintf(file,
" fontName \"Dialog\"\n");
663 fprintf(file,
" anchor \"c\"\n");
664 fprintf(file,
" ]\n");
667 fprintf(file,
" ]\n");
676 assert(file != NULL);
678 fprintf(file,
"graph\n");
679 fprintf(file,
"[\n");
680 fprintf(file,
" hierarchic 1\n");
683 fprintf(file,
" directed 1\n");
691 assert(file != NULL);
693 fprintf(file,
"]\n");
715 assert(sparsesol != NULL);
716 assert(vars != NULL);
725 for( v = nvars - 1; v >= 0; --v )
727 assert(vars[v] != NULL);
748 (*sparsesol)->nvars = nvars;
758 assert(sparsesol != NULL);
759 assert(*sparsesol != NULL);
772 assert(sparsesol != NULL);
774 return sparsesol->
vars;
782 assert(sparsesol != NULL);
784 return sparsesol->
nvars;
792 assert(sparsesol != NULL);
802 assert(sparsesol != NULL);
817 assert(sparsesol != NULL);
822 assert(lbvalues != NULL);
825 for( v = 0; v < nvars; ++v )
826 sol[v] = lbvalues[v];
845 assert(sparsesol != NULL);
856 assert(lbvalues != NULL);
857 assert(ubvalues != NULL);
862 for( v = 0; v < nvars; ++v )
864 lbvalue = lbvalues[v];
865 ubvalue = ubvalues[v];
867 if( lbvalue < ubvalue )
871 if( carryflag ==
FALSE )
873 if( sol[v] < ubvalue )
881 assert(sol[v] == ubvalue);
888 if( sol[v] < ubvalue )
896 assert(sol[v] == ubvalue);
903 return (!carryflag && !singular);
918 assert(queue != NULL);
921 if( minsize <= queue->size )
938 assert(queue != NULL);
940 initsize =
MAX(1, initsize);
941 sizefac =
MAX(1.0, sizefac);
944 (*queue)->firstfree = 0;
945 (*queue)->firstused = -1;
947 (*queue)->sizefac = sizefac;
948 (*queue)->slots = NULL;
960 assert(queue != NULL);
971 assert(queue != NULL);
983 assert(queue != NULL);
984 assert(queue->
slots != NULL);
988 assert(elem != NULL);
993 int oldsize = queue->
size;
996 assert(oldsize < queue->size);
998 sizediff = queue->
size - oldsize;
1028 assert(queue != NULL);
1036 assert(queue->
slots != NULL);
1052 return (queue->
slots[pos]);
1060 assert(queue != NULL);
1068 assert(queue->
slots != NULL);
1078 assert(queue != NULL);
1091 assert(queue != NULL);
1111 #define PQ_PARENT(q) (((q)+1)/2-1) 1112 #define PQ_LEFTCHILD(p) (2*(p)+1) 1113 #define PQ_RIGHTCHILD(p) (2*(p)+2) 1123 assert(pqueue != NULL);
1125 if( minsize <= pqueue->size )
1142 assert(pqueue != NULL);
1143 assert(ptrcomp != NULL);
1145 initsize =
MAX(1, initsize);
1146 sizefac =
MAX(1.0, sizefac);
1150 (*pqueue)->size = 0;
1151 (*pqueue)->sizefac = sizefac;
1152 (*pqueue)->slots = NULL;
1153 (*pqueue)->ptrcomp = ptrcomp;
1164 assert(pqueue != NULL);
1175 assert(pqueue != NULL);
1188 assert(pqueue != NULL);
1189 assert(pqueue->
len >= 0);
1190 assert(elem != NULL);
1197 while( pos > 0 && (*pqueue->ptrcomp)(elem, pqueue->
slots[
PQ_PARENT(pos)]) < 0 )
1202 pqueue->
slots[pos] = elem;
1218 assert(pqueue != NULL);
1219 assert(pqueue->
len >= 0);
1221 if( pqueue->
len == 0 )
1227 root = pqueue->
slots[0];
1228 last = pqueue->
slots[pqueue->
len-1];
1235 if( brotherpos <= pqueue->len && (*pqueue->ptrcomp)(pqueue->
slots[brotherpos], pqueue->
slots[childpos]) < 0 )
1236 childpos = brotherpos;
1237 if( (*pqueue->ptrcomp)(last, pqueue->
slots[childpos]) <= 0 )
1239 pqueue->
slots[pos] = pqueue->
slots[childpos];
1242 assert(pos <= pqueue->len);
1243 pqueue->
slots[pos] = last;
1253 assert(pqueue != NULL);
1254 assert(pqueue->
len >= 0);
1256 if( pqueue->
len == 0 )
1259 return pqueue->
slots[0];
1267 assert(pqueue != NULL);
1268 assert(pqueue->
len >= 0);
1278 assert(pqueue != NULL);
1279 assert(pqueue->
len >= 0);
1281 return pqueue->
slots;
1352 return ( (uint32_t) ((UINT64_C(0x9e3779b97f4a7c15) * input)>>32) ) | 1u;
1363 assert(pos < primetablesize);
1365 return primetable[pos];
1378 assert(multihashlist != NULL);
1379 assert(blkmem != NULL);
1380 assert(element != NULL);
1384 newlist->
next = *multihashlist;
1385 *multihashlist = newlist;
1400 assert(multihashlist != NULL);
1401 assert(blkmem != NULL);
1403 list = *multihashlist;
1404 while( list != NULL )
1406 nextlist = list->
next;
1411 *multihashlist = NULL;
1426 uint64_t currentkeyval;
1429 assert(hashkeyeq != NULL);
1430 assert(key != NULL);
1432 while( multihashlist != NULL )
1434 currentkey = hashgetkey(userptr, multihashlist->
element);
1435 currentkeyval = hashkeyval(userptr, currentkey);
1436 if( currentkeyval == keyval && hashkeyeq(userptr, currentkey, key) )
1437 return multihashlist;
1439 multihashlist = multihashlist->
next;
1460 h =
multihashlistFind(multihashlist, hashgetkey, hashkeyeq, hashkeyval, userptr, keyval, key);
1475 key1 = hashgetkey(userptr, h->
element);
1476 key2 = hashgetkey(userptr, h2->
element);
1477 assert(hashkeyval(userptr, key1) == hashkeyval(userptr, key2));
1479 if( hashkeyeq(userptr, key1, key2) )
1481 SCIPerrorMessage(
"WARNING: hashkey with same value exists multiple times (e.g. duplicate constraint/variable names), so the return value is maybe not correct\n");
1510 assert(multihashlist != NULL);
1513 h =
multihashlistFind(*multihashlist, hashgetkey, hashkeyeq, hashkeyval, userptr, keyval, key);
1518 *multihashlist = h->
next;
1523 *multihashlist = NULL;
1538 assert(multihashlist != NULL);
1539 assert(blkmem != NULL);
1540 assert(element != NULL);
1542 while( *multihashlist != NULL && (*multihashlist)->
element != element )
1543 multihashlist = &(*multihashlist)->
next;
1545 if( *multihashlist != NULL )
1547 nextlist = (*multihashlist)->
next;
1549 *multihashlist = nextlist;
1557 #define SCIP_MULTIHASH_MAXSIZE 33554431 1558 #define SCIP_MULTIHASH_RESIZE_PERCENTAGE 65 1559 #define SCIP_MULTIHASH_GROW_FACTOR 1.31 1573 assert(multihash != NULL);
1574 assert(multihash->
lists != NULL);
1575 assert(multihash->
nlists > 0);
1576 assert(multihash->hashgetkey != NULL);
1577 assert(multihash->hashkeyeq != NULL);
1578 assert(multihash->hashkeyval != NULL);
1582 nnewlists =
MAX(nnewlists, multihash->
nlists);
1586 if( nnewlists > multihash->
nlists )
1591 unsigned int hashval;
1596 for( l = multihash->
nlists - 1; l >= 0; --l )
1598 multihashlist = multihash->
lists[l];
1602 while( multihashlist != NULL )
1605 key = multihash->hashgetkey(multihash->
userptr, multihashlist->
element);
1606 keyval = multihash->hashkeyval(multihash->
userptr, key);
1607 hashval = keyval % nnewlists;
1612 if( multihashlist->
next == NULL && onlyone )
1615 if( newlists[hashval] == NULL )
1616 newlists[hashval] = multihashlist;
1623 while( next != NULL )
1629 lastnext->
next = multihashlist;
1632 multihash->
lists[l] = NULL;
1641 multihashlist = multihashlist->
next;
1653 multihash->
lists = newlists;
1654 multihash->
nlists = nnewlists;
1657 #ifdef SCIP_MORE_DEBUG 1661 for( l = 0; l < multihash->
nlists; ++l )
1663 multihashlist = multihash->
lists[l];
1664 while( multihashlist != NULL )
1667 multihashlist = multihashlist->
next;
1670 assert(sumslotsize == multihash->
nelements);
1692 assert(tablesize >= 0);
1693 assert(multihash != NULL);
1694 assert(hashgetkey != NULL);
1695 assert(hashkeyeq != NULL);
1696 assert(hashkeyval != NULL);
1700 (*multihash)->blkmem = blkmem;
1701 (*multihash)->nlists = tablesize;
1702 (*multihash)->hashgetkey = hashgetkey;
1703 (*multihash)->hashkeyeq = hashkeyeq;
1704 (*multihash)->hashkeyval = hashkeyval;
1705 (*multihash)->userptr = userptr;
1706 (*multihash)->nelements = 0;
1721 assert(multihash != NULL);
1722 assert(*multihash != NULL);
1724 table = (*multihash);
1726 lists = table->
lists;
1729 for( i = table->
nlists - 1; i >= 0; --i )
1750 unsigned int hashval;
1752 assert(multihash != NULL);
1753 assert(multihash->
lists != NULL);
1754 assert(multihash->
nlists > 0);
1755 assert(multihash->hashgetkey != NULL);
1756 assert(multihash->hashkeyeq != NULL);
1757 assert(multihash->hashkeyval != NULL);
1758 assert(element != NULL);
1767 key = multihash->hashgetkey(multihash->
userptr, element);
1768 keyval = multihash->hashkeyval(multihash->
userptr, key);
1769 hashval = keyval % multihash->
nlists;
1789 assert(multihash != NULL);
1790 assert(multihash->hashgetkey != NULL);
1809 unsigned int hashval;
1811 assert(multihash != NULL);
1812 assert(multihash->
lists != NULL);
1813 assert(multihash->
nlists > 0);
1814 assert(multihash->hashgetkey != NULL);
1815 assert(multihash->hashkeyeq != NULL);
1816 assert(multihash->hashkeyval != NULL);
1817 assert(key != NULL);
1820 keyval = multihash->hashkeyval(multihash->
userptr, key);
1821 hashval = keyval % multihash->
nlists;
1824 multihash->hashkeyval, multihash->
userptr, keyval, key);
1842 assert(multihash != NULL);
1843 assert(multihash->
lists != NULL);
1844 assert(multihash->
nlists > 0);
1845 assert(multihash->hashgetkey != NULL);
1846 assert(multihash->hashkeyeq != NULL);
1847 assert(multihash->hashkeyval != NULL);
1848 assert(multihashlist != NULL);
1849 assert(key != NULL);
1851 keyval = multihash->hashkeyval(multihash->
userptr, key);
1853 if( *multihashlist == NULL )
1855 unsigned int hashval;
1858 hashval = keyval % multihash->
nlists;
1860 *multihashlist = multihash->
lists[hashval];
1864 multihash->hashkeyval, multihash->
userptr, keyval, key);
1875 unsigned int hashval;
1877 assert(multihash != NULL);
1878 assert(multihash->
lists != NULL);
1879 assert(multihash->
nlists > 0);
1880 assert(multihash->hashgetkey != NULL);
1881 assert(multihash->hashkeyeq != NULL);
1882 assert(multihash->hashkeyval != NULL);
1883 assert(element != NULL);
1886 key = multihash->hashgetkey(multihash->
userptr, element);
1887 keyval = multihash->hashkeyval(multihash->
userptr, key);
1888 hashval = keyval % multihash->
nlists;
1891 multihash->hashkeyval, multihash->
userptr, keyval, key) != NULL);
1902 unsigned int hashval;
1904 assert(multihash != NULL);
1905 assert(multihash->
lists != NULL);
1906 assert(multihash->
nlists > 0);
1907 assert(multihash->hashgetkey != NULL);
1908 assert(multihash->hashkeyeq != NULL);
1909 assert(multihash->hashkeyval != NULL);
1910 assert(element != NULL);
1913 key = multihash->hashgetkey(multihash->
userptr, element);
1914 keyval = multihash->hashkeyval(multihash->
userptr, key);
1915 hashval = keyval % multihash->
nlists;
1937 assert(multihash != NULL);
1939 blkmem = multihash->
blkmem;
1940 lists = multihash->
lists;
1943 for( i = multihash->
nlists - 1; i >= 0; --i )
1954 assert(multihash != NULL);
1964 assert(multihash != NULL);
1982 assert(multihash != NULL);
1987 for( i = 0; i < multihash->
nlists; ++i )
1989 multihashlist = multihash->
lists[i];
1990 if( multihashlist != NULL )
1994 while( multihashlist != NULL )
1997 multihashlist = multihashlist->
next;
1999 maxslotsize =
MAX(maxslotsize, slotsize);
2000 sumslotsize += slotsize;
2003 assert(sumslotsize == multihash->
nelements);
2005 SCIPmessagePrintInfo(messagehdlr,
"%" SCIP_LONGINT_FORMAT
" multihash entries, used %d/%d slots (%.1f%%)",
2024 unsigned int nslots;
2029 assert(tablesize >= 0);
2030 assert(hashtable != NULL);
2031 assert(hashgetkey != NULL);
2032 assert(hashkeyeq != NULL);
2033 assert(hashkeyval != NULL);
2034 assert(blkmem != NULL);
2043 (*hashtable)->shift = 32;
2044 (*hashtable)->shift -= (int)ceil(LOG2(
MAX(32.0, tablesize / 0.9)));
2047 nslots = 1u << (32 - (*hashtable)->shift);
2050 (*hashtable)->mask = nslots - 1;
2053 (*hashtable)->blkmem = blkmem;
2054 (*hashtable)->hashgetkey = hashgetkey;
2055 (*hashtable)->hashkeyeq = hashkeyeq;
2056 (*hashtable)->hashkeyval = hashkeyval;
2057 (*hashtable)->userptr = userptr;
2058 (*hashtable)->nelements = 0;
2071 assert(hashtable != NULL);
2072 assert(*hashtable != NULL);
2074 nslots = (*hashtable)->
mask + 1;
2077 uint32_t maxprobelen = 0;
2078 uint64_t probelensum = 0;
2081 assert(table != NULL);
2083 for( i = 0; i < nslots; ++i )
2085 if( table->
hashes[i] != 0 )
2087 uint32_t probelen = ((i + table->
mask + 1 - (table->
hashes[i]>>(table->
shift))) & table->
mask) + 1;
2088 probelensum += probelen;
2089 maxprobelen =
MAX(probelen, maxprobelen);
2094 (
unsigned int)table->
nelements, (
unsigned int)table->
nelements, (
unsigned int)nslots,
2124 #define ELEM_DISTANCE(pos) (((pos) + hashtable->mask + 1 - (hashtable->hashes[(pos)]>>(hashtable->shift))) & hashtable->mask) 2136 uint32_t elemdistance;
2142 assert(hashtable != NULL);
2143 assert(hashtable->
slots != NULL);
2144 assert(hashtable->
hashes != NULL);
2145 assert(hashtable->
mask > 0);
2146 assert(hashtable->hashgetkey != NULL);
2147 assert(hashtable->hashkeyeq != NULL);
2148 assert(hashtable->hashkeyval != NULL);
2149 assert(element != NULL);
2151 pos = hashval>>(hashtable->
shift);
2158 if( hashtable->
hashes[pos] == 0 )
2160 hashtable->
slots[pos] = element;
2161 hashtable->
hashes[pos] = hashval;
2166 if( hashtable->
hashes[pos] == hashval && hashtable->hashkeyeq(hashtable->
userptr,
2167 hashtable->hashgetkey(hashtable->
userptr, hashtable->
slots[pos]), key) )
2174 hashtable->
slots[pos] = element;
2175 hashtable->
hashes[pos] = hashval;
2186 if( distance < elemdistance )
2191 elemdistance = distance;
2194 hashval = hashtable->
hashes[pos];
2195 hashtable->
hashes[pos] = tmp;
2196 key = hashtable->hashgetkey(hashtable->
userptr, element);
2205 pos = (pos + 1) & hashtable->
mask;
2216 assert(hashtable != NULL);
2217 assert(hashtable->
shift < 32);
2220 if( ((((uint64_t)hashtable->
nelements)<<10)>>(32-hashtable->
shift) > 921) )
2229 nslots = hashtable->
mask + 1;
2230 newnslots = 2*nslots;
2231 hashtable->
mask = newnslots-1;
2243 for( i = 0; i < nslots; ++i )
2248 if( hashes[i] != 0 )
2274 assert(hashtable != NULL);
2275 assert(hashtable->
slots != NULL);
2276 assert(hashtable->
hashes != NULL);
2277 assert(hashtable->
mask > 0);
2278 assert(hashtable->hashgetkey != NULL);
2279 assert(hashtable->hashkeyeq != NULL);
2280 assert(hashtable->hashkeyval != NULL);
2281 assert(element != NULL);
2286 key = hashtable->hashgetkey(hashtable->
userptr, element);
2287 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2306 assert(hashtable != NULL);
2307 assert(hashtable->
slots != NULL);
2308 assert(hashtable->
hashes != NULL);
2309 assert(hashtable->
mask > 0);
2310 assert(hashtable->hashgetkey != NULL);
2311 assert(hashtable->hashkeyeq != NULL);
2312 assert(hashtable->hashkeyval != NULL);
2313 assert(element != NULL);
2318 key = hashtable->hashgetkey(hashtable->
userptr, element);
2319 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2334 uint32_t elemdistance;
2336 assert(hashtable != NULL);
2337 assert(hashtable->
slots != NULL);
2338 assert(hashtable->
hashes != NULL);
2339 assert(hashtable->
mask > 0);
2340 assert(hashtable->hashgetkey != NULL);
2341 assert(hashtable->hashkeyeq != NULL);
2342 assert(hashtable->hashkeyval != NULL);
2343 assert(key != NULL);
2346 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2349 pos = hashval>>(hashtable->
shift);
2357 if( hashtable->
hashes[pos] == 0 )
2363 if( elemdistance > distance )
2367 if( hashtable->
hashes[pos] == hashval && hashtable->hashkeyeq(hashtable->
userptr,
2368 hashtable->hashgetkey(hashtable->
userptr, hashtable->
slots[pos]), key) )
2369 return hashtable->
slots[pos];
2371 pos = (pos + 1) & hashtable->
mask;
2382 assert(hashtable != NULL);
2383 assert(hashtable->
slots != NULL);
2384 assert(hashtable->
hashes != NULL);
2385 assert(hashtable->
mask > 0);
2386 assert(hashtable->hashgetkey != NULL);
2387 assert(hashtable->hashkeyeq != NULL);
2388 assert(hashtable->hashkeyval != NULL);
2389 assert(element != NULL);
2403 uint32_t elemdistance;
2407 assert(hashtable != NULL);
2408 assert(hashtable->
slots != NULL);
2409 assert(hashtable->
hashes != NULL);
2410 assert(hashtable->
mask > 0);
2411 assert(hashtable->hashgetkey != NULL);
2412 assert(hashtable->hashkeyeq != NULL);
2413 assert(hashtable->hashkeyval != NULL);
2414 assert(element != NULL);
2417 key = hashtable->hashgetkey(hashtable->
userptr, element);
2418 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2422 pos = hashval>>(hashtable->
shift);
2426 if( hashtable->
hashes[pos] == 0 )
2432 if( elemdistance > distance )
2435 if( hashtable->
hashes[pos] == hashval && hashtable->hashkeyeq(hashtable->
userptr,
2436 hashtable->hashgetkey(hashtable->
userptr, hashtable->
slots[pos]), key) )
2442 pos = (pos + 1) & hashtable->
mask;
2447 hashtable->
hashes[pos] = 0;
2451 uint32_t nextpos = (pos + 1) & hashtable->
mask;
2454 if( hashtable->
hashes[nextpos] == 0 )
2458 if( (hashtable->
hashes[nextpos]>>(hashtable->
shift)) == nextpos )
2462 hashtable->
slots[pos] = hashtable->
slots[nextpos];
2464 hashtable->
hashes[nextpos] = 0;
2477 assert(hashtable != NULL);
2489 assert(hashtable != NULL);
2499 return (
int) hashtable->
mask + 1;
2508 return hashtable->
hashes[entryidx] == 0 ? NULL : hashtable->
slots[entryidx];
2516 assert(hashtable != NULL);
2527 uint32_t maxprobelen = 0;
2528 uint64_t probelensum = 0;
2532 assert(hashtable != NULL);
2534 nslots = hashtable->
mask + 1;
2537 for( i = 0; i < nslots; ++i )
2539 if( hashtable->
hashes[i] != 0 )
2542 probelensum += probelen;
2543 maxprobelen =
MAX(probelen, maxprobelen);
2562 const char* string1 = (
const char*)key1;
2563 const char* string2 = (
const char*)key2;
2565 return (strcmp(string1, string2) == 0);
2574 str = (
const char*)key;
2576 while( *str !=
'\0' )
2579 hash += (
unsigned int)(*str);
2597 return (key1 == key2);
2604 return (uint64_t) (uintptr_t) key;
2614 #undef ELEM_DISTANCE 2616 #define ELEM_DISTANCE(pos) (((pos) + hashmap->mask + 1 - (hashmap->hashes[(pos)]>>(hashmap->shift))) & hashmap->mask) 2629 uint32_t elemdistance;
2632 assert(hashmap != NULL);
2633 assert(hashmap->
slots != NULL);
2634 assert(hashmap->
hashes != NULL);
2635 assert(hashmap->
mask > 0);
2636 assert(hashval != 0);
2638 pos = hashval>>(hashmap->
shift);
2645 if( hashmap->
hashes[pos] == 0 )
2649 hashmap->
hashes[pos] = hashval;
2660 hashmap->
hashes[pos] = hashval;
2671 if( distance < elemdistance )
2677 elemdistance = distance;
2679 hashval = hashmap->
hashes[pos];
2680 hashmap->
hashes[pos] = tmphash;
2688 pos = (pos + 1) & hashmap->
mask;
2704 uint32_t elemdistance;
2706 assert(hashmap != NULL);
2707 assert(hashmap->
slots != NULL);
2708 assert(hashmap->
hashes != NULL);
2709 assert(hashmap->
mask > 0);
2713 assert(hashval != 0);
2715 *pos = hashval>>(hashmap->
shift);
2723 if( hashmap->
hashes[*pos] == 0 )
2728 if( elemdistance > distance )
2735 *pos = (*pos + 1) & hashmap->
mask;
2746 assert(hashmap != NULL);
2747 assert(hashmap->
shift < 32);
2750 if( ((((uint64_t)hashmap->
nelements)<<10)>>(32-hashmap->
shift) > 921) )
2759 nslots = hashmap->
mask + 1;
2761 newnslots = 2*nslots;
2762 hashmap->
mask = newnslots-1;
2773 for( i = 0; i < nslots; ++i )
2778 if( hashes[i] != 0 )
2801 assert(hashmap != NULL);
2802 assert(mapsize >= 0);
2803 assert(blkmem != NULL);
2812 (*hashmap)->shift = 32;
2813 (*hashmap)->shift -= (int)ceil(
log(
MAX(32, mapsize / 0.9)) /
log(2.0));
2814 nslots = 1u << (32 - (*hashmap)->shift);
2815 (*hashmap)->mask = nslots - 1;
2816 (*hashmap)->blkmem = blkmem;
2817 (*hashmap)->nelements = 0;
2832 assert(hashmap != NULL);
2833 assert(*hashmap != NULL);
2835 nslots = (*hashmap)->mask + 1;
2838 uint32_t maxprobelen = 0;
2839 uint64_t probelensum = 0;
2842 assert(hashmap != NULL);
2844 for( i = 0; i < nslots; ++i )
2846 if( (*hashmap)->hashes[i] != 0 )
2848 uint32_t probelen = ((i + (*hashmap)->mask + 1 - ((*hashmap)->hashes[i]>>((*hashmap)->shift))) & (*hashmap)->mask) + 1;
2849 probelensum += probelen;
2850 maxprobelen =
MAX(probelen, maxprobelen);
2855 (
unsigned int)(*hashmap)->nelements, (
unsigned int)(*hashmap)->nelements, (
unsigned int)nslots,
2857 if( (*hashmap)->nelements > 0 )
2859 (
SCIP_Real)(probelensum)/(
SCIP_Real)(*hashmap)->nelements, (
unsigned int)maxprobelen);
2883 assert(hashmap != NULL);
2884 assert(hashmap->
slots != NULL);
2885 assert(hashmap->
hashes != NULL);
2886 assert(hashmap->
mask > 0);
2913 assert(hashmap != NULL);
2914 assert(hashmap->
slots != NULL);
2915 assert(hashmap->
hashes != NULL);
2916 assert(hashmap->
mask > 0);
2938 assert(hashmap != NULL);
2939 assert(hashmap->
slots != NULL);
2940 assert(hashmap->
hashes != NULL);
2941 assert(hashmap->
mask > 0);
2957 assert(hashmap != NULL);
2958 assert(hashmap->
slots != NULL);
2959 assert(hashmap->
hashes != NULL);
2960 assert(hashmap->
mask > 0);
2980 assert(hashmap != NULL);
2981 assert(hashmap->
slots != NULL);
2982 assert(hashmap->
mask > 0);
3008 assert(hashmap != NULL);
3009 assert(hashmap->
slots != NULL);
3010 assert(hashmap->
mask > 0);
3032 assert(hashmap != NULL);
3033 assert(hashmap->
slots != NULL);
3034 assert(hashmap->
hashes != NULL);
3035 assert(hashmap->
mask > 0);
3048 assert(hashmap != NULL);
3049 assert(hashmap->
slots != NULL);
3050 assert(hashmap->
mask > 0);
3052 assert(origin != NULL);
3057 hashmap->
hashes[pos] = 0;
3063 uint32_t nextpos = (pos + 1) & hashmap->
mask;
3066 if( hashmap->
hashes[nextpos] == 0 )
3070 if( (hashmap->
hashes[nextpos]>>(hashmap->
shift)) == nextpos )
3077 hashmap->
hashes[nextpos] = 0;
3092 uint32_t maxprobelen = 0;
3093 uint64_t probelensum = 0;
3097 assert(hashmap != NULL);
3099 nslots = hashmap->
mask + 1;
3102 for( i = 0; i < nslots; ++i )
3104 if( hashmap->
hashes[i] != 0 )
3107 probelensum += probelen;
3108 maxprobelen =
MAX(probelen, maxprobelen);
3129 assert(hashmap != NULL);
3147 return (
int) hashmap->
mask + 1;
3156 assert(hashmap != NULL);
3158 return hashmap->
hashes[entryidx] == 0 ? NULL : &hashmap->
slots[entryidx];
3166 assert(entry != NULL);
3176 assert(entry != NULL);
3186 assert(entry != NULL);
3197 assert(entry != NULL);
3208 assert(entry != NULL);
3218 assert(hashmap != NULL);
3233 #undef ELEM_DISTANCE 3235 #define ELEM_DISTANCE(pos) (((pos) + nslots - hashSetDesiredPos(hashset, hashset->slots[(pos)])) & mask) 3244 return (uint32_t)((UINT64_C(0x9e3779b97f4a7c15) * (uintptr_t)element)>>(hashset->
shift));
3253 uint32_t elemdistance;
3258 assert(hashset != NULL);
3259 assert(hashset->
slots != NULL);
3260 assert(element != NULL);
3272 if( hashset->
slots[pos] == NULL )
3274 hashset->
slots[pos] = element;
3279 if( hashset->
slots[pos] == element )
3284 if( distance < elemdistance )
3287 elemdistance = distance;
3292 pos = (pos + 1) & mask;
3304 assert(hashset != NULL);
3305 assert(hashset->
shift < 64);
3308 if( ((((uint64_t)hashset->
nelements)<<10)>>(64-hashset->
shift) > 921) )
3317 newnslots = 2*nslots;
3327 for( i = 0; i < nslots; ++i )
3329 if( slots[i] != NULL )
3349 assert(hashset != NULL);
3351 assert(blkmem != NULL);
3360 (*hashset)->shift = 64;
3361 (*hashset)->shift -= (int)ceil(
log(
MAX(8.0, size / 0.9)) /
log(2.0));
3363 (*hashset)->nelements = 0;
3387 assert(hashset != NULL);
3388 assert(hashset->
slots != NULL);
3406 uint32_t elemdistance;
3408 assert(hashset != NULL);
3409 assert(hashset->
slots != NULL);
3421 if( hashset->
slots[pos] == element )
3425 if( hashset->
slots[pos] == NULL )
3430 if( elemdistance > distance )
3433 pos = (pos + 1) & mask;
3447 uint32_t elemdistance;
3449 assert(hashset != NULL);
3450 assert(hashset->
slots != NULL);
3451 assert(element != NULL);
3463 if( hashset->
slots[pos] == element )
3467 if( hashset->
slots[pos] == NULL )
3472 if( elemdistance > distance )
3475 pos = (pos + 1) & mask;
3479 assert(hashset->
slots[pos] == element);
3488 uint32_t nextpos = (pos + 1) & mask;
3491 if( hashset->
slots[nextpos] == NULL )
3493 hashset->
slots[pos] = NULL;
3501 hashset->
slots[pos] = NULL;
3507 hashset->
slots[pos] = hashset->
slots[nextpos];
3519 uint32_t maxprobelen = 0;
3520 uint64_t probelensum = 0;
3525 assert(hashset != NULL);
3531 for( i = 0; i < nslots; ++i )
3533 if( hashset->
slots[i] != NULL )
3536 probelensum += probelen;
3537 maxprobelen =
MAX(probelen, maxprobelen);
3559 #undef SCIPhashsetIsEmpty 3560 #undef SCIPhashsetGetNElements 3561 #undef SCIPhashsetGetNSlots 3562 #undef SCIPhashsetGetSlots 3585 return (
int) (1u << (64 - hashset->
shift));
3593 return hashset->
slots;
3616 assert(realarray != NULL);
3617 assert(blkmem != NULL);
3620 (*realarray)->blkmem = blkmem;
3621 (*realarray)->vals = NULL;
3622 (*realarray)->valssize = 0;
3623 (*realarray)->firstidx = -1;
3624 (*realarray)->minusedidx = INT_MAX;
3625 (*realarray)->maxusedidx = INT_MIN;
3637 assert(realarray != NULL);
3638 assert(sourcerealarray != NULL);
3641 if( sourcerealarray->
valssize > 0 )
3646 (*realarray)->valssize = sourcerealarray->
valssize;
3647 (*realarray)->firstidx = sourcerealarray->
firstidx;
3648 (*realarray)->minusedidx = sourcerealarray->
minusedidx;
3649 (*realarray)->maxusedidx = sourcerealarray->
maxusedidx;
3659 assert(realarray != NULL);
3660 assert(*realarray != NULL);
3682 assert(realarray != NULL);
3687 assert(0 <= minidx);
3688 assert(minidx <= maxidx);
3692 assert(0 <= minidx);
3693 assert(minidx <= maxidx);
3695 SCIPdebugMessage(
"extending realarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
3696 (
void*)realarray, realarray->
firstidx, realarray->valssize, realarray->minusedidx, realarray->maxusedidx, minidx, maxidx);
3699 nused = maxidx - minidx + 1;
3700 if( nused > realarray->valssize )
3706 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
3708 nfree = newvalssize - nused;
3709 newfirstidx = minidx - nfree/2;
3710 newfirstidx =
MAX(newfirstidx, 0);
3711 assert(newfirstidx <= minidx);
3712 assert(maxidx < newfirstidx + newvalssize);
3715 if( realarray->firstidx != -1 )
3717 for( i = 0; i < realarray->minusedidx - newfirstidx; ++i )
3721 assert(realarray->maxusedidx - realarray->minusedidx + 1 > 0);
3724 &(realarray->vals[realarray->minusedidx - realarray->firstidx]),
3725 realarray->maxusedidx - realarray->minusedidx + 1);
3726 for( i = realarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
3731 for( i = 0; i < newvalssize; ++i )
3737 realarray->vals = newvals;
3738 realarray->valssize = newvalssize;
3739 realarray->firstidx = newfirstidx;
3741 else if( realarray->firstidx == -1 )
3744 nfree = realarray->valssize - nused;
3746 realarray->firstidx = minidx - nfree/2;
3747 assert(realarray->firstidx <= minidx);
3748 assert(maxidx < realarray->firstidx + realarray->valssize);
3750 for( i = 0; i < realarray->valssize; ++i )
3751 assert(realarray->vals[i] == 0.0);
3754 else if( minidx < realarray->firstidx )
3757 nfree = realarray->valssize - nused;
3759 newfirstidx = minidx - nfree/2;
3760 newfirstidx =
MAX(newfirstidx, 0);
3761 assert(newfirstidx <= minidx);
3762 assert(maxidx < newfirstidx + realarray->valssize);
3764 if( realarray->minusedidx <= realarray->maxusedidx )
3768 assert(realarray->firstidx <= realarray->minusedidx);
3769 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
3772 shift = realarray->firstidx - newfirstidx;
3774 for( i = realarray->maxusedidx - realarray->firstidx; i >= realarray->minusedidx - realarray->firstidx; --i )
3776 assert(0 <= i + shift && i + shift < realarray->valssize);
3777 realarray->vals[i + shift] = realarray->vals[i];
3780 for( i = 0; i < shift; ++i )
3781 realarray->vals[realarray->minusedidx - realarray->firstidx + i] = 0.0;
3783 realarray->firstidx = newfirstidx;
3785 else if( maxidx >= realarray->firstidx + realarray->valssize )
3788 nfree = realarray->valssize - nused;
3790 newfirstidx = minidx - nfree/2;
3791 newfirstidx =
MAX(newfirstidx, 0);
3792 assert(newfirstidx <= minidx);
3793 assert(maxidx < newfirstidx + realarray->valssize);
3795 if( realarray->minusedidx <= realarray->maxusedidx )
3799 assert(realarray->firstidx <= realarray->minusedidx);
3800 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
3803 shift = newfirstidx - realarray->firstidx;
3805 for( i = realarray->minusedidx - realarray->firstidx; i <= realarray->maxusedidx - realarray->firstidx; ++i )
3807 assert(0 <= i - shift && i - shift < realarray->valssize);
3808 realarray->vals[i - shift] = realarray->vals[i];
3811 for( i = 0; i < shift; ++i )
3812 realarray->vals[realarray->maxusedidx - realarray->firstidx - i] = 0.0;
3814 realarray->firstidx = newfirstidx;
3817 assert(minidx >= realarray->firstidx);
3818 assert(maxidx < realarray->firstidx + realarray->valssize);
3828 assert(realarray != NULL);
3830 SCIPdebugMessage(
"clearing realarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
3831 (
void*)realarray, realarray->
firstidx, realarray->valssize, realarray->minusedidx, realarray->maxusedidx);
3833 if( realarray->minusedidx <= realarray->maxusedidx )
3835 assert(realarray->firstidx <= realarray->minusedidx);
3836 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
3837 assert(realarray->firstidx != -1);
3838 assert(realarray->valssize > 0);
3842 realarray->maxusedidx - realarray->minusedidx + 1);
3845 realarray->minusedidx = INT_MAX;
3846 realarray->maxusedidx = INT_MIN;
3848 assert(realarray->minusedidx == INT_MAX);
3849 assert(realarray->maxusedidx == INT_MIN);
3860 assert(realarray != NULL);
3863 if( idx < realarray->minusedidx || idx > realarray->
maxusedidx )
3867 assert(realarray->
vals != NULL);
3868 assert(idx - realarray->
firstidx >= 0);
3884 assert(realarray != NULL);
3887 SCIPdebugMessage(
"setting realarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %g\n",
3888 (
void*)realarray, realarray->
firstidx, realarray->valssize, realarray->minusedidx, realarray->maxusedidx, idx, val);
3894 assert(idx >= realarray->firstidx);
3895 assert(idx < realarray->firstidx + realarray->valssize);
3898 realarray->vals[idx - realarray->firstidx] = val;
3901 realarray->minusedidx = MIN(realarray->minusedidx, idx);
3902 realarray->maxusedidx =
MAX(realarray->maxusedidx, idx);
3904 else if( idx >= realarray->firstidx && idx < realarray->firstidx + realarray->valssize )
3907 realarray->vals[idx - realarray->firstidx] = 0.0;
3910 if( idx == realarray->minusedidx )
3912 assert(realarray->maxusedidx >= 0);
3913 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
3916 realarray->minusedidx++;
3918 while( realarray->minusedidx <= realarray->maxusedidx
3919 && realarray->vals[realarray->minusedidx - realarray->firstidx] == 0.0 );
3921 if( realarray->minusedidx > realarray->maxusedidx )
3923 realarray->minusedidx = INT_MAX;
3924 realarray->maxusedidx = INT_MIN;
3927 else if( idx == realarray->maxusedidx )
3929 assert(realarray->minusedidx >= 0);
3930 assert(realarray->minusedidx < realarray->maxusedidx);
3931 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
3934 realarray->maxusedidx--;
3935 assert(realarray->minusedidx <= realarray->maxusedidx);
3937 while( realarray->vals[realarray->maxusedidx - realarray->firstidx] == 0.0 );
3967 assert(realarray != NULL);
3977 assert(realarray != NULL);
3988 assert(intarray != NULL);
3989 assert(blkmem != NULL);
3992 (*intarray)->blkmem = blkmem;
3993 (*intarray)->vals = NULL;
3994 (*intarray)->valssize = 0;
3995 (*intarray)->firstidx = -1;
3996 (*intarray)->minusedidx = INT_MAX;
3997 (*intarray)->maxusedidx = INT_MIN;
4009 assert(intarray != NULL);
4010 assert(sourceintarray != NULL);
4017 (*intarray)->valssize = sourceintarray->
valssize;
4018 (*intarray)->firstidx = sourceintarray->
firstidx;
4019 (*intarray)->minusedidx = sourceintarray->
minusedidx;
4020 (*intarray)->maxusedidx = sourceintarray->
maxusedidx;
4030 assert(intarray != NULL);
4031 assert(*intarray != NULL);
4053 assert(intarray != NULL);
4058 assert(0 <= minidx);
4059 assert(minidx <= maxidx);
4063 assert(0 <= minidx);
4064 assert(minidx <= maxidx);
4066 SCIPdebugMessage(
"extending intarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
4067 (
void*)intarray, intarray->
firstidx, intarray->valssize, intarray->minusedidx, intarray->maxusedidx, minidx, maxidx);
4070 nused = maxidx - minidx + 1;
4071 if( nused > intarray->valssize )
4077 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
4079 nfree = newvalssize - nused;
4080 newfirstidx = minidx - nfree/2;
4081 newfirstidx =
MAX(newfirstidx, 0);
4082 assert(newfirstidx <= minidx);
4083 assert(maxidx < newfirstidx + newvalssize);
4086 if( intarray->firstidx != -1 )
4088 for( i = 0; i < intarray->minusedidx - newfirstidx; ++i )
4092 assert(intarray->maxusedidx - intarray->minusedidx + 1 > 0);
4095 &intarray->vals[intarray->minusedidx - intarray->firstidx],
4096 intarray->maxusedidx - intarray->minusedidx + 1);
4097 for( i = intarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
4102 for( i = 0; i < newvalssize; ++i )
4108 intarray->vals = newvals;
4109 intarray->valssize = newvalssize;
4110 intarray->firstidx = newfirstidx;
4112 else if( intarray->firstidx == -1 )
4115 nfree = intarray->valssize - nused;
4117 intarray->firstidx = minidx - nfree/2;
4118 assert(intarray->firstidx <= minidx);
4119 assert(maxidx < intarray->firstidx + intarray->valssize);
4121 for( i = 0; i < intarray->valssize; ++i )
4122 assert(intarray->vals[i] == 0);
4125 else if( minidx < intarray->firstidx )
4128 nfree = intarray->valssize - nused;
4130 newfirstidx = minidx - nfree/2;
4131 newfirstidx =
MAX(newfirstidx, 0);
4132 assert(newfirstidx <= minidx);
4133 assert(maxidx < newfirstidx + intarray->valssize);
4135 if( intarray->minusedidx <= intarray->maxusedidx )
4139 assert(intarray->firstidx <= intarray->minusedidx);
4140 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4143 shift = intarray->firstidx - newfirstidx;
4145 for( i = intarray->maxusedidx - intarray->firstidx; i >= intarray->minusedidx - intarray->firstidx; --i )
4147 assert(0 <= i + shift && i + shift < intarray->valssize);
4148 intarray->vals[i + shift] = intarray->vals[i];
4151 for( i = 0; i < shift; ++i )
4152 intarray->vals[intarray->minusedidx - intarray->firstidx + i] = 0;
4154 intarray->firstidx = newfirstidx;
4156 else if( maxidx >= intarray->firstidx + intarray->valssize )
4159 nfree = intarray->valssize - nused;
4161 newfirstidx = minidx - nfree/2;
4162 newfirstidx =
MAX(newfirstidx, 0);
4163 assert(newfirstidx <= minidx);
4164 assert(maxidx < newfirstidx + intarray->valssize);
4166 if( intarray->minusedidx <= intarray->maxusedidx )
4170 assert(intarray->firstidx <= intarray->minusedidx);
4171 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4174 shift = newfirstidx - intarray->firstidx;
4176 for( i = intarray->minusedidx - intarray->firstidx; i <= intarray->maxusedidx - intarray->firstidx; ++i )
4178 assert(0 <= i - shift && i - shift < intarray->valssize);
4179 intarray->vals[i - shift] = intarray->vals[i];
4182 for( i = 0; i < shift; ++i )
4183 intarray->vals[intarray->maxusedidx - intarray->firstidx - i] = 0;
4185 intarray->firstidx = newfirstidx;
4188 assert(minidx >= intarray->firstidx);
4189 assert(maxidx < intarray->firstidx + intarray->valssize);
4199 assert(intarray != NULL);
4201 SCIPdebugMessage(
"clearing intarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
4202 (
void*)intarray, intarray->
firstidx, intarray->valssize, intarray->minusedidx, intarray->maxusedidx);
4204 if( intarray->minusedidx <= intarray->maxusedidx )
4206 assert(intarray->firstidx <= intarray->minusedidx);
4207 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4208 assert(intarray->firstidx != -1);
4209 assert(intarray->valssize > 0);
4213 intarray->maxusedidx - intarray->minusedidx + 1);
4216 intarray->minusedidx = INT_MAX;
4217 intarray->maxusedidx = INT_MIN;
4219 assert(intarray->minusedidx == INT_MAX);
4220 assert(intarray->maxusedidx == INT_MIN);
4231 assert(intarray != NULL);
4234 if( idx < intarray->minusedidx || idx > intarray->
maxusedidx )
4238 assert(intarray->
vals != NULL);
4239 assert(idx - intarray->
firstidx >= 0);
4255 assert(intarray != NULL);
4258 SCIPdebugMessage(
"setting intarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %d\n",
4259 (
void*)intarray, intarray->
firstidx, intarray->valssize, intarray->minusedidx, intarray->maxusedidx, idx, val);
4265 assert(idx >= intarray->firstidx);
4266 assert(idx < intarray->firstidx + intarray->valssize);
4269 intarray->vals[idx - intarray->firstidx] = val;
4272 intarray->minusedidx = MIN(intarray->minusedidx, idx);
4273 intarray->maxusedidx =
MAX(intarray->maxusedidx, idx);
4275 else if( idx >= intarray->firstidx && idx < intarray->firstidx + intarray->valssize )
4278 intarray->vals[idx - intarray->firstidx] = 0;
4281 if( idx == intarray->minusedidx )
4283 assert(intarray->maxusedidx >= 0);
4284 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4287 intarray->minusedidx++;
4289 while( intarray->minusedidx <= intarray->maxusedidx
4290 && intarray->vals[intarray->minusedidx - intarray->firstidx] == 0 );
4291 if( intarray->minusedidx > intarray->maxusedidx )
4293 intarray->minusedidx = INT_MAX;
4294 intarray->maxusedidx = INT_MIN;
4297 else if( idx == intarray->maxusedidx )
4299 assert(intarray->minusedidx >= 0);
4300 assert(intarray->minusedidx < intarray->maxusedidx);
4301 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4304 intarray->maxusedidx--;
4305 assert(intarray->minusedidx <= intarray->maxusedidx);
4307 while( intarray->vals[intarray->maxusedidx - intarray->firstidx] == 0 );
4331 assert(intarray != NULL);
4341 assert(intarray != NULL);
4353 assert(boolarray != NULL);
4354 assert(blkmem != NULL);
4357 (*boolarray)->blkmem = blkmem;
4358 (*boolarray)->vals = NULL;
4359 (*boolarray)->valssize = 0;
4360 (*boolarray)->firstidx = -1;
4361 (*boolarray)->minusedidx = INT_MAX;
4362 (*boolarray)->maxusedidx = INT_MIN;
4374 assert(boolarray != NULL);
4375 assert(sourceboolarray != NULL);
4378 if( sourceboolarray->
valssize > 0 )
4383 (*boolarray)->valssize = sourceboolarray->
valssize;
4384 (*boolarray)->firstidx = sourceboolarray->
firstidx;
4385 (*boolarray)->minusedidx = sourceboolarray->
minusedidx;
4386 (*boolarray)->maxusedidx = sourceboolarray->
maxusedidx;
4396 assert(boolarray != NULL);
4397 assert(*boolarray != NULL);
4419 assert(boolarray != NULL);
4424 assert(0 <= minidx);
4425 assert(minidx <= maxidx);
4429 assert(0 <= minidx);
4430 assert(minidx <= maxidx);
4432 SCIPdebugMessage(
"extending boolarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
4433 (
void*)boolarray, boolarray->
firstidx, boolarray->valssize, boolarray->minusedidx, boolarray->maxusedidx, minidx, maxidx);
4436 nused = maxidx - minidx + 1;
4437 if( nused > boolarray->valssize )
4443 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
4445 nfree = newvalssize - nused;
4446 newfirstidx = minidx - nfree/2;
4447 newfirstidx =
MAX(newfirstidx, 0);
4448 assert(newfirstidx <= minidx);
4449 assert(maxidx < newfirstidx + newvalssize);
4452 if( boolarray->firstidx != -1 )
4454 for( i = 0; i < boolarray->minusedidx - newfirstidx; ++i )
4458 assert(boolarray->maxusedidx - boolarray->minusedidx + 1 > 0);
4461 &boolarray->vals[boolarray->minusedidx - boolarray->firstidx],
4462 boolarray->maxusedidx - boolarray->minusedidx + 1);
4463 for( i = boolarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
4468 for( i = 0; i < newvalssize; ++i )
4474 boolarray->vals = newvals;
4475 boolarray->valssize = newvalssize;
4476 boolarray->firstidx = newfirstidx;
4478 else if( boolarray->firstidx == -1 )
4481 nfree = boolarray->valssize - nused;
4483 boolarray->firstidx = minidx - nfree/2;
4484 assert(boolarray->firstidx <= minidx);
4485 assert(maxidx < boolarray->firstidx + boolarray->valssize);
4487 for( i = 0; i < boolarray->valssize; ++i )
4488 assert(boolarray->vals[i] ==
FALSE);
4491 else if( minidx < boolarray->firstidx )
4494 nfree = boolarray->valssize - nused;
4496 newfirstidx = minidx - nfree/2;
4497 newfirstidx =
MAX(newfirstidx, 0);
4498 assert(newfirstidx <= minidx);
4499 assert(maxidx < newfirstidx + boolarray->valssize);
4501 if( boolarray->minusedidx <= boolarray->maxusedidx )
4505 assert(boolarray->firstidx <= boolarray->minusedidx);
4506 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4509 shift = boolarray->firstidx - newfirstidx;
4511 for( i = boolarray->maxusedidx - boolarray->firstidx; i >= boolarray->minusedidx - boolarray->firstidx; --i )
4513 assert(0 <= i + shift && i + shift < boolarray->valssize);
4514 boolarray->vals[i + shift] = boolarray->vals[i];
4517 for( i = 0; i < shift; ++i )
4518 boolarray->vals[boolarray->minusedidx - boolarray->firstidx + i] =
FALSE;
4520 boolarray->firstidx = newfirstidx;
4522 else if( maxidx >= boolarray->firstidx + boolarray->valssize )
4525 nfree = boolarray->valssize - nused;
4527 newfirstidx = minidx - nfree/2;
4528 newfirstidx =
MAX(newfirstidx, 0);
4529 assert(newfirstidx <= minidx);
4530 assert(maxidx < newfirstidx + boolarray->valssize);
4532 if( boolarray->minusedidx <= boolarray->maxusedidx )
4536 assert(boolarray->firstidx <= boolarray->minusedidx);
4537 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4540 shift = newfirstidx - boolarray->firstidx;
4543 assert(0 <= boolarray->minusedidx - boolarray->firstidx - shift);
4544 assert(boolarray->maxusedidx - boolarray->firstidx - shift < boolarray->valssize);
4545 BMSmoveMemoryArray(&(boolarray->vals[boolarray->minusedidx - boolarray->firstidx - shift]),
4546 &(boolarray->vals[boolarray->minusedidx - boolarray->firstidx]),
4547 boolarray->maxusedidx - boolarray->minusedidx + 1);
4550 for( i = 0; i < shift; ++i )
4551 boolarray->vals[boolarray->maxusedidx - boolarray->firstidx - i] =
FALSE;
4553 boolarray->firstidx = newfirstidx;
4556 assert(minidx >= boolarray->firstidx);
4557 assert(maxidx < boolarray->firstidx + boolarray->valssize);
4567 assert(boolarray != NULL);
4569 SCIPdebugMessage(
"clearing boolarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
4570 (
void*)boolarray, boolarray->
firstidx, boolarray->valssize, boolarray->minusedidx, boolarray->maxusedidx);
4572 if( boolarray->minusedidx <= boolarray->maxusedidx )
4574 assert(boolarray->firstidx <= boolarray->minusedidx);
4575 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4576 assert(boolarray->firstidx != -1);
4577 assert(boolarray->valssize > 0);
4581 boolarray->maxusedidx - boolarray->minusedidx + 1);
4584 boolarray->minusedidx = INT_MAX;
4585 boolarray->maxusedidx = INT_MIN;
4587 assert(boolarray->minusedidx == INT_MAX);
4588 assert(boolarray->maxusedidx == INT_MIN);
4599 assert(boolarray != NULL);
4602 if( idx < boolarray->minusedidx || idx > boolarray->
maxusedidx )
4606 assert(boolarray->
vals != NULL);
4607 assert(idx - boolarray->
firstidx >= 0);
4623 assert(boolarray != NULL);
4626 SCIPdebugMessage(
"setting boolarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %u\n",
4627 (
void*)boolarray, boolarray->
firstidx, boolarray->valssize, boolarray->minusedidx, boolarray->maxusedidx, idx, val);
4633 assert(idx >= boolarray->firstidx);
4634 assert(idx < boolarray->firstidx + boolarray->valssize);
4637 boolarray->vals[idx - boolarray->firstidx] = val;
4640 boolarray->minusedidx = MIN(boolarray->minusedidx, idx);
4641 boolarray->maxusedidx =
MAX(boolarray->maxusedidx, idx);
4643 else if( idx >= boolarray->firstidx && idx < boolarray->firstidx + boolarray->valssize )
4646 boolarray->vals[idx - boolarray->firstidx] =
FALSE;
4649 if( idx == boolarray->minusedidx )
4651 assert(boolarray->maxusedidx >= 0);
4652 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4655 boolarray->minusedidx++;
4657 while( boolarray->minusedidx <= boolarray->maxusedidx
4658 && boolarray->vals[boolarray->minusedidx - boolarray->firstidx] ==
FALSE );
4659 if( boolarray->minusedidx > boolarray->maxusedidx )
4661 boolarray->minusedidx = INT_MAX;
4662 boolarray->maxusedidx = INT_MIN;
4665 else if( idx == boolarray->maxusedidx )
4667 assert(boolarray->minusedidx >= 0);
4668 assert(boolarray->minusedidx < boolarray->maxusedidx);
4669 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4672 boolarray->maxusedidx--;
4673 assert(boolarray->minusedidx <= boolarray->maxusedidx);
4675 while( boolarray->vals[boolarray->maxusedidx - boolarray->firstidx] ==
FALSE );
4687 assert(boolarray != NULL);
4697 assert(boolarray != NULL);
4709 assert(ptrarray != NULL);
4710 assert(blkmem != NULL);
4713 (*ptrarray)->blkmem = blkmem;
4714 (*ptrarray)->vals = NULL;
4715 (*ptrarray)->valssize = 0;
4716 (*ptrarray)->firstidx = -1;
4717 (*ptrarray)->minusedidx = INT_MAX;
4718 (*ptrarray)->maxusedidx = INT_MIN;
4730 assert(ptrarray != NULL);
4731 assert(sourceptrarray != NULL);
4738 (*ptrarray)->valssize = sourceptrarray->
valssize;
4739 (*ptrarray)->firstidx = sourceptrarray->
firstidx;
4740 (*ptrarray)->minusedidx = sourceptrarray->
minusedidx;
4741 (*ptrarray)->maxusedidx = sourceptrarray->
maxusedidx;
4751 assert(ptrarray != NULL);
4752 assert(*ptrarray != NULL);
4774 assert(ptrarray != NULL);
4779 assert(0 <= minidx);
4780 assert(minidx <= maxidx);
4784 assert(0 <= minidx);
4785 assert(minidx <= maxidx);
4787 SCIPdebugMessage(
"extending ptrarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
4788 (
void*)ptrarray, ptrarray->
firstidx, ptrarray->valssize, ptrarray->minusedidx, ptrarray->maxusedidx, minidx, maxidx);
4791 nused = maxidx - minidx + 1;
4792 if( nused > ptrarray->valssize )
4798 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
4800 nfree = newvalssize - nused;
4801 newfirstidx = minidx - nfree/2;
4802 newfirstidx =
MAX(newfirstidx, 0);
4803 assert(newfirstidx <= minidx);
4804 assert(maxidx < newfirstidx + newvalssize);
4807 if( ptrarray->firstidx != -1 )
4809 for( i = 0; i < ptrarray->minusedidx - newfirstidx; ++i )
4813 assert(ptrarray->maxusedidx - ptrarray->minusedidx + 1 > 0);
4816 &(ptrarray->vals[ptrarray->minusedidx - ptrarray->firstidx]),
4817 ptrarray->maxusedidx - ptrarray->minusedidx + 1);
4818 for( i = ptrarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
4823 for( i = 0; i < newvalssize; ++i )
4829 ptrarray->vals = newvals;
4830 ptrarray->valssize = newvalssize;
4831 ptrarray->firstidx = newfirstidx;
4833 else if( ptrarray->firstidx == -1 )
4836 nfree = ptrarray->valssize - nused;
4838 ptrarray->firstidx = minidx - nfree/2;
4839 assert(ptrarray->firstidx <= minidx);
4840 assert(maxidx < ptrarray->firstidx + ptrarray->valssize);
4842 for( i = 0; i < ptrarray->valssize; ++i )
4843 assert(ptrarray->vals[i] == NULL);
4846 else if( minidx < ptrarray->firstidx )
4849 nfree = ptrarray->valssize - nused;
4851 newfirstidx = minidx - nfree/2;
4852 newfirstidx =
MAX(newfirstidx, 0);
4853 assert(newfirstidx <= minidx);
4854 assert(maxidx < newfirstidx + ptrarray->valssize);
4856 if( ptrarray->minusedidx <= ptrarray->maxusedidx )
4860 assert(ptrarray->firstidx <= ptrarray->minusedidx);
4861 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
4864 shift = ptrarray->firstidx - newfirstidx;
4866 for( i = ptrarray->maxusedidx - ptrarray->firstidx; i >= ptrarray->minusedidx - ptrarray->firstidx; --i )
4868 assert(0 <= i + shift && i + shift < ptrarray->valssize);
4869 ptrarray->vals[i + shift] = ptrarray->vals[i];
4872 for( i = 0; i < shift; ++i )
4873 ptrarray->vals[ptrarray->minusedidx - ptrarray->firstidx + i] = NULL;
4875 ptrarray->firstidx = newfirstidx;
4877 else if( maxidx >= ptrarray->firstidx + ptrarray->valssize )
4880 nfree = ptrarray->valssize - nused;
4882 newfirstidx = minidx - nfree/2;
4883 newfirstidx =
MAX(newfirstidx, 0);
4884 assert(newfirstidx <= minidx);
4885 assert(maxidx < newfirstidx + ptrarray->valssize);
4887 if( ptrarray->minusedidx <= ptrarray->maxusedidx )
4891 assert(ptrarray->firstidx <= ptrarray->minusedidx);
4892 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
4895 shift = newfirstidx - ptrarray->firstidx;
4897 for( i = ptrarray->minusedidx - ptrarray->firstidx; i <= ptrarray->maxusedidx - ptrarray->firstidx; ++i )
4899 assert(0 <= i - shift && i - shift < ptrarray->valssize);
4900 ptrarray->vals[i - shift] = ptrarray->vals[i];
4903 for( i = 0; i < shift; ++i )
4904 ptrarray->vals[ptrarray->maxusedidx - ptrarray->firstidx - i] = NULL;
4906 ptrarray->firstidx = newfirstidx;
4909 assert(minidx >= ptrarray->firstidx);
4910 assert(maxidx < ptrarray->firstidx + ptrarray->valssize);
4920 assert(ptrarray != NULL);
4922 SCIPdebugMessage(
"clearing ptrarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
4923 (
void*)ptrarray, ptrarray->
firstidx, ptrarray->valssize, ptrarray->minusedidx, ptrarray->maxusedidx);
4925 if( ptrarray->minusedidx <= ptrarray->maxusedidx )
4927 assert(ptrarray->firstidx <= ptrarray->minusedidx);
4928 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
4929 assert(ptrarray->firstidx != -1);
4930 assert(ptrarray->valssize > 0);
4934 ptrarray->maxusedidx - ptrarray->minusedidx + 1);
4937 ptrarray->minusedidx = INT_MAX;
4938 ptrarray->maxusedidx = INT_MIN;
4940 assert(ptrarray->minusedidx == INT_MAX);
4941 assert(ptrarray->maxusedidx == INT_MIN);
4952 assert(ptrarray != NULL);
4955 if( idx < ptrarray->minusedidx || idx > ptrarray->
maxusedidx )
4959 assert(ptrarray->
vals != NULL);
4960 assert(idx - ptrarray->
firstidx >= 0);
4976 assert(ptrarray != NULL);
4979 SCIPdebugMessage(
"setting ptrarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %p\n",
4980 (
void*)ptrarray, ptrarray->
firstidx, ptrarray->valssize, ptrarray->minusedidx, ptrarray->maxusedidx, idx, val);
4986 assert(idx >= ptrarray->firstidx);
4987 assert(idx < ptrarray->firstidx + ptrarray->valssize);
4990 ptrarray->vals[idx - ptrarray->firstidx] = val;
4993 ptrarray->minusedidx = MIN(ptrarray->minusedidx, idx);
4994 ptrarray->maxusedidx =
MAX(ptrarray->maxusedidx, idx);
4996 else if( idx >= ptrarray->firstidx && idx < ptrarray->firstidx + ptrarray->valssize )
4999 ptrarray->vals[idx - ptrarray->firstidx] = NULL;
5002 if( idx == ptrarray->minusedidx )
5004 assert(ptrarray->maxusedidx >= 0);
5005 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5008 ptrarray->minusedidx++;
5010 while( ptrarray->minusedidx <= ptrarray->maxusedidx
5011 && ptrarray->vals[ptrarray->minusedidx - ptrarray->firstidx] == NULL );
5012 if( ptrarray->minusedidx > ptrarray->maxusedidx )
5014 ptrarray->minusedidx = INT_MAX;
5015 ptrarray->maxusedidx = INT_MIN;
5018 else if( idx == ptrarray->maxusedidx )
5020 assert(ptrarray->minusedidx >= 0);
5021 assert(ptrarray->minusedidx < ptrarray->maxusedidx);
5022 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5025 ptrarray->maxusedidx--;
5026 assert(ptrarray->minusedidx <= ptrarray->maxusedidx);
5028 while( ptrarray->vals[ptrarray->maxusedidx - ptrarray->firstidx] == NULL );
5040 assert(ptrarray != NULL);
5050 assert(ptrarray != NULL);
5066 value1 = (int)(
size_t)elem1;
5067 value2 = (int)(
size_t)elem2;
5069 if( value1 < value2 )
5072 if( value2 < value1 )
5090 assert(indcomp != NULL);
5091 assert(len == 0 || perm != NULL);
5094 for( pos = 0; pos < len; ++pos )
5101 #define SORTTPL_NAMEEXT Ind 5102 #define SORTTPL_KEYTYPE int 5103 #define SORTTPL_INDCOMP 5108 #define SORTTPL_NAMEEXT Ptr 5109 #define SORTTPL_KEYTYPE void* 5110 #define SORTTPL_PTRCOMP 5115 #define SORTTPL_NAMEEXT PtrPtr 5116 #define SORTTPL_KEYTYPE void* 5117 #define SORTTPL_FIELD1TYPE void* 5118 #define SORTTPL_PTRCOMP 5123 #define SORTTPL_NAMEEXT PtrReal 5124 #define SORTTPL_KEYTYPE void* 5125 #define SORTTPL_FIELD1TYPE SCIP_Real 5126 #define SORTTPL_PTRCOMP 5131 #define SORTTPL_NAMEEXT PtrInt 5132 #define SORTTPL_KEYTYPE void* 5133 #define SORTTPL_FIELD1TYPE int 5134 #define SORTTPL_PTRCOMP 5139 #define SORTTPL_NAMEEXT PtrBool 5140 #define SORTTPL_KEYTYPE void* 5141 #define SORTTPL_FIELD1TYPE SCIP_Bool 5142 #define SORTTPL_PTRCOMP 5147 #define SORTTPL_NAMEEXT PtrIntInt 5148 #define SORTTPL_KEYTYPE void* 5149 #define SORTTPL_FIELD1TYPE int 5150 #define SORTTPL_FIELD2TYPE int 5151 #define SORTTPL_PTRCOMP 5156 #define SORTTPL_NAMEEXT PtrRealInt 5157 #define SORTTPL_KEYTYPE void* 5158 #define SORTTPL_FIELD1TYPE SCIP_Real 5159 #define SORTTPL_FIELD2TYPE int 5160 #define SORTTPL_PTRCOMP 5164 #define SORTTPL_NAMEEXT PtrRealRealInt 5165 #define SORTTPL_KEYTYPE void* 5166 #define SORTTPL_FIELD1TYPE SCIP_Real 5167 #define SORTTPL_FIELD2TYPE SCIP_Real 5168 #define SORTTPL_FIELD3TYPE int 5169 #define SORTTPL_PTRCOMP 5173 #define SORTTPL_NAMEEXT PtrRealBool 5174 #define SORTTPL_KEYTYPE void* 5175 #define SORTTPL_FIELD1TYPE SCIP_Real 5176 #define SORTTPL_FIELD2TYPE SCIP_Bool 5177 #define SORTTPL_PTRCOMP 5182 #define SORTTPL_NAMEEXT PtrPtrInt 5183 #define SORTTPL_KEYTYPE void* 5184 #define SORTTPL_FIELD1TYPE void* 5185 #define SORTTPL_FIELD2TYPE int 5186 #define SORTTPL_PTRCOMP 5191 #define SORTTPL_NAMEEXT PtrPtrReal 5192 #define SORTTPL_KEYTYPE void* 5193 #define SORTTPL_FIELD1TYPE void* 5194 #define SORTTPL_FIELD2TYPE SCIP_Real 5195 #define SORTTPL_PTRCOMP 5200 #define SORTTPL_NAMEEXT PtrRealIntInt 5201 #define SORTTPL_KEYTYPE void* 5202 #define SORTTPL_FIELD1TYPE SCIP_Real 5203 #define SORTTPL_FIELD2TYPE int 5204 #define SORTTPL_FIELD3TYPE int 5205 #define SORTTPL_PTRCOMP 5210 #define SORTTPL_NAMEEXT PtrPtrIntInt 5211 #define SORTTPL_KEYTYPE void* 5212 #define SORTTPL_FIELD1TYPE void* 5213 #define SORTTPL_FIELD2TYPE int 5214 #define SORTTPL_FIELD3TYPE int 5215 #define SORTTPL_PTRCOMP 5220 #define SORTTPL_NAMEEXT PtrPtrRealInt 5221 #define SORTTPL_KEYTYPE void* 5222 #define SORTTPL_FIELD1TYPE void* 5223 #define SORTTPL_FIELD2TYPE SCIP_Real 5224 #define SORTTPL_FIELD3TYPE int 5225 #define SORTTPL_PTRCOMP 5230 #define SORTTPL_NAMEEXT PtrPtrRealBool 5231 #define SORTTPL_KEYTYPE void* 5232 #define SORTTPL_FIELD1TYPE void* 5233 #define SORTTPL_FIELD2TYPE SCIP_Real 5234 #define SORTTPL_FIELD3TYPE SCIP_Bool 5235 #define SORTTPL_PTRCOMP 5240 #define SORTTPL_NAMEEXT PtrPtrLongInt 5241 #define SORTTPL_KEYTYPE void* 5242 #define SORTTPL_FIELD1TYPE void* 5243 #define SORTTPL_FIELD2TYPE SCIP_Longint 5244 #define SORTTPL_FIELD3TYPE int 5245 #define SORTTPL_PTRCOMP 5250 #define SORTTPL_NAMEEXT PtrPtrLongIntInt 5251 #define SORTTPL_KEYTYPE void* 5252 #define SORTTPL_FIELD1TYPE void* 5253 #define SORTTPL_FIELD2TYPE SCIP_Longint 5254 #define SORTTPL_FIELD3TYPE int 5255 #define SORTTPL_FIELD4TYPE int 5256 #define SORTTPL_PTRCOMP 5261 #define SORTTPL_NAMEEXT Real 5262 #define SORTTPL_KEYTYPE SCIP_Real 5267 #define SORTTPL_NAMEEXT RealBoolPtr 5268 #define SORTTPL_KEYTYPE SCIP_Real 5269 #define SORTTPL_FIELD1TYPE SCIP_Bool 5270 #define SORTTPL_FIELD2TYPE void* 5275 #define SORTTPL_NAMEEXT RealPtr 5276 #define SORTTPL_KEYTYPE SCIP_Real 5277 #define SORTTPL_FIELD1TYPE void* 5282 #define SORTTPL_NAMEEXT RealInt 5283 #define SORTTPL_KEYTYPE SCIP_Real 5284 #define SORTTPL_FIELD1TYPE int 5289 #define SORTTPL_NAMEEXT RealIntInt 5290 #define SORTTPL_KEYTYPE SCIP_Real 5291 #define SORTTPL_FIELD1TYPE int 5292 #define SORTTPL_FIELD2TYPE int 5297 #define SORTTPL_NAMEEXT RealIntLong 5298 #define SORTTPL_KEYTYPE SCIP_Real 5299 #define SORTTPL_FIELD1TYPE int 5300 #define SORTTPL_FIELD2TYPE SCIP_Longint 5305 #define SORTTPL_NAMEEXT RealIntPtr 5306 #define SORTTPL_KEYTYPE SCIP_Real 5307 #define SORTTPL_FIELD1TYPE int 5308 #define SORTTPL_FIELD2TYPE void* 5313 #define SORTTPL_NAMEEXT RealRealPtr 5314 #define SORTTPL_KEYTYPE SCIP_Real 5315 #define SORTTPL_FIELD1TYPE SCIP_Real 5316 #define SORTTPL_FIELD2TYPE void* 5321 #define SORTTPL_NAMEEXT RealLongRealInt 5322 #define SORTTPL_KEYTYPE SCIP_Real 5323 #define SORTTPL_FIELD1TYPE SCIP_Longint 5324 #define SORTTPL_FIELD2TYPE SCIP_Real 5325 #define SORTTPL_FIELD3TYPE int 5329 #define SORTTPL_NAMEEXT RealRealIntInt 5330 #define SORTTPL_KEYTYPE SCIP_Real 5331 #define SORTTPL_FIELD1TYPE SCIP_Real 5332 #define SORTTPL_FIELD2TYPE int 5333 #define SORTTPL_FIELD3TYPE int 5338 #define SORTTPL_NAMEEXT RealRealRealInt 5339 #define SORTTPL_KEYTYPE SCIP_Real 5340 #define SORTTPL_FIELD1TYPE SCIP_Real 5341 #define SORTTPL_FIELD2TYPE SCIP_Real 5342 #define SORTTPL_FIELD3TYPE int 5347 #define SORTTPL_NAMEEXT RealRealRealPtr 5348 #define SORTTPL_KEYTYPE SCIP_Real 5349 #define SORTTPL_FIELD1TYPE SCIP_Real 5350 #define SORTTPL_FIELD2TYPE SCIP_Real 5351 #define SORTTPL_FIELD3TYPE void* 5356 #define SORTTPL_NAMEEXT RealPtrPtrInt 5357 #define SORTTPL_KEYTYPE SCIP_Real 5358 #define SORTTPL_FIELD1TYPE void* 5359 #define SORTTPL_FIELD2TYPE void* 5360 #define SORTTPL_FIELD3TYPE int 5365 #define SORTTPL_NAMEEXT RealPtrPtrIntInt 5366 #define SORTTPL_KEYTYPE SCIP_Real 5367 #define SORTTPL_FIELD1TYPE void* 5368 #define SORTTPL_FIELD2TYPE void* 5369 #define SORTTPL_FIELD3TYPE int 5370 #define SORTTPL_FIELD4TYPE int 5375 #define SORTTPL_NAMEEXT RealRealRealBoolPtr 5376 #define SORTTPL_KEYTYPE SCIP_Real 5377 #define SORTTPL_FIELD1TYPE SCIP_Real 5378 #define SORTTPL_FIELD2TYPE SCIP_Real 5379 #define SORTTPL_FIELD3TYPE SCIP_Bool 5380 #define SORTTPL_FIELD4TYPE void* 5385 #define SORTTPL_NAMEEXT RealRealRealBoolBoolPtr 5386 #define SORTTPL_KEYTYPE SCIP_Real 5387 #define SORTTPL_FIELD1TYPE SCIP_Real 5388 #define SORTTPL_FIELD2TYPE SCIP_Real 5389 #define SORTTPL_FIELD3TYPE SCIP_Bool 5390 #define SORTTPL_FIELD4TYPE SCIP_Bool 5391 #define SORTTPL_FIELD5TYPE void* 5396 #define SORTTPL_NAMEEXT Int 5397 #define SORTTPL_KEYTYPE int 5402 #define SORTTPL_NAMEEXT IntInt 5403 #define SORTTPL_KEYTYPE int 5404 #define SORTTPL_FIELD1TYPE int 5409 #define SORTTPL_NAMEEXT IntReal 5410 #define SORTTPL_KEYTYPE int 5411 #define SORTTPL_FIELD1TYPE SCIP_Real 5416 #define SORTTPL_NAMEEXT IntPtr 5417 #define SORTTPL_KEYTYPE int 5418 #define SORTTPL_FIELD1TYPE void* 5423 #define SORTTPL_NAMEEXT IntIntInt 5424 #define SORTTPL_KEYTYPE int 5425 #define SORTTPL_FIELD1TYPE int 5426 #define SORTTPL_FIELD2TYPE int 5431 #define SORTTPL_NAMEEXT IntIntLong 5432 #define SORTTPL_KEYTYPE int 5433 #define SORTTPL_FIELD1TYPE int 5434 #define SORTTPL_FIELD2TYPE SCIP_Longint 5438 #define SORTTPL_NAMEEXT IntRealLong 5439 #define SORTTPL_KEYTYPE int 5440 #define SORTTPL_FIELD1TYPE SCIP_Real 5441 #define SORTTPL_FIELD2TYPE SCIP_Longint 5446 #define SORTTPL_NAMEEXT IntIntPtr 5447 #define SORTTPL_KEYTYPE int 5448 #define SORTTPL_FIELD1TYPE int 5449 #define SORTTPL_FIELD2TYPE void* 5454 #define SORTTPL_NAMEEXT IntIntReal 5455 #define SORTTPL_KEYTYPE int 5456 #define SORTTPL_FIELD1TYPE int 5457 #define SORTTPL_FIELD2TYPE SCIP_Real 5462 #define SORTTPL_NAMEEXT IntPtrReal 5463 #define SORTTPL_KEYTYPE int 5464 #define SORTTPL_FIELD1TYPE void* 5465 #define SORTTPL_FIELD2TYPE SCIP_Real 5470 #define SORTTPL_NAMEEXT IntIntIntPtr 5471 #define SORTTPL_KEYTYPE int 5472 #define SORTTPL_FIELD1TYPE int 5473 #define SORTTPL_FIELD2TYPE int 5474 #define SORTTPL_FIELD3TYPE void* 5478 #define SORTTPL_NAMEEXT IntIntIntReal 5479 #define SORTTPL_KEYTYPE int 5480 #define SORTTPL_FIELD1TYPE int 5481 #define SORTTPL_FIELD2TYPE int 5482 #define SORTTPL_FIELD3TYPE SCIP_Real 5486 #define SORTTPL_NAMEEXT IntPtrIntReal 5487 #define SORTTPL_KEYTYPE int 5488 #define SORTTPL_FIELD1TYPE void* 5489 #define SORTTPL_FIELD2TYPE int 5490 #define SORTTPL_FIELD3TYPE SCIP_Real 5495 #define SORTTPL_NAMEEXT Long 5496 #define SORTTPL_KEYTYPE SCIP_Longint 5501 #define SORTTPL_NAMEEXT LongPtr 5502 #define SORTTPL_KEYTYPE SCIP_Longint 5503 #define SORTTPL_FIELD1TYPE void* 5508 #define SORTTPL_NAMEEXT LongPtrInt 5509 #define SORTTPL_KEYTYPE SCIP_Longint 5510 #define SORTTPL_FIELD1TYPE void* 5511 #define SORTTPL_FIELD2TYPE int 5516 #define SORTTPL_NAMEEXT LongPtrRealBool 5517 #define SORTTPL_KEYTYPE SCIP_Longint 5518 #define SORTTPL_FIELD1TYPE void* 5519 #define SORTTPL_FIELD2TYPE SCIP_Real 5520 #define SORTTPL_FIELD3TYPE SCIP_Bool 5525 #define SORTTPL_NAMEEXT LongPtrRealRealBool 5526 #define SORTTPL_KEYTYPE SCIP_Longint 5527 #define SORTTPL_FIELD1TYPE void* 5528 #define SORTTPL_FIELD2TYPE SCIP_Real 5529 #define SORTTPL_FIELD3TYPE SCIP_Real 5530 #define SORTTPL_FIELD4TYPE SCIP_Bool 5535 #define SORTTPL_NAMEEXT LongPtrRealRealIntBool 5536 #define SORTTPL_KEYTYPE SCIP_Longint 5537 #define SORTTPL_FIELD1TYPE void* 5538 #define SORTTPL_FIELD2TYPE SCIP_Real 5539 #define SORTTPL_FIELD3TYPE SCIP_Real 5540 #define SORTTPL_FIELD4TYPE int 5541 #define SORTTPL_FIELD5TYPE SCIP_Bool 5546 #define SORTTPL_NAMEEXT LongPtrPtrInt 5547 #define SORTTPL_KEYTYPE SCIP_Longint 5548 #define SORTTPL_FIELD1TYPE void* 5549 #define SORTTPL_FIELD2TYPE void* 5550 #define SORTTPL_FIELD3TYPE int 5555 #define SORTTPL_NAMEEXT LongPtrPtrIntInt 5556 #define SORTTPL_KEYTYPE SCIP_Longint 5557 #define SORTTPL_FIELD1TYPE void* 5558 #define SORTTPL_FIELD2TYPE void* 5559 #define SORTTPL_FIELD3TYPE int 5560 #define SORTTPL_FIELD4TYPE int 5565 #define SORTTPL_NAMEEXT LongPtrPtrBoolInt 5566 #define SORTTPL_KEYTYPE SCIP_Longint 5567 #define SORTTPL_FIELD1TYPE void* 5568 #define SORTTPL_FIELD2TYPE void* 5569 #define SORTTPL_FIELD3TYPE SCIP_Bool 5570 #define SORTTPL_FIELD4TYPE int 5575 #define SORTTPL_NAMEEXT PtrIntIntBoolBool 5576 #define SORTTPL_KEYTYPE void* 5577 #define SORTTPL_FIELD1TYPE int 5578 #define SORTTPL_FIELD2TYPE int 5579 #define SORTTPL_FIELD3TYPE SCIP_Bool 5580 #define SORTTPL_FIELD4TYPE SCIP_Bool 5581 #define SORTTPL_PTRCOMP 5586 #define SORTTPL_NAMEEXT IntPtrIntIntBoolBool 5587 #define SORTTPL_KEYTYPE int 5588 #define SORTTPL_FIELD1TYPE void* 5589 #define SORTTPL_FIELD2TYPE int 5590 #define SORTTPL_FIELD3TYPE int 5591 #define SORTTPL_FIELD4TYPE SCIP_Bool 5592 #define SORTTPL_FIELD5TYPE SCIP_Bool 5609 assert(indcomp != NULL);
5610 assert(len == 0 || perm != NULL);
5613 for( pos = 0; pos < len; ++pos )
5621 #define SORTTPL_NAMEEXT DownInd 5622 #define SORTTPL_KEYTYPE int 5623 #define SORTTPL_INDCOMP 5624 #define SORTTPL_BACKWARDS 5629 #define SORTTPL_NAMEEXT DownPtr 5630 #define SORTTPL_KEYTYPE void* 5631 #define SORTTPL_PTRCOMP 5632 #define SORTTPL_BACKWARDS 5637 #define SORTTPL_NAMEEXT DownPtrPtr 5638 #define SORTTPL_KEYTYPE void* 5639 #define SORTTPL_FIELD1TYPE void* 5640 #define SORTTPL_PTRCOMP 5641 #define SORTTPL_BACKWARDS 5646 #define SORTTPL_NAMEEXT DownPtrReal 5647 #define SORTTPL_KEYTYPE void* 5648 #define SORTTPL_FIELD1TYPE SCIP_Real 5649 #define SORTTPL_PTRCOMP 5650 #define SORTTPL_BACKWARDS 5655 #define SORTTPL_NAMEEXT DownPtrInt 5656 #define SORTTPL_KEYTYPE void* 5657 #define SORTTPL_FIELD1TYPE int 5658 #define SORTTPL_PTRCOMP 5659 #define SORTTPL_BACKWARDS 5663 #define SORTTPL_NAMEEXT DownPtrBool 5664 #define SORTTPL_KEYTYPE void* 5665 #define SORTTPL_FIELD1TYPE SCIP_Bool 5666 #define SORTTPL_PTRCOMP 5667 #define SORTTPL_BACKWARDS 5671 #define SORTTPL_NAMEEXT DownPtrIntInt 5672 #define SORTTPL_KEYTYPE void* 5673 #define SORTTPL_FIELD1TYPE int 5674 #define SORTTPL_FIELD2TYPE int 5675 #define SORTTPL_PTRCOMP 5676 #define SORTTPL_BACKWARDS 5681 #define SORTTPL_NAMEEXT DownPtrRealInt 5682 #define SORTTPL_KEYTYPE void* 5683 #define SORTTPL_FIELD1TYPE SCIP_Real 5684 #define SORTTPL_FIELD2TYPE int 5685 #define SORTTPL_PTRCOMP 5686 #define SORTTPL_BACKWARDS 5691 #define SORTTPL_NAMEEXT DownPtrRealBool 5692 #define SORTTPL_KEYTYPE void* 5693 #define SORTTPL_FIELD1TYPE SCIP_Real 5694 #define SORTTPL_FIELD2TYPE SCIP_Bool 5695 #define SORTTPL_PTRCOMP 5696 #define SORTTPL_BACKWARDS 5701 #define SORTTPL_NAMEEXT DownPtrPtrInt 5702 #define SORTTPL_KEYTYPE void* 5703 #define SORTTPL_FIELD1TYPE void* 5704 #define SORTTPL_FIELD2TYPE int 5705 #define SORTTPL_PTRCOMP 5706 #define SORTTPL_BACKWARDS 5711 #define SORTTPL_NAMEEXT DownPtrPtrReal 5712 #define SORTTPL_KEYTYPE void* 5713 #define SORTTPL_FIELD1TYPE void* 5714 #define SORTTPL_FIELD2TYPE SCIP_Real 5715 #define SORTTPL_PTRCOMP 5716 #define SORTTPL_BACKWARDS 5721 #define SORTTPL_NAMEEXT DownPtrRealIntInt 5722 #define SORTTPL_KEYTYPE void* 5723 #define SORTTPL_FIELD1TYPE SCIP_Real 5724 #define SORTTPL_FIELD2TYPE int 5725 #define SORTTPL_FIELD3TYPE int 5726 #define SORTTPL_PTRCOMP 5727 #define SORTTPL_BACKWARDS 5732 #define SORTTPL_NAMEEXT DownPtrPtrIntInt 5733 #define SORTTPL_KEYTYPE void* 5734 #define SORTTPL_FIELD1TYPE void* 5735 #define SORTTPL_FIELD2TYPE int 5736 #define SORTTPL_FIELD3TYPE int 5737 #define SORTTPL_PTRCOMP 5738 #define SORTTPL_BACKWARDS 5743 #define SORTTPL_NAMEEXT DownPtrPtrRealInt 5744 #define SORTTPL_KEYTYPE void* 5745 #define SORTTPL_FIELD1TYPE void* 5746 #define SORTTPL_FIELD2TYPE SCIP_Real 5747 #define SORTTPL_FIELD3TYPE int 5748 #define SORTTPL_PTRCOMP 5749 #define SORTTPL_BACKWARDS 5754 #define SORTTPL_NAMEEXT DownPtrPtrRealBool 5755 #define SORTTPL_KEYTYPE void* 5756 #define SORTTPL_FIELD1TYPE void* 5757 #define SORTTPL_FIELD2TYPE SCIP_Real 5758 #define SORTTPL_FIELD3TYPE SCIP_Bool 5759 #define SORTTPL_PTRCOMP 5760 #define SORTTPL_BACKWARDS 5765 #define SORTTPL_NAMEEXT DownPtrPtrLongInt 5766 #define SORTTPL_KEYTYPE void* 5767 #define SORTTPL_FIELD1TYPE void* 5768 #define SORTTPL_FIELD2TYPE SCIP_Longint 5769 #define SORTTPL_FIELD3TYPE int 5770 #define SORTTPL_PTRCOMP 5771 #define SORTTPL_BACKWARDS 5776 #define SORTTPL_NAMEEXT DownPtrPtrLongIntInt 5777 #define SORTTPL_KEYTYPE void* 5778 #define SORTTPL_FIELD1TYPE void* 5779 #define SORTTPL_FIELD2TYPE SCIP_Longint 5780 #define SORTTPL_FIELD3TYPE int 5781 #define SORTTPL_FIELD4TYPE int 5782 #define SORTTPL_PTRCOMP 5783 #define SORTTPL_BACKWARDS 5788 #define SORTTPL_NAMEEXT DownReal 5789 #define SORTTPL_KEYTYPE SCIP_Real 5790 #define SORTTPL_BACKWARDS 5795 #define SORTTPL_NAMEEXT DownRealBoolPtr 5796 #define SORTTPL_KEYTYPE SCIP_Real 5797 #define SORTTPL_FIELD1TYPE SCIP_Bool 5798 #define SORTTPL_FIELD2TYPE void* 5799 #define SORTTPL_BACKWARDS 5804 #define SORTTPL_NAMEEXT DownRealPtr 5805 #define SORTTPL_KEYTYPE SCIP_Real 5806 #define SORTTPL_FIELD1TYPE void* 5807 #define SORTTPL_BACKWARDS 5812 #define SORTTPL_NAMEEXT DownRealInt 5813 #define SORTTPL_KEYTYPE SCIP_Real 5814 #define SORTTPL_FIELD1TYPE int 5815 #define SORTTPL_BACKWARDS 5820 #define SORTTPL_NAMEEXT DownRealIntLong 5821 #define SORTTPL_KEYTYPE SCIP_Real 5822 #define SORTTPL_FIELD1TYPE int 5823 #define SORTTPL_FIELD2TYPE SCIP_Longint 5824 #define SORTTPL_BACKWARDS 5829 #define SORTTPL_NAMEEXT DownRealIntPtr 5830 #define SORTTPL_KEYTYPE SCIP_Real 5831 #define SORTTPL_FIELD1TYPE int 5832 #define SORTTPL_FIELD2TYPE void* 5833 #define SORTTPL_BACKWARDS 5838 #define SORTTPL_NAMEEXT DownRealPtrPtr 5839 #define SORTTPL_KEYTYPE SCIP_Real 5840 #define SORTTPL_FIELD1TYPE void* 5841 #define SORTTPL_FIELD2TYPE void* 5842 #define SORTTPL_BACKWARDS 5846 #define SORTTPL_NAMEEXT DownRealRealInt 5847 #define SORTTPL_KEYTYPE SCIP_Real 5848 #define SORTTPL_FIELD1TYPE SCIP_Real 5849 #define SORTTPL_FIELD2TYPE int 5850 #define SORTTPL_BACKWARDS 5854 #define SORTTPL_NAMEEXT DownRealRealPtr 5855 #define SORTTPL_KEYTYPE SCIP_Real 5856 #define SORTTPL_FIELD1TYPE SCIP_Real 5857 #define SORTTPL_FIELD2TYPE void* 5858 #define SORTTPL_BACKWARDS 5862 #define SORTTPL_NAMEEXT DownRealRealPtrPtr 5863 #define SORTTPL_KEYTYPE SCIP_Real 5864 #define SORTTPL_FIELD1TYPE SCIP_Real 5865 #define SORTTPL_FIELD2TYPE void* 5866 #define SORTTPL_FIELD3TYPE void* 5867 #define SORTTPL_BACKWARDS 5872 #define SORTTPL_NAMEEXT DownRealLongRealInt 5873 #define SORTTPL_KEYTYPE SCIP_Real 5874 #define SORTTPL_FIELD1TYPE SCIP_Longint 5875 #define SORTTPL_FIELD2TYPE SCIP_Real 5876 #define SORTTPL_FIELD3TYPE int 5877 #define SORTTPL_BACKWARDS 5882 #define SORTTPL_NAMEEXT DownRealRealIntInt 5883 #define SORTTPL_KEYTYPE SCIP_Real 5884 #define SORTTPL_FIELD1TYPE SCIP_Real 5885 #define SORTTPL_FIELD2TYPE int 5886 #define SORTTPL_FIELD3TYPE int 5887 #define SORTTPL_BACKWARDS 5892 #define SORTTPL_NAMEEXT DownRealRealRealInt 5893 #define SORTTPL_KEYTYPE SCIP_Real 5894 #define SORTTPL_FIELD1TYPE SCIP_Real 5895 #define SORTTPL_FIELD2TYPE SCIP_Real 5896 #define SORTTPL_FIELD3TYPE int 5897 #define SORTTPL_BACKWARDS 5902 #define SORTTPL_NAMEEXT DownRealRealRealPtr 5903 #define SORTTPL_KEYTYPE SCIP_Real 5904 #define SORTTPL_FIELD1TYPE SCIP_Real 5905 #define SORTTPL_FIELD2TYPE SCIP_Real 5906 #define SORTTPL_FIELD3TYPE void* 5907 #define SORTTPL_BACKWARDS 5912 #define SORTTPL_NAMEEXT DownRealPtrPtrInt 5913 #define SORTTPL_KEYTYPE SCIP_Real 5914 #define SORTTPL_FIELD1TYPE void* 5915 #define SORTTPL_FIELD2TYPE void* 5916 #define SORTTPL_FIELD3TYPE int 5917 #define SORTTPL_BACKWARDS 5921 #define SORTTPL_NAMEEXT DownRealPtrPtrIntInt 5922 #define SORTTPL_KEYTYPE SCIP_Real 5923 #define SORTTPL_FIELD1TYPE void* 5924 #define SORTTPL_FIELD2TYPE void* 5925 #define SORTTPL_FIELD3TYPE int 5926 #define SORTTPL_FIELD4TYPE int 5927 #define SORTTPL_BACKWARDS 5932 #define SORTTPL_NAMEEXT DownRealRealRealBoolPtr 5933 #define SORTTPL_KEYTYPE SCIP_Real 5934 #define SORTTPL_FIELD1TYPE SCIP_Real 5935 #define SORTTPL_FIELD2TYPE SCIP_Real 5936 #define SORTTPL_FIELD3TYPE SCIP_Bool 5937 #define SORTTPL_FIELD4TYPE void* 5938 #define SORTTPL_BACKWARDS 5943 #define SORTTPL_NAMEEXT DownRealRealRealBoolBoolPtr 5944 #define SORTTPL_KEYTYPE SCIP_Real 5945 #define SORTTPL_FIELD1TYPE SCIP_Real 5946 #define SORTTPL_FIELD2TYPE SCIP_Real 5947 #define SORTTPL_FIELD3TYPE SCIP_Bool 5948 #define SORTTPL_FIELD4TYPE SCIP_Bool 5949 #define SORTTPL_FIELD5TYPE void* 5954 #define SORTTPL_NAMEEXT DownInt 5955 #define SORTTPL_KEYTYPE int 5956 #define SORTTPL_BACKWARDS 5961 #define SORTTPL_NAMEEXT DownIntInt 5962 #define SORTTPL_KEYTYPE int 5963 #define SORTTPL_FIELD1TYPE int 5964 #define SORTTPL_BACKWARDS 5969 #define SORTTPL_NAMEEXT DownIntIntReal 5970 #define SORTTPL_KEYTYPE int 5971 #define SORTTPL_FIELD1TYPE int 5972 #define SORTTPL_FIELD2TYPE SCIP_Real 5973 #define SORTTPL_BACKWARDS 5978 #define SORTTPL_NAMEEXT DownIntReal 5979 #define SORTTPL_KEYTYPE int 5980 #define SORTTPL_FIELD1TYPE SCIP_Real 5981 #define SORTTPL_BACKWARDS 5986 #define SORTTPL_NAMEEXT DownIntPtr 5987 #define SORTTPL_KEYTYPE int 5988 #define SORTTPL_FIELD1TYPE void* 5989 #define SORTTPL_BACKWARDS 5994 #define SORTTPL_NAMEEXT DownIntIntInt 5995 #define SORTTPL_KEYTYPE int 5996 #define SORTTPL_FIELD1TYPE int 5997 #define SORTTPL_FIELD2TYPE int 5998 #define SORTTPL_BACKWARDS 6003 #define SORTTPL_NAMEEXT DownIntIntLong 6004 #define SORTTPL_KEYTYPE int 6005 #define SORTTPL_FIELD1TYPE int 6006 #define SORTTPL_FIELD2TYPE SCIP_Longint 6007 #define SORTTPL_BACKWARDS 6012 #define SORTTPL_NAMEEXT DownIntIntPtr 6013 #define SORTTPL_KEYTYPE int 6014 #define SORTTPL_FIELD1TYPE int 6015 #define SORTTPL_FIELD2TYPE void* 6016 #define SORTTPL_BACKWARDS 6021 #define SORTTPL_NAMEEXT DownIntIntIntPtr 6022 #define SORTTPL_KEYTYPE int 6023 #define SORTTPL_FIELD1TYPE int 6024 #define SORTTPL_FIELD2TYPE int 6025 #define SORTTPL_FIELD3TYPE void* 6026 #define SORTTPL_BACKWARDS 6031 #define SORTTPL_NAMEEXT DownIntPtrIntReal 6032 #define SORTTPL_KEYTYPE int 6033 #define SORTTPL_FIELD1TYPE void* 6034 #define SORTTPL_FIELD2TYPE int 6035 #define SORTTPL_FIELD3TYPE SCIP_Real 6036 #define SORTTPL_BACKWARDS 6041 #define SORTTPL_NAMEEXT DownLong 6042 #define SORTTPL_KEYTYPE SCIP_Longint 6043 #define SORTTPL_BACKWARDS 6048 #define SORTTPL_NAMEEXT DownLongPtr 6049 #define SORTTPL_KEYTYPE SCIP_Longint 6050 #define SORTTPL_FIELD1TYPE void* 6051 #define SORTTPL_BACKWARDS 6056 #define SORTTPL_NAMEEXT DownLongPtrInt 6057 #define SORTTPL_KEYTYPE SCIP_Longint 6058 #define SORTTPL_FIELD1TYPE void* 6059 #define SORTTPL_FIELD2TYPE int 6060 #define SORTTPL_BACKWARDS 6065 #define SORTTPL_NAMEEXT DownLongPtrRealBool 6066 #define SORTTPL_KEYTYPE SCIP_Longint 6067 #define SORTTPL_FIELD1TYPE void* 6068 #define SORTTPL_FIELD2TYPE SCIP_Real 6069 #define SORTTPL_FIELD3TYPE SCIP_Bool 6070 #define SORTTPL_BACKWARDS 6075 #define SORTTPL_NAMEEXT DownLongPtrRealRealBool 6076 #define SORTTPL_KEYTYPE SCIP_Longint 6077 #define SORTTPL_FIELD1TYPE void* 6078 #define SORTTPL_FIELD2TYPE SCIP_Real 6079 #define SORTTPL_FIELD3TYPE SCIP_Real 6080 #define SORTTPL_FIELD4TYPE SCIP_Bool 6081 #define SORTTPL_BACKWARDS 6086 #define SORTTPL_NAMEEXT DownLongPtrRealRealIntBool 6087 #define SORTTPL_KEYTYPE SCIP_Longint 6088 #define SORTTPL_FIELD1TYPE void* 6089 #define SORTTPL_FIELD2TYPE SCIP_Real 6090 #define SORTTPL_FIELD3TYPE SCIP_Real 6091 #define SORTTPL_FIELD4TYPE int 6092 #define SORTTPL_FIELD5TYPE SCIP_Bool 6093 #define SORTTPL_BACKWARDS 6098 #define SORTTPL_NAMEEXT DownLongPtrPtrInt 6099 #define SORTTPL_KEYTYPE SCIP_Longint 6100 #define SORTTPL_FIELD1TYPE void* 6101 #define SORTTPL_FIELD2TYPE void* 6102 #define SORTTPL_FIELD3TYPE int 6103 #define SORTTPL_BACKWARDS 6108 #define SORTTPL_NAMEEXT DownLongPtrPtrIntInt 6109 #define SORTTPL_KEYTYPE SCIP_Longint 6110 #define SORTTPL_FIELD1TYPE void* 6111 #define SORTTPL_FIELD2TYPE void* 6112 #define SORTTPL_FIELD3TYPE int 6113 #define SORTTPL_FIELD4TYPE int 6114 #define SORTTPL_BACKWARDS 6119 #define SORTTPL_NAMEEXT DownLongPtrPtrBoolInt 6120 #define SORTTPL_KEYTYPE SCIP_Longint 6121 #define SORTTPL_FIELD1TYPE void* 6122 #define SORTTPL_FIELD2TYPE void* 6123 #define SORTTPL_FIELD3TYPE SCIP_Bool 6124 #define SORTTPL_FIELD4TYPE int 6125 #define SORTTPL_BACKWARDS 6130 #define SORTTPL_NAMEEXT DownPtrIntIntBoolBool 6131 #define SORTTPL_KEYTYPE void* 6132 #define SORTTPL_FIELD1TYPE int 6133 #define SORTTPL_FIELD2TYPE int 6134 #define SORTTPL_FIELD3TYPE SCIP_Bool 6135 #define SORTTPL_FIELD4TYPE SCIP_Bool 6136 #define SORTTPL_PTRCOMP 6137 #define SORTTPL_BACKWARDS 6142 #define SORTTPL_NAMEEXT DownIntPtrIntIntBoolBool 6143 #define SORTTPL_KEYTYPE int 6144 #define SORTTPL_FIELD1TYPE void* 6145 #define SORTTPL_FIELD2TYPE int 6146 #define SORTTPL_FIELD3TYPE int 6147 #define SORTTPL_FIELD4TYPE SCIP_Bool 6148 #define SORTTPL_FIELD5TYPE SCIP_Bool 6149 #define SORTTPL_BACKWARDS 6164 assert(activity != NULL);
6168 (*activity)->var = var;
6169 (*activity)->duration = duration;
6170 (*activity)->demand = demand;
6180 assert(activity != NULL);
6181 assert(*activity != NULL);
6196 #undef SCIPactivityGetVar 6197 #undef SCIPactivityGetDuration 6198 #undef SCIPactivityGetDemand 6199 #undef SCIPactivityGetEnergy 6206 assert(activity != NULL);
6208 return activity->
var;
6216 assert(activity != NULL);
6226 assert(activity != NULL);
6236 assert(activity != NULL);
6257 (*profile)->arraysize = 10;
6262 (*profile)->ntimepoints = 1;
6263 (*profile)->timepoints[0] = 0;
6264 (*profile)->loads[0] = 0;
6265 (*profile)->capacity = capacity;
6276 assert(profile != NULL);
6277 assert(capacity > 0);
6289 assert(profile != NULL);
6292 if( *profile != NULL )
6327 assert(profile != NULL);
6337 assert(profile != NULL);
6347 assert(profile != NULL);
6357 assert(profile != NULL);
6359 return profile->
loads;
6368 assert(profile != NULL);
6369 assert(pos >= 0 && pos < profile->ntimepoints);
6380 assert(profile != NULL);
6381 assert(pos >= 0 && pos < profile->ntimepoints);
6383 return profile->
loads[pos];
6395 assert(profile != NULL);
6396 assert(timepoint >= 0);
6420 if( neededsize <= profile->arraysize )
6441 assert(profile != NULL);
6442 assert(timepoint >= 0);
6450 assert(*pos >= 0 && *pos < profile->ntimepoints);
6451 assert(timepoint >= profile->
timepoints[*pos]);
6489 assert(profile != NULL);
6492 assert(left < right);
6493 assert(infeasible != NULL);
6495 (*infeasible) =
FALSE;
6500 assert(profile->
timepoints[startpos] == left);
6504 assert(profile->
timepoints[endpos] == right);
6506 assert(startpos < endpos);
6510 for( i = startpos; i < endpos; ++i )
6512 profile->
loads[i] += demand;
6519 (*infeasible) =
TRUE;
6523 for( ; i >= startpos; --i )
6524 profile->
loads[i] -= demand;
6545 assert(profile != NULL);
6546 assert(left < right);
6547 assert(demand >= 0);
6548 assert(infeasible != NULL);
6550 (*infeasible) =
FALSE;
6554 SCIPdebugMessage(
"insert core [%d,%d] with demand %d\n", left, right, demand);
6576 assert(left < right);
6588 SCIPdebugMessage(
"delete core [%d,%d] with demand %d\n", left, right, demand);
6591 assert(!infeasible);
6607 int remainingduration;
6610 assert(profile != NULL);
6612 assert(pos < profile->ntimepoints);
6613 assert(duration > 0);
6617 remainingduration = duration;
6619 (*infeasible) =
FALSE;
6623 (*infeasible) =
TRUE;
6627 while( pos < profile->ntimepoints - 1 )
6631 SCIPdebugMessage(
"profile <%p>: core does not fit at time point %d (pos %d)\n", (
void*)profile, profile->
timepoints[pos], pos);
6633 remainingduration = duration;
6635 if( profile->timepoints[startpos] > lst )
6637 (*infeasible) =
TRUE;
6644 if( remainingduration <= 0 )
6668 assert(profile != NULL);
6671 assert(duration >= 0);
6672 assert(demand >= 0);
6673 assert(infeasible != NULL);
6677 SCIPdebugMessage(
"profile <%p>: find earliest start time (demad %d, duration %d) [%d,%d]\n", (
void*)profile, demand, duration, est, lst);
6679 if( duration == 0 || demand == 0 )
6681 *infeasible =
FALSE;
6686 SCIPdebugMessage(
"profile <%p>: earliest start time does %s exist as time point (pos %d)\n", (
void*)profile, found ?
"" :
"not", pos);
6689 if( pos == profile->ntimepoints - 1 )
6691 (*infeasible) =
FALSE;
6698 assert(profile->timepoints[pos] == est);
6701 assert(pos < profile->ntimepoints);
6702 est = profile->timepoints[pos];
6704 else if( profile->loads[pos] + demand > profile->capacity )
6709 assert(profile->timepoints[pos] <= est);
6712 assert(pos < profile->ntimepoints);
6713 est = profile->timepoints[pos];
6717 int remainingduration;
6721 assert(pos < profile->ntimepoints - 1);
6723 remainingduration = duration - (profile->timepoints[pos+1] - est);
6727 if( remainingduration <= 0 )
6728 (*infeasible) =
FALSE;
6732 SCIPdebugMessage(
"remaining duration can%s be processed\n", *infeasible ?
"not" :
"");
6738 assert(pos < profile->ntimepoints);
6739 est = profile->timepoints[pos];
6758 int remainingduration;
6761 assert(profile != NULL);
6763 assert(pos < profile->ntimepoints);
6764 assert(duration > 0);
6769 remainingduration = duration;
6771 (*infeasible) =
TRUE;
6773 if( profile->
timepoints[endpos] < ect - duration )
6780 SCIPdebugMessage(
"profile <%p>: core does not fit at time point %d (pos %d)\n", (
void*)profile, profile->
timepoints[pos-1], pos-1);
6783 remainingduration = duration;
6785 if( profile->timepoints[endpos] < ect - duration )
6791 if( remainingduration <= 0 )
6793 *infeasible =
FALSE;
6820 assert(profile != NULL);
6823 assert(duration >= 0);
6824 assert(demand >= 0);
6825 assert(infeasible != NULL);
6829 if( duration == 0 || demand == 0 )
6831 *infeasible =
FALSE;
6835 ect = est + duration;
6836 lct = lst + duration;
6839 SCIPdebugMessage(
"profile <%p>: latest completion time %d does %s exist as time point (pos %d)\n", (
void*)profile, lct, found ?
"" :
"not", pos);
6844 assert(profile->timepoints[pos] == lct);
6847 assert(pos < profile->ntimepoints && pos >= 0);
6848 lct = profile->timepoints[pos];
6850 else if( profile->loads[pos] + demand > profile->capacity )
6855 assert(profile->timepoints[pos] < lct);
6858 assert(pos < profile->ntimepoints && pos >= 0);
6859 lct = profile->timepoints[pos];
6863 int remainingduration;
6866 assert(profile->timepoints[pos] < lct);
6868 remainingduration = duration - (lct - profile->timepoints[pos]);
6870 if( remainingduration <= 0 )
6871 (*infeasible) =
FALSE;
6880 assert(pos < profile->ntimepoints && pos >= 0);
6881 lct = profile->timepoints[pos];
6886 return lct - duration;
6900 assert(digraph != NULL);
6901 assert(blkmem != NULL);
6913 (*digraph)->nnodes =
nnodes;
6916 (*digraph)->blkmem = blkmem;
6917 (*digraph)->ncomponents = 0;
6918 (*digraph)->componentstartsize = 0;
6919 (*digraph)->components = NULL;
6920 (*digraph)->componentstarts = NULL;
6932 assert(digraph != NULL);
6933 assert(digraph->
blkmem != NULL);
6936 if( nnodes <= digraph->nnodes )
6947 for( n = digraph->
nnodes; n < nnodes; ++n )
6977 assert(sourcedigraph != NULL);
6978 assert(targetdigraph != NULL);
6981 if( targetblkmem == NULL )
6982 targetblkmem = sourcedigraph->
blkmem;
6984 assert(targetblkmem != NULL);
6988 nnodes = sourcedigraph->
nnodes;
6990 (*targetdigraph)->nnodes =
nnodes;
6991 (*targetdigraph)->ncomponents = ncomponents;
6992 (*targetdigraph)->blkmem = targetblkmem;
7000 for( i = 0; i <
nnodes; ++i )
7004 assert(sourcedigraph->
successors[i] != NULL);
7005 assert(sourcedigraph->
arcdata[i] != NULL);
7013 (*targetdigraph)->nodedata[i] = sourcedigraph->
nodedata[i];
7021 if( ncomponents > 0 )
7027 (*targetdigraph)->componentstartsize = ncomponents + 1;
7031 (*targetdigraph)->components = NULL;
7032 (*targetdigraph)->componentstarts = NULL;
7033 (*targetdigraph)->componentstartsize = 0;
7048 assert(digraph != NULL);
7049 assert(digraph->
nnodes > 0);
7050 blkmem = digraph->
blkmem;
7052 for( i = 0; i < digraph->
nnodes; ++i )
7072 assert(digraph != NULL);
7073 assert(*digraph != NULL);
7074 assert((*digraph)->blkmem != NULL);
7076 blkmem = (*digraph)->blkmem;
7077 digraphptr = *digraph;
7080 for( i = digraphptr->
nnodes - 1; i >= 0; --i )
7103 #define STARTSUCCESSORSSIZE 5 7115 assert(digraph != NULL);
7116 assert(digraph->
blkmem != NULL);
7118 assert(idx < digraph->
nnodes);
7119 assert(newsize > 0);
7123 blkmem = digraph->
blkmem;
7130 assert(digraph->
arcdata[idx] == NULL);
7138 assert(digraph->
arcdata[idx] != NULL);
7145 assert(newsize <= digraph->successorssize[idx]);
7161 assert(digraph != NULL);
7162 assert(startnode >= 0);
7163 assert(endnode >= 0);
7164 assert(startnode < digraph->
nnodes);
7165 assert(endnode < digraph->nnodes);
7192 assert(digraph != NULL);
7193 assert(startnode >= 0);
7194 assert(endnode >= 0);
7195 assert(startnode < digraph->
nnodes);
7196 assert(endnode < digraph->nnodes);
7201 for( i = 0; i < nsuccessors; ++i )
7202 if( digraph->
successors[startnode][i] == endnode )
7208 digraph->
successors[startnode][nsuccessors] = endnode;
7209 digraph->
arcdata[startnode][nsuccessors] = data;
7222 assert(digraph != NULL);
7224 assert(node < digraph->
nnodes);
7236 assert(digraph != NULL);
7247 assert(digraph != NULL);
7249 assert(node < digraph->
nnodes);
7264 assert(digraph != NULL);
7266 assert(node < digraph->
nnodes);
7279 assert(digraph != NULL);
7283 for( i = 0; i < digraph->
nnodes; ++i )
7295 assert(digraph != NULL);
7297 assert(node < digraph->
nnodes);
7310 assert(digraph != NULL);
7312 assert(node < digraph->
nnodes);
7328 assert(digraph != NULL);
7330 assert(node < digraph->
nnodes);
7333 assert(digraph->
arcdata != NULL);
7335 return digraph->
arcdata[node];
7346 int* stackadjvisited,
7354 assert(digraph != NULL);
7355 assert(startnode >= 0);
7356 assert(startnode < digraph->
nnodes);
7357 assert(visited != NULL);
7358 assert(visited[startnode] ==
FALSE);
7359 assert(dfsstack != NULL);
7360 assert(dfsnodes != NULL);
7361 assert(ndfsnodes != NULL);
7364 dfsstack[0] = startnode;
7365 stackadjvisited[0] = 0;
7368 while( stackidx >= 0 )
7374 currnode = dfsstack[stackidx];
7376 sadv = stackadjvisited[stackidx];
7377 assert( 0 <= sadv && sadv <= digraph->nsuccessors[currnode] );
7380 assert( visited[currnode] == (sadv > 0) );
7381 visited[currnode] =
TRUE;
7384 while( sadv < digraph->nsuccessors[currnode] && visited[digraph->
successors[currnode][sadv]] )
7393 dfsnodes[(*ndfsnodes)++] = currnode;
7398 assert( ! visited[digraph->
successors[currnode][sadv]] );
7401 stackadjvisited[stackidx] = sadv + 1;
7405 dfsstack[stackidx] = digraph->
successors[currnode][sadv];
7406 stackadjvisited[stackidx] = 0;
7407 assert( stackidx < digraph->nnodes );
7430 int* ndirectedsuccessors;
7431 int* stackadjvisited;
7441 assert(digraph != NULL);
7442 assert(digraph->
nnodes > 0);
7443 assert(digraph->
blkmem != NULL);
7445 blkmem = digraph->
blkmem;
7472 for( i = digraph->
nnodes - 1; i >= 0; --i )
7474 for( j = 0; j < ndirectedsuccessors[i]; ++j )
7480 for( v = 0; v < digraph->
nnodes; ++v )
7488 &digraph->
components[compstart], &ndfsnodes);
7491 if( ndfsnodes >= minsize )
7509 if( components != NULL )
7524 if( ncomponents != NULL )
7553 int* stackadjvisited = NULL;
7554 int* dfsstack = NULL;
7555 int* dfsnodes = NULL;
7564 assert(digraph != NULL);
7576 for( i = 0; i < ncomps; ++i )
7578 endidx = compstarts[i+1] - 1;
7580 for( j = compstarts[i]; j < compstarts[i+1]; ++j )
7582 if( visited[comps[j]] )
7589 depthFirstSearch(digraph, comps[j], visited, dfsstack, stackadjvisited, dfsnodes, &ndfsnodes);
7591 assert(endidx - ndfsnodes == compstarts[i] - 1);
7596 for( k = 0; k < ndfsnodes; ++k )
7598 digraph->
components[endidx - k] = dfsnodes[k];
7616 assert(digraph != NULL);
7633 assert(digraph != NULL);
7634 assert(compidx >= 0);
7635 assert(compidx < digraph->ncomponents);
7636 assert(nodes != NULL || nnodes != NULL);
7640 if( nnodes != NULL )
7658 int* strongcomponents,
7661 int* nstrongcomponents,
7662 int* strongcompstartidx,
7668 assert(digraph != NULL);
7670 assert(v < digraph->
nnodes);
7671 assert(lowlink != NULL);
7672 assert(dfsidx != NULL);
7673 assert(stack != NULL);
7674 assert(stacksize != NULL);
7675 assert(*stacksize >= 0);
7676 assert(*stacksize < digraph->nnodes);
7677 assert(unprocessed != NULL);
7678 assert(nodeinstack != NULL);
7679 assert(maxdfs != NULL);
7680 assert(strongcomponents != NULL);
7681 assert(nstrongcomponents != NULL);
7682 assert(strongcompstartidx != NULL);
7683 assert(nstorednodes != NULL);
7684 assert(*nstorednodes >= 0 && *nstorednodes < digraph->nnodes);
7686 dfsidx[v] = *maxdfs;
7687 lowlink[v] = *maxdfs;
7691 stack[*stacksize] = v;
7693 nodeinstack[v] =
TRUE;
7696 unprocessed[v] =
FALSE;
7705 if( unprocessed[w] )
7707 tarjan(digraph, w, lowlink, dfsidx, stack, stacksize, unprocessed, nodeinstack, maxdfs, strongcomponents,
7708 nstrongcomponents, strongcompstartidx, nstorednodes);
7710 assert(lowlink[v] >= 0 && lowlink[v] < digraph->
nnodes);
7711 assert(lowlink[w] >= 0 && lowlink[w] < digraph->
nnodes);
7714 lowlink[v] = MIN(lowlink[v], lowlink[w]);
7716 else if( nodeinstack[w] )
7718 assert(lowlink[v] >= 0 && lowlink[v] < digraph->
nnodes);
7719 assert(dfsidx[w] >= 0 && dfsidx[w] < digraph->
nnodes);
7722 lowlink[v] = MIN(lowlink[v], dfsidx[w]);
7727 if( lowlink[v] == dfsidx[v] )
7731 strongcompstartidx[*nstrongcomponents] = *nstorednodes;
7732 *nstrongcomponents += 1;
7736 assert(*stacksize > 0);
7739 w = stack[*stacksize - 1];
7741 nodeinstack[w] =
FALSE;
7744 strongcomponents[*nstorednodes] = w;
7760 int* strongcomponents,
7762 int* strongcompstartidx,
7764 int* nstrongcomponents
7779 assert(digraph != NULL);
7780 assert(compidx >= 0);
7781 assert(compidx < digraph->ncomponents);
7782 assert(strongcomponents != NULL);
7783 assert(strongcompstartidx != NULL);
7784 assert(nstrongcomponents != NULL);
7794 for( i = 0; i < digraph->
nnodes; ++i )
7799 unprocessed[i] =
TRUE;
7800 nodeinstack[i] =
FALSE;
7806 *nstrongcomponents = 0;
7809 for( i = digraph->
componentstarts[compidx]; i < digraph->componentstarts[compidx + 1]; ++i )
7814 assert(v >= 0 && v < digraph->
nnodes);
7817 if( unprocessed[v] )
7820 tarjan(digraph, v, lowlink, dfsidx, stack, &stacksize, unprocessed, nodeinstack, &maxdfs,
7821 strongcomponents, nstrongcomponents, strongcompstartidx, &nstorednodes);
7829 assert(*nstrongcomponents < digraph->
nnodes + 1);
7830 strongcompstartidx[*nstrongcomponents] = nstorednodes;
7851 assert(digraph != NULL);
7852 assert(digraph->
blkmem != NULL);
7854 blkmem = digraph->
blkmem;
7885 for( n = 0; n < digraph->
nnodes; ++n )
7896 for( m = 0; m < nsuccessors ; ++m )
7923 for( n = 0; n < digraph->
nnodes; ++n )
7932 for( n = 0; n < digraph->
nnodes; ++n )
7941 for( m = 0; m < nsuccessors; ++m )
7943 SCIPgmlWriteArc(file, (
unsigned int)n, (
unsigned int)successors[m], NULL, NULL);
7967 for( i = start; i < end; ++i )
7995 (*node)->parent = NULL;
7996 (*node)->left = NULL;
7997 (*node)->right = NULL;
7998 (*node)->dataptr = NULL;
8010 assert(tree != NULL);
8011 assert(node != NULL);
8015 assert((*node)->parent == NULL);
8016 assert((*node)->left == NULL);
8017 assert((*node)->right == NULL);
8020 (*node)->dataptr = dataptr;
8032 assert(tree != NULL);
8033 assert(node != NULL);
8034 assert(*node != NULL);
8036 assert((*node)->left == NULL);
8037 assert((*node)->right == NULL);
8041 if( (*node)->parent != NULL )
8043 assert(*node != NULL);
8045 assert((*node)->parent->left == *node || ((*node)->parent->right == *node));
8047 if( (*node)->parent->left == *node )
8049 (*node)->parent->left = NULL;
8053 assert((*node)->parent->right == *node);
8054 (*node)->parent->right = NULL;
8059 assert(*node != NULL);
8061 assert(*node == NULL);
8073 assert(tree != NULL);
8074 assert(node != NULL);
8075 assert(*node != NULL);
8077 if( (*node)->left != NULL )
8080 assert((*node)->left == NULL);
8083 if( (*node)->right != NULL )
8086 assert((*node)->right == NULL);
8090 assert(*node == NULL);
8101 #undef SCIPbtnodeGetData 8102 #undef SCIPbtnodeGetKey 8103 #undef SCIPbtnodeGetParent 8104 #undef SCIPbtnodeGetLeftchild 8105 #undef SCIPbtnodeGetRightchild 8106 #undef SCIPbtnodeGetSibling 8107 #undef SCIPbtnodeIsRoot 8108 #undef SCIPbtnodeIsLeaf 8109 #undef SCIPbtnodeIsLeftchild 8110 #undef SCIPbtnodeIsRightchild 8117 assert(node != NULL);
8127 assert(node != NULL);
8137 assert(node != NULL);
8147 assert(node != NULL);
8161 if( parent == NULL )
8177 assert(node != NULL);
8179 return (node->
parent == NULL);
8187 assert(node != NULL);
8189 return (node->
left == NULL && node->
right == NULL);
8237 assert(node != NULL);
8251 assert(node != NULL);
8265 assert(node != NULL);
8279 assert(node != NULL);
8281 node->
right = right;
8290 assert(tree != NULL);
8291 assert(blkmem != NULL);
8294 (*tree)->blkmem = blkmem;
8295 (*tree)->root = NULL;
8308 assert(tree != NULL);
8310 if( (*tree)->root != NULL )
8330 assert(node != NULL);
8335 SCIPgmlWriteNode(file, (
unsigned int)(
size_t)node, label,
"circle", NULL, NULL);
8344 SCIPgmlWriteArc(file, (
unsigned int)(
size_t)node, (
unsigned int)(
size_t)left, NULL, NULL);
8351 SCIPgmlWriteArc(file, (
unsigned int)(
size_t)node, (
unsigned int)(
size_t)right, NULL, NULL);
8370 assert(root != NULL);
8382 #undef SCIPbtIsEmpty 8383 #undef SCIPbtGetRoot 8390 assert(tree != NULL);
8392 return (tree->
root == NULL);
8400 assert(tree != NULL);
8414 assert(tree != NULL);
8440 onepluseps = one +
eps;
8442 while( onepluseps > one );
8460 while( !(val1 & 1) )
8474 while( !(val1 & 1) )
8482 while( !(val2 & 1) )
8495 while( !(val1 & 1) )
8498 else if( val1 < val2 )
8503 while( !(val2 & 1) )
8509 while( val1 != val2 )
8520 if( ((val1 ^ val2) & 2) == 2 )
8525 assert((val1 & 3) == 0);
8529 while( !(val1 & 1) )
8541 if( ((val2 ^ val1) & 2) == 2 )
8546 assert((val2 & 3) == 0);
8550 while( !(val2 & 1) )
8560 #if defined(_MSC_VER) && !defined(NO_NEXTAFTER) 8561 #define nextafter(x,y) _nextafter(x,y) 8578 #define __HI(x) *(1+(int*)&x) 8579 #define __LO(x) *(int*)&x 8580 #define __HIp(x) *(1+(int*)x) 8581 #define __LOp(x) *(int*)x 8584 double nextafter(
double x,
double y)
8604 if( ((ix>=0x7ff00000) && ((ix-0x7ff00000)|lx) != 0 ) ||
8605 ( (iy>=0x7ff00000) && ((iy-0x7ff00000)|ly) != 0 ))
8617 __HI(x) = hy&0x80000000;
8630 if( hx > hy || ((hx == hy) && (lx > ly)) )
8647 if( hy >= 0 || hx > hy || ((hx == hy) && (lx > ly)) )
8664 if( hy >= 0x7ff00000 )
8666 if( hy < 0x00100000 )
8696 return nextafter(from, to);
8712 return val1/gcd * val2;
8715 static const SCIP_Real simplednoms[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0,
8716 17.0, 18.0, 19.0, 25.0, -1.0};
8743 assert(mindelta < 0.0);
8744 assert(maxdelta > 0.0);
8745 assert(nominator != NULL);
8746 assert(denominator != NULL);
8751 for( i = 0; simplednoms[i] > 0.0; ++i )
8759 dnom = simplednoms[i];
8760 while( dnom <= maxdnom )
8762 nom = floor(val * dnom);
8764 ratval1 = (nom+1.0)/dnom;
8765 if( mindelta <= val - ratval0 && val - ratval1 <= maxdelta )
8767 if( val - ratval0 <= maxdelta )
8773 if( mindelta <= val - ratval1 )
8785 epsilon = MIN(-mindelta, maxdelta)/2.0;
8793 delta0 = val - g0/h0;
8794 delta1 = (delta0 < 0.0 ? val - (g0-1.0)/h0 : val - (g0+1.0)/h0);
8796 while( (delta0 < mindelta || delta0 > maxdelta) && (delta1 < mindelta || delta1 > maxdelta) )
8798 assert(
EPSGT(b, a, epsilon));
8818 delta0 = val - g0/h0;
8819 delta1 = (delta0 < 0.0 ? val - (g0-1.0)/h0 : val - (g0+1.0)/h0);
8827 if( delta0 < mindelta )
8829 assert(mindelta <= delta1 && delta1 <= maxdelta);
8833 else if( delta0 > maxdelta )
8835 assert(mindelta <= delta1 && delta1 <= maxdelta);
8844 assert(*denominator >= 1);
8864 assert(mindelta <= 0.0);
8865 assert(maxdelta >= 0.0);
8867 sval = val * scalar;
8868 downval = floor(sval);
8907 assert(vals != NULL);
8909 assert(maxdnom >= 1);
8910 assert(mindelta < 0.0);
8911 assert(maxdelta > 0.0);
8912 assert(success != NULL);
8914 SCIPdebugMessage(
"trying to find rational representation for given values\n");
8916 if( intscalar != NULL )
8922 for( c = 0; c < nvals; ++c )
8925 if( val < mindelta || val > maxdelta )
8928 minval = MIN(minval, absval);
8935 if( intscalar != NULL )
8942 assert(minval > MIN(-mindelta, maxdelta));
8946 for( i = 0; i < 2; ++i )
8952 scaleval = 1.0/minval;
8957 for( c = 0; c < nvals && scalable; ++c )
8965 while( scaleval <= maxscale
8966 && (absval * scaleval < 0.5 || !
isIntegralScalar(val, scaleval, mindelta, maxdelta)) )
8972 scaleval *= scalars[s];
8979 scalable = (scaleval <= maxscale);
8980 SCIPdebugMessage(
" -> val=%g, scaleval=%g, val*scaleval=%g, scalable=%u\n",
8981 val, scaleval, val*scaleval, scalable);
8986 assert(scaleval <= maxscale);
8989 if( scaleval < bestscalar )
8990 bestscalar = scaleval;
8992 SCIPdebugMessage(
" -> integrality could be achieved by scaling with %g\n", scaleval);
8997 if( intscalar != NULL )
8998 *intscalar = bestscalar;
9014 for( c = 0; c < nvals && rational; ++c )
9020 rational =
SCIPrealToRational(val, mindelta, maxdelta, maxdnom, &nominator, &denominator);
9021 if( rational && nominator != 0 )
9023 assert(denominator > 0);
9024 gcd = ABS(nominator);
9027 SCIPdebugMessage(
" -> c=%d first rational: val: %g == %" SCIP_LONGINT_FORMAT
"/%" SCIP_LONGINT_FORMAT
", gcd=%" SCIP_LONGINT_FORMAT
", scm=%" SCIP_LONGINT_FORMAT
", rational=%u\n",
9028 c, val, nominator, denominator, gcd, scm, rational);
9034 for( ++c; c < nvals && rational; ++c )
9040 rational =
SCIPrealToRational(val, mindelta, maxdelta, maxdnom, &nominator, &denominator);
9041 if( rational && nominator != 0 )
9043 assert(denominator > 0);
9047 SCIPdebugMessage(
" -> c=%d next rational : val: %g == %" SCIP_LONGINT_FORMAT
"/%" SCIP_LONGINT_FORMAT
", gcd=%" SCIP_LONGINT_FORMAT
", scm=%" SCIP_LONGINT_FORMAT
", rational=%u\n",
9048 c, val, nominator, denominator, gcd, scm, rational);
9052 SCIPdebugMessage(
" -> failed to convert %g into a rational representation\n", val);
9065 SCIPdebugMessage(
" -> integrality could be achieved by scaling with %g (rational:%" SCIP_LONGINT_FORMAT
"/%" SCIP_LONGINT_FORMAT
")\n",
9071 if( intscalar != NULL )
9072 *intscalar = bestscalar;
9075 SCIPdebugMessage(
" -> smallest value to achieve integrality is %g \n", bestscalar);
9098 center = 0.5*(lb+ub);
9110 delta = 0.5*(ub-lb);
9116 delta = 0.5*(ub-lb);
9147 SCIPdebugPrintf(
" %" SCIP_LONGINT_FORMAT
"/%" SCIP_LONGINT_FORMAT
" == %.9f\n", nominator, denominator, val);
9149 if( val - lb < 0.0 || val - ub > 0.0 )
9151 SCIPdebugPrintf(
" value is out of interval bounds by %g -> failed\n",
MAX(lb-val, val-ub));
9171 #if defined(NO_RAND_R) || defined(_WIN32) || defined(_WIN64) 9173 #define SCIP_RAND_MAX 32767 9182 assert(seedp != NULL);
9184 nextseed = (*seedp) * (
SCIP_Longint)1103515245 + 12345;
9185 *seedp = (
unsigned int)nextseed;
9192 #define SCIP_RAND_MAX RAND_MAX 9200 return rand_r(seedp);
9216 assert(randnumber >= 0.0);
9217 assert(randnumber < 1.0);
9222 return (
int) (minrandval*(1.0 - randnumber) + maxrandval*randnumber + randnumber);
9236 assert(randnumber >= 0.0);
9237 assert(randnumber <= 1.0);
9242 return minrandval*(1.0 - randnumber) + maxrandval*randnumber;
9273 #define DEFAULT_SEED UINT32_C(123456789) 9274 #define DEFAULT_XOR UINT32_C(362436000) 9275 #define DEFAULT_MWC UINT32_C(521288629) 9276 #define DEFAULT_CST UINT32_C(7654321) 9282 unsigned int initseed
9285 assert(randnumgen != NULL);
9293 assert(randnumgen->
seed > 0);
9318 randnumgen->
seed = (uint32_t) (randnumgen->
seed * UINT64_C(1103515245) + UINT64_C(12345));
9327 randnumgen->
cst_seed = (uint32_t) (t >> 32);
9328 randnumgen->
mwc_seed = (uint32_t) t;
9337 unsigned int initialseed
9340 assert(randnumgen != NULL);
9355 assert(randnumgen != NULL);
9356 assert((*randnumgen) != NULL);
9376 assert(randnumber >= 0.0);
9377 assert(randnumber < 1.0);
9397 assert(randnumber >= 0.0);
9398 assert(randnumber <= 1.0);
9403 return minrandval*(1.0 - randnumber) + maxrandval*randnumber;
9422 while( end > begin+1 )
9431 array[i] = array[end];
9452 while( end > begin+1 )
9461 array[i] = array[end];
9481 if( nelems == nsubelems)
9488 if( nsubelems > nelems )
9490 SCIPerrorMessage(
"Cannot create %d-elementary subset of %d-elementary set.\n", nsubelems, nelems);
9494 for( i = 0; i < nsubelems; i++ )
9495 for( j = 0; j < i; j++ )
9496 assert(
set[i] !=
set[j]);
9501 while( i < nsubelems )
9509 for( j = 0; j < i; j++ )
9511 if( subset[i] == subset[j] )
9535 if( m == 0 || m >= n )
9559 if( m > 16 || n > 33 )
9564 return (n*(n-1)*(n-2)/6);
9573 1166803110, 601080390, 1037158320, 565722720, 300540195, 155117520, 818809200, 471435600, 265182525, 145422675,
9574 77558760, 40116600, 573166440, 347373600, 206253075, 119759850, 67863915, 37442160, 20058300, 10400600,
9575 354817320, 225792840, 141120525, 86493225, 51895935, 30421755, 17383860, 9657700, 5200300, 2704156, 193536720,
9576 129024480, 84672315, 54627300, 34597290, 21474180, 13037895, 7726160, 4457400, 2496144, 1352078, 705432,
9577 92561040, 64512240, 44352165, 30045015, 20030010, 13123110, 8436285, 5311735, 3268760, 1961256, 1144066,
9578 646646, 352716, 184756, 38567100, 28048800, 20160075, 14307150, 10015005, 6906900, 4686825, 3124550, 2042975,
9579 1307504, 817190, 497420, 293930, 167960, 92378, 48620, 13884156, 10518300, 7888725, 5852925, 4292145, 3108105,
9580 2220075, 1562275, 1081575, 735471, 490314, 319770, 203490, 125970, 75582, 43758, 24310, 12870, 4272048, 3365856,
9581 2629575, 2035800, 1560780, 1184040, 888030, 657800, 480700, 346104, 245157, 170544, 116280, 77520, 50388, 31824,
9582 19448, 11440, 6435, 3432, 1107568, 906192, 736281, 593775, 475020, 376740, 296010, 230230, 177100, 134596,
9583 100947, 74613, 54264, 38760, 27132, 18564, 12376, 8008, 5005, 3003, 1716, 924, 237336, 201376, 169911, 142506,
9584 118755, 98280, 80730, 65780, 53130, 42504, 33649, 26334, 20349, 15504, 11628, 8568, 6188, 4368, 3003, 2002,
9585 1287, 792, 462, 252, 40920, 35960, 31465, 27405, 23751, 20475, 17550, 14950, 12650, 10626, 8855, 7315, 5985,
9586 4845, 3876, 3060, 2380, 1820, 1365, 1001, 715, 495, 330, 210, 126, 70};
9594 assert(t*(t+1)+(33-n) < 182);
9596 return binoms[t*(t+1)+(33-n)];
9647 *pointer1 = *pointer2;
9670 while( end > begin+1 )
9679 array[i] = array[end];
9704 while( end > begin+1 )
9713 array[i] = array[end];
9735 if( nelems == nsubelems)
9742 if( nsubelems > nelems )
9744 SCIPerrorMessage(
"Cannot create %d-elementary subset of %d-elementary set.\n", nsubelems, nelems);
9748 for( i = 0; i < nsubelems; i++ )
9749 for( j = 0; j < i; j++ )
9750 assert(
set[i] !=
set[j]);
9755 while( i < nsubelems )
9763 for( j = 0; j < i; j++ )
9765 if( subset[i] == subset[j] )
9787 int* intersectarray,
9789 int* nintersectarray
9798 assert( array1 != NULL );
9799 assert( array2 != NULL );
9800 assert( intersectarray != NULL );
9801 assert( nintersectarray != NULL );
9804 for (v1 = 0; v1 < narray1; ++v1)
9806 assert( v1 == 0 || array1[v1] >= array1[v1-1] );
9809 if ( v1+1 < narray1 && array1[v1] == array1[v1+1])
9812 for (v2 = k; v2 < narray2; ++v2)
9814 assert( v2 == 0 || array2[v2] >= array2[v2-1] );
9816 if ( array2[v2] > array1[v1] )
9821 else if ( array2[v2] == array1[v1] )
9823 intersectarray[cnt++] = array2[v2];
9831 *nintersectarray = cnt;
9853 assert( array1 != NULL );
9854 assert( array2 != NULL );
9855 assert( setminusarray != NULL );
9856 assert( nsetminusarray != NULL );
9858 while ( v1 < narray1 )
9862 assert( v1 == 0 || array1[v1] >= array1[v1-1] );
9865 while ( v1 + 1 < narray1 && array1[v1] == array1[v1 + 1] )
9868 entry1 = array1[v1];
9870 while ( v2 < narray2 && array2[v2] < entry1 )
9873 if ( v2 >= narray2 || entry1 < array2[v2] )
9874 setminusarray[cnt++] = entry1;
9879 *nsetminusarray = cnt;
9902 if( dest == NULL || src == NULL || cnt == 0 )
9906 char* destination = dest;
9908 while( cnt-- && (*destination++ = *src++) != stop );
9910 return (
int)(destination - dest);
9924 #ifdef NO_STRERROR_R 9929 #if defined(_WIN32) || defined(_WIN64) 9934 #elif (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! defined(_GNU_SOURCE) 9954 else if( errordescr != NULL )
9976 return strtok(s, delim);
9978 return strtok_r(s, delim, ptrptr);
9994 assert(bufsize > 0);
9996 len = (int)strlen(s);
9997 for( p = 0, i = 0; i <= len && p < bufsize; ++i, ++p )
9999 if( s[i] ==
' ' || s[i] ==
'"' || s[i] ==
'\'' )
10007 t[bufsize-1] =
'\0';
10026 #if defined(_WIN32) || defined(_WIN64) 10027 n = _vsnprintf(t, (
size_t) len, s, ap);
10029 n = vsnprintf(t, (
size_t) len, s, ap);
10033 if( n < 0 || n >= len )
10057 assert(str != NULL);
10058 assert(value != NULL);
10059 assert(endptr != NULL);
10064 *value = (int) strtol(str, endptr, 10);
10066 if( *endptr != str && *endptr != NULL )
10071 *endptr = (
char*)str;
10088 assert(str != NULL);
10089 assert(value != NULL);
10090 assert(endptr != NULL);
10095 *value = strtod(str, endptr);
10097 if( *endptr != str && *endptr != NULL )
10102 *endptr = (
char*)str;
10121 const char* copystr;
10124 assert(str != NULL);
10125 assert(token != NULL);
10127 assert(endptr != NULL);
10134 while( *str !=
'\0' && *str != startchar )
10140 *endptr = (
char*)copystr;
10148 while( *str !=
'\0' && *str != endchar && nchars < size-1 )
10151 token[nchars] = *str;
10157 token[nchars] =
'\0';
10160 if( nchars == (size-1) )
10161 while( *str !=
'\0' && *str != endchar )
10167 *endptr = (
char*)copystr;
10176 *endptr = (
char*) str;
10185 const char* filename
10190 f = fopen(filename,
"r");
10209 char* lastbackslash;
10212 assert(filename != NULL);
10218 if( extension != NULL )
10220 if( compression != NULL )
10221 *compression = NULL;
10224 lastslash = strrchr(filename,
'/');
10225 lastbackslash = strrchr(filename,
'\\');
10226 lastslash =
MAX(lastslash, lastbackslash);
10227 lastdot = strrchr(filename,
'.');
10228 if( lastslash != NULL && lastdot != NULL && lastdot < lastslash )
10233 if( lastdot != NULL )
10237 compext = lastdot+1;
10238 if( strcmp(compext,
"gz") == 0
10239 || strcmp(compext,
"z") == 0
10240 || strcmp(compext,
"Z") == 0 )
10242 if( compression != NULL )
10243 *compression = compext;
10248 lastdot = strrchr(filename,
'.');
10249 if( lastslash != NULL && lastdot != NULL && lastdot < lastslash )
10254 if( lastslash == NULL )
10264 *name = lastslash+1;
10268 if( lastdot != NULL )
10270 if( extension != NULL )
10271 *extension = lastdot+1;
10300 quot = MAX3(1.0, absval1, absval2);
10302 return (val1-val2)/quot;
10314 if(
EPSEQ(primalbound, dualbound, eps) )
10316 else if(
EPSZ(dualbound, eps) ||
10317 EPSZ(primalbound, eps) ||
10318 REALABS(primalbound) >= inf ||
10320 primalbound * dualbound < 0.0 )
10327 return REALABS((primalbound - dualbound)/MIN(absdual, absprimal));
10342 assert(djset != NULL);
10343 assert(blkmem != NULL);
10346 assert(ncomponents > 0);
10350 (*djset)->size = ncomponents;
10370 djset->
sizes[i] = 1;
10382 int root = element;
10383 int* parents = djset->
parents;
10386 while( root != parents[root] )
10388 root = parents[root];
10392 while( element != root )
10394 newelement = parents[element];
10395 parents[element] = root;
10396 element = newelement;
10415 assert(djset != NULL);
10418 assert(djset->
size > p);
10419 assert(djset->
size > q);
10429 sizes = djset->
sizes;
10434 parents[idq] = idp;
10435 sizes[idp] += sizes[idq];
10439 if( sizes[idp] < sizes[idq] )
10441 parents[idp] = idq;
10442 sizes[idq] += sizes[idp];
10446 parents[idq] = idp;
10447 sizes[idp] += sizes[idq];
10462 assert(djset != NULL);
10463 assert(*djset != NULL);
10478 assert(djset != NULL);
10488 assert(djset != NULL);
10490 return djset->
size;
void SCIPmultihashFree(SCIP_MULTIHASH **multihash)
void SCIPpermuteArray(void **array, int begin, int end, unsigned int *randseed)
SCIP_RETCODE SCIPbtnodeCreate(SCIP_BT *tree, SCIP_BTNODE **node, void *dataptr)
int SCIPrealarrayGetMaxIdx(SCIP_REALARRAY *realarray)
void ** SCIPdigraphGetSuccessorsData(SCIP_DIGRAPH *digraph, int node)
int SCIPpqueueNElems(SCIP_PQUEUE *pqueue)
static void regressionRecompute(SCIP_REGRESSION *regression)
void SCIPbtnodeFree(SCIP_BT *tree, SCIP_BTNODE **node)
void * SCIPhashmapEntryGetImage(SCIP_HASHMAPENTRY *entry)
SCIP_Real SCIPnormalGetCriticalValue(SCIP_CONFIDENCELEVEL clevel)
static void * multihashlistRetrieveNext(SCIP_MULTIHASHLIST **multihashlist, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr, uint64_t keyval, void *key)
#define BMSfreeBlockMemoryArrayNull(mem, ptr, num)
static SCIP_Bool hashmapLookup(SCIP_HASHMAP *hashmap, void *origin, uint32_t *pos)
int SCIPmemccpy(char *dest, const char *src, char stop, unsigned int cnt)
SCIP_Real SCIPerf(SCIP_Real x)
static SCIP_Bool multihashlistRemove(SCIP_MULTIHASHLIST **multihashlist, BMS_BLKMEM *blkmem, void *element)
void SCIPhashmapEntrySetImageReal(SCIP_HASHMAPENTRY *entry, SCIP_Real image)
static SCIP_RETCODE hashmapCheckLoad(SCIP_HASHMAP *hashmap)
#define BMSfreeMemoryArrayNull(ptr)
SCIP_RETCODE SCIPhashsetRemove(SCIP_HASHSET *hashset, void *element)
static const int nscalars
static SCIP_RETCODE hashmapInsert(SCIP_HASHMAP *hashmap, void *origin, SCIP_HASHMAPIMAGE image, uint32_t hashval, SCIP_Bool override)
void SCIPdisjointsetUnion(SCIP_DISJOINTSET *djset, int p, int q, SCIP_Bool forcerepofp)
void * SCIPhashtableGetEntry(SCIP_HASHTABLE *hashtable, int entryidx)
void SCIPsparseSolGetFirstSol(SCIP_SPARSESOL *sparsesol, SCIP_Longint *sol, int nvars)
SCIP_BTNODE * SCIPbtnodeGetSibling(SCIP_BTNODE *node)
SCIP_RETCODE SCIPprofileDeleteCore(SCIP_PROFILE *profile, int left, int right, int demand)
void * SCIPbtnodeGetData(SCIP_BTNODE *node)
void SCIPsortInd(int *indarray, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
SCIP_DECL_HASHKEYVAL(SCIPhashKeyValString)
void SCIPdigraphFreeComponents(SCIP_DIGRAPH *digraph)
int SCIPhashsetGetNElements(SCIP_HASHSET *hashset)
SCIP_RETCODE SCIPintarrayIncVal(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, int incval)
static SCIP_RETCODE multihashlistAppend(SCIP_MULTIHASHLIST **multihashlist, BMS_BLKMEM *blkmem, void *element)
void ** SCIPhashsetGetSlots(SCIP_HASHSET *hashset)
static uint32_t hashSetDesiredPos(SCIP_HASHSET *hashset, void *element)
static SCIP_RETCODE hashtableCheckLoad(SCIP_HASHTABLE *hashtable)
void SCIPgmlWriteArc(FILE *file, unsigned int source, unsigned int target, const char *label, const char *color)
SCIP_RETCODE SCIPdigraphComputeUndirectedComponents(SCIP_DIGRAPH *digraph, int minsize, int *components, int *ncomponents)
int SCIPintarrayGetMinIdx(SCIP_INTARRAY *intarray)
SCIP_RETCODE SCIPrealarrayCreate(SCIP_REALARRAY **realarray, BMS_BLKMEM *blkmem)
static SCIP_RETCODE btnodeCreateEmpty(SCIP_BT *tree, SCIP_BTNODE **node)
SCIP_RETCODE SCIPintarrayCopy(SCIP_INTARRAY **intarray, BMS_BLKMEM *blkmem, SCIP_INTARRAY *sourceintarray)
SCIP_Bool SCIPboolarrayGetVal(SCIP_BOOLARRAY *boolarray, int idx)
#define SCIP_CALL_FINALLY(x, y)
int * SCIPdigraphGetSuccessors(SCIP_DIGRAPH *digraph, int node)
static SCIP_RETCODE ensureSuccessorsSize(SCIP_DIGRAPH *digraph, int idx, int newsize)
SCIP_RETCODE SCIPqueueInsert(SCIP_QUEUE *queue, void *elem)
static SCIP_RETCODE doProfileCreate(SCIP_PROFILE **profile, int capacity)
void SCIPgmlWriteNode(FILE *file, unsigned int id, const char *label, const char *nodetype, const char *fillcolor, const char *bordercolor)
void SCIPsplitFilename(char *filename, char **path, char **name, char **extension, char **compression)
void * SCIPhashmapEntryGetOrigin(SCIP_HASHMAPENTRY *entry)
SCIP_Bool SCIPsparseSolGetNextSol(SCIP_SPARSESOL *sparsesol, SCIP_Longint *sol, int nvars)
int SCIPprofileGetTime(SCIP_PROFILE *profile, int pos)
SCIP_RETCODE SCIPmultihashCreate(SCIP_MULTIHASH **multihash, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
int SCIPintarrayGetVal(SCIP_INTARRAY *intarray, int idx)
void SCIPgmlWriteClosing(FILE *file)
static int calcGrowSize(int initsize, SCIP_Real growfac, int num)
void SCIPswapPointers(void **pointer1, void **pointer2)
void SCIPbtnodeSetRightchild(SCIP_BTNODE *node, SCIP_BTNODE *right)
void SCIPintervalSetRoundingMode(SCIP_ROUNDMODE roundmode)
void * SCIPptrarrayGetVal(SCIP_PTRARRAY *ptrarray, int idx)
static SCIP_RETCODE hashtableInsert(SCIP_HASHTABLE *hashtable, void *element, void *key, uint32_t hashval, SCIP_Bool override)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
static const SCIP_Real studentt_quartilesabove[]
int SCIPboolarrayGetMaxIdx(SCIP_BOOLARRAY *boolarray)
SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
int SCIPprofileGetEarliestFeasibleStart(SCIP_PROFILE *profile, int est, int lst, int duration, int demand, SCIP_Bool *infeasible)
#define SCIP_MULTIHASH_MAXSIZE
miscellaneous datastructures
int SCIPsnprintf(char *t, int len, const char *s,...)
void SCIPrandomPermuteArray(SCIP_RANDNUMGEN *randnumgen, void **array, int begin, int end)
SCIP_RETCODE SCIPhashsetCreate(SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem, int size)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPdigraphSetSizes(SCIP_DIGRAPH *digraph, int *sizes)
void SCIPdigraphPrintComponents(SCIP_DIGRAPH *digraph, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
SCIP_VAR * SCIPactivityGetVar(SCIP_RESOURCEACTIVITY *activity)
SCIP_RETCODE SCIPptrarrayExtend(SCIP_PTRARRAY *ptrarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
void * SCIPpqueueFirst(SCIP_PQUEUE *pqueue)
SCIP_RETCODE SCIPboolarrayCopy(SCIP_BOOLARRAY **boolarray, BMS_BLKMEM *blkmem, SCIP_BOOLARRAY *sourceboolarray)
SCIPInterval exp(const SCIPInterval &x)
SCIP_Bool SCIPhashsetExists(SCIP_HASHSET *hashset, void *element)
SCIP_Real SCIPregressionGetIntercept(SCIP_REGRESSION *regression)
void SCIPhashtableClear(SCIP_HASHTABLE *hashtable)
SCIP_RETCODE SCIPcomputeArraysIntersection(int *array1, int narray1, int *array2, int narray2, int *intersectarray, int *nintersectarray)
#define BMSallocMemoryArray(ptr, num)
void SCIPregressionAddObservation(SCIP_REGRESSION *regression, SCIP_Real x, SCIP_Real y)
void SCIPswapReals(SCIP_Real *value1, SCIP_Real *value2)
int SCIPdigraphGetNComponents(SCIP_DIGRAPH *digraph)
static SCIP_MULTIHASHLIST * multihashlistFind(SCIP_MULTIHASHLIST *multihashlist, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr, uint64_t keyval, void *key)
SCIP_Bool SCIPstrToIntValue(const char *str, int *value, char **endptr)
#define SCIP_MULTIHASH_RESIZE_PERCENTAGE
void SCIPpqueueFree(SCIP_PQUEUE **pqueue)
SCIP_RETCODE SCIPprofileInsertCore(SCIP_PROFILE *profile, int left, int right, int demand, int *pos, SCIP_Bool *infeasible)
int SCIPrandomGetInt(SCIP_RANDNUMGEN *randnumgen, int minrandval, int maxrandval)
SCIP_Real SCIPselectSimpleValue(SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom)
void SCIPdigraphGetComponent(SCIP_DIGRAPH *digraph, int compidx, int **nodes, int *nnodes)
SCIP_Bool SCIPhashmapIsEmpty(SCIP_HASHMAP *hashmap)
int SCIPdisjointsetGetSize(SCIP_DISJOINTSET *djset)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
int SCIPptrarrayGetMinIdx(SCIP_PTRARRAY *ptrarray)
SCIP_Bool SCIPqueueIsEmpty(SCIP_QUEUE *queue)
#define BMSfreeMemory(ptr)
SCIP_Real SCIPnegateReal(SCIP_Real x)
void SCIPsortDown(int *perm, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len)
SCIP_MULTIHASHLIST ** lists
template functions for sorting
int SCIPprofileGetLoad(SCIP_PROFILE *profile, int pos)
SCIP_Real SCIPhashmapGetImageReal(SCIP_HASHMAP *hashmap, void *origin)
int SCIPhashsetGetNSlots(SCIP_HASHSET *hashset)
SCIP_RETCODE SCIPdigraphTopoSortComponents(SCIP_DIGRAPH *digraph)
#define SCIP_MULTIHASH_GROW_FACTOR
int SCIPrealarrayGetMinIdx(SCIP_REALARRAY *realarray)
SCIP_Bool SCIPbtnodeIsRoot(SCIP_BTNODE *node)
void SCIPmultihashRemoveAll(SCIP_MULTIHASH *multihash)
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
SCIP_RETCODE SCIPboolarraySetVal(SCIP_BOOLARRAY *boolarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Bool val)
#define SCIP_DEFAULT_EPSILON
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Longint SCIPmultihashGetNElements(SCIP_MULTIHASH *multihash)
SCIP_Bool SCIPhashsetIsEmpty(SCIP_HASHSET *hashset)
SCIP_Bool SCIPfileExists(const char *filename)
void SCIPqueueClear(SCIP_QUEUE *queue)
int SCIPdigraphGetNNodes(SCIP_DIGRAPH *digraph)
int SCIPprofileGetCapacity(SCIP_PROFILE *profile)
SCIP_RETCODE SCIPintarrayFree(SCIP_INTARRAY **intarray)
SCIP_Bool SCIPrealToRational(SCIP_Real val, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Longint *nominator, SCIP_Longint *denominator)
void SCIPsortedvecInsertIntInt(int *intarray1, int *intarray2, int keyval, int field1val, int *len, int *pos)
SCIP_RETCODE SCIPrealarrayIncVal(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Real incval)
SCIP_RETCODE SCIPactivityCreate(SCIP_RESOURCEACTIVITY **activity, SCIP_VAR *var, int duration, int demand)
void SCIPregressionRemoveObservation(SCIP_REGRESSION *regression, SCIP_Real x, SCIP_Real y)
SCIP_DECL_HASHKEYEQ(SCIPhashKeyEqString)
void SCIPsortDownInd(int *indarray, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len)
static const int studentt_maxdf
void SCIPhashsetRemoveAll(SCIP_HASHSET *hashset)
void SCIPdisjointsetClear(SCIP_DISJOINTSET *djset)
enum SCIP_Confidencelevel SCIP_CONFIDENCELEVEL
#define BMSduplicateBlockMemoryArray(mem, ptr, source, num)
SCIP_RETCODE SCIPrealarrayCopy(SCIP_REALARRAY **realarray, BMS_BLKMEM *blkmem, SCIP_REALARRAY *sourcerealarray)
SCIP_Longint * SCIPsparseSolGetLbs(SCIP_SPARSESOL *sparsesol)
int SCIPqueueNElems(SCIP_QUEUE *queue)
#define BMSfreeMemoryArray(ptr)
SCIP_Bool SCIPmultihashExists(SCIP_MULTIHASH *multihash, void *element)
SCIP_BTNODE * SCIPbtnodeGetParent(SCIP_BTNODE *node)
SCIP_RETCODE SCIPdigraphSetNSuccessors(SCIP_DIGRAPH *digraph, int node, int nsuccessors)
void SCIPmessagePrintError(const char *formatstr,...)
void SCIPhashmapPrintStatistics(SCIP_HASHMAP *hashmap, SCIP_MESSAGEHDLR *messagehdlr)
int SCIPactivityGetEnergy(SCIP_RESOURCEACTIVITY *activity)
interval arithmetics for provable bounds
static SCIP_RETCODE multihashResize(SCIP_MULTIHASH *multihash)
int SCIPhashmapGetNEntries(SCIP_HASHMAP *hashmap)
SCIP_HASHMAPENTRY * SCIPhashmapGetEntry(SCIP_HASHMAP *hashmap, int entryidx)
void SCIPdisjointsetFree(SCIP_DISJOINTSET **djset, BMS_BLKMEM *blkmem)
void SCIPbtnodeSetLeftchild(SCIP_BTNODE *node, SCIP_BTNODE *left)
SCIP_RETCODE SCIPboolarrayCreate(SCIP_BOOLARRAY **boolarray, BMS_BLKMEM *blkmem)
void * SCIPdigraphGetNodeData(SCIP_DIGRAPH *digraph, int node)
void SCIPhashsetFree(SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem)
#define BMSmoveMemoryArray(ptr, source, num)
SCIPInterval sqrt(const SCIPInterval &x)
SCIP_Real SCIPrealarrayGetVal(SCIP_REALARRAY *realarray, int idx)
void SCIPdigraphSetNodeData(SCIP_DIGRAPH *digraph, void *dataptr, int node)
void SCIPescapeString(char *t, int bufsize, const char *s)
void SCIPhashmapEntrySetImage(SCIP_HASHMAPENTRY *entry, void *image)
int SCIPintarrayGetMaxIdx(SCIP_INTARRAY *intarray)
void SCIPstrCopySection(const char *str, char startchar, char endchar, char *token, int size, char **endptr)
SCIPInterval sign(const SCIPInterval &x)
SCIP_RETCODE SCIPdigraphCreate(SCIP_DIGRAPH **digraph, BMS_BLKMEM *blkmem, int nnodes)
SCIP_RETCODE SCIPmultihashSafeInsert(SCIP_MULTIHASH *multihash, void *element)
static int profileFindFeasibleStart(SCIP_PROFILE *profile, int pos, int lst, int duration, int demand, SCIP_Bool *infeasible)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void SCIPdigraphPrint(SCIP_DIGRAPH *digraph, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
#define BMSallocClearBlockMemoryArray(mem, ptr, num)
internal miscellaneous methods
SCIP_RETCODE SCIPboolarrayClear(SCIP_BOOLARRAY *boolarray)
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem)
void SCIPactivityFree(SCIP_RESOURCEACTIVITY **activity)
void SCIPrandomSetSeed(SCIP_RANDNUMGEN *randnumgen, unsigned int initseed)
int SCIPdisjointsetFind(SCIP_DISJOINTSET *djset, int element)
void SCIPgmlWriteEdge(FILE *file, unsigned int source, unsigned int target, const char *label, const char *color)
int SCIPptrarrayGetMaxIdx(SCIP_PTRARRAY *ptrarray)
#define SCIPhashTwo(a, b)
static SCIP_RETCODE profileUpdate(SCIP_PROFILE *profile, int left, int right, int demand, int *pos, SCIP_Bool *infeasible)
void SCIPmessagePrintInfo(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
void SCIPhashtableRemoveAll(SCIP_HASHTABLE *hashtable)
SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPintarraySetVal(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, int val)
SCIP_RETCODE SCIPprofileCreate(SCIP_PROFILE **profile, int capacity)
static SCIP_RETCODE ensureProfileSize(SCIP_PROFILE *profile, int neededsize)
void SCIPqueueFree(SCIP_QUEUE **queue)
SCIP_RETCODE SCIPdigraphAddArc(SCIP_DIGRAPH *digraph, int startnode, int endnode, void *data)
SCIP_Bool SCIPbtnodeIsRightchild(SCIP_BTNODE *node)
SCIP_Real SCIPmultihashGetLoad(SCIP_MULTIHASH *multihash)
void * SCIPpqueueRemove(SCIP_PQUEUE *pqueue)
int SCIPdisjointsetGetComponentCount(SCIP_DISJOINTSET *djset)
SCIP_RETCODE SCIPgetRandomSubset(void **set, int nelems, void **subset, int nsubelems, unsigned int randseed)
SCIP_Bool SCIPsortedvecFindInt(int *intarray, int val, int len, int *pos)
SCIP_BTNODE * SCIPbtGetRoot(SCIP_BT *tree)
#define BMSduplicateMemoryArray(ptr, source, num)
SCIP_RETCODE SCIPhashmapInsertReal(SCIP_HASHMAP *hashmap, void *origin, SCIP_Real image)
void SCIPregressionFree(SCIP_REGRESSION **regression)
SCIP_RETCODE SCIPcomputeArraysSetminus(int *array1, int narray1, int *array2, int narray2, int *setminusarray, int *nsetminusarray)
#define BMSfreeBlockMemory(mem, ptr)
SCIP_DECL_HASHGETKEY(SCIPhashGetKeyStandard)
static int getRand(unsigned int *seedp)
static SCIP_RETCODE pqueueResize(SCIP_PQUEUE *pqueue, int minsize)
void SCIPhashtablePrintStatistics(SCIP_HASHTABLE *hashtable, SCIP_MESSAGEHDLR *messagehdlr)
SCIP_DECL_SORTPTRCOMP(SCIPsortCompInt)
SCIP_BTNODE * SCIPbtnodeGetRightchild(SCIP_BTNODE *node)
public data structures and miscellaneous methods
SCIP_RETCODE SCIPdigraphAddArcSafe(SCIP_DIGRAPH *digraph, int startnode, int endnode, void *data)
static const int primetablesize
int SCIPdigraphGetNSuccessors(SCIP_DIGRAPH *digraph, int node)
#define BMSallocBlockMemoryArray(mem, ptr, num)
SCIP_Longint * SCIPsparseSolGetUbs(SCIP_SPARSESOL *sparsesol)
void SCIPprintSysError(const char *message)
SCIP_RETCODE SCIPsparseSolCreate(SCIP_SPARSESOL **sparsesol, SCIP_VAR **vars, int nvars, SCIP_Bool cleared)
SCIP_RETCODE SCIPhashmapRemoveAll(SCIP_HASHMAP *hashmap)
static const SCIP_Real studentt_quartiles[]
#define ELEM_DISTANCE(pos)
SCIP_RETCODE SCIPmultihashInsert(SCIP_MULTIHASH *multihash, void *element)
static uint32_t randomGetRand(SCIP_RANDNUMGEN *randnumgen)
SCIP_Bool SCIPprofileFindLeft(SCIP_PROFILE *profile, int timepoint, int *pos)
SCIP_RETCODE SCIPrealarrayFree(SCIP_REALARRAY **realarray)
SCIP_RETCODE SCIPdigraphResize(SCIP_DIGRAPH *digraph, int nnodes)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
void SCIPrandomPermuteIntArray(SCIP_RANDNUMGEN *randnumgen, int *array, int begin, int end)
static const SCIP_Real simplednoms[]
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
static int getRandomInt(int minrandval, int maxrandval, unsigned int *seedp)
int SCIPdigraphGetNArcs(SCIP_DIGRAPH *digraph)
void SCIPbtFree(SCIP_BT **tree)
SCIP_RETCODE SCIPhashtableSafeInsert(SCIP_HASHTABLE *hashtable, void *element)
SCIP_Bool SCIPbtnodeIsLeftchild(SCIP_BTNODE *node)
SCIP_Real SCIPnextafter(SCIP_Real from, SCIP_Real to)
static const unsigned int randseed
SCIP_Bool SCIPintervalHasRoundingControl(void)
SCIP_RETCODE SCIPdigraphComputeDirectedComponents(SCIP_DIGRAPH *digraph, int compidx, int *strongcomponents, int *strongcompstartidx, int *nstrongcomponents)
int SCIPboolarrayGetMinIdx(SCIP_BOOLARRAY *boolarray)
void * SCIPmultihashRetrieveNext(SCIP_MULTIHASH *multihash, SCIP_MULTIHASHLIST **multihashlist, void *key)
SCIP_Real SCIPcomputeTwoSampleTTestValue(SCIP_Real meanx, SCIP_Real meany, SCIP_Real variancex, SCIP_Real variancey, SCIP_Real countx, SCIP_Real county)
void ** SCIPpqueueElems(SCIP_PQUEUE *pqueue)
#define BMScopyMemoryArray(ptr, source, num)
SCIPInterval log(const SCIPInterval &x)
void SCIPprofilePrint(SCIP_PROFILE *profile, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
void SCIPgmlWriteNodeWeight(FILE *file, unsigned int id, const char *label, const char *nodetype, const char *fillcolor, const char *bordercolor, SCIP_Real weight)
SCIP_Bool SCIPfindSimpleRational(SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom, SCIP_Longint *nominator, SCIP_Longint *denominator)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
static SCIP_Real getRandomReal(SCIP_Real minrandval, SCIP_Real maxrandval, unsigned int *seedp)
static SCIP_Bool isIntegralScalar(SCIP_Real val, SCIP_Real scalar, SCIP_Real mindelta, SCIP_Real maxdelta)
#define BMSclearMemory(ptr)
int * SCIPprofileGetTimepoints(SCIP_PROFILE *profile)
SCIP_VAR ** SCIPsparseSolGetVars(SCIP_SPARSESOL *sparsesol)
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
int * SCIPprofileGetLoads(SCIP_PROFILE *profile)
static void depthFirstSearch(SCIP_DIGRAPH *digraph, int startnode, SCIP_Bool *visited, int *dfsstack, int *stackadjvisited, int *dfsnodes, int *ndfsnodes)
#define BMSallocClearMemoryArray(ptr, num)
static void incrementalStatsUpdate(SCIP_Real value, SCIP_Real *meanptr, SCIP_Real *sumvarptr, int nobservations, SCIP_Bool add)
int SCIPgetRandomInt(int minrandval, int maxrandval, unsigned int *seedp)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
SCIP_Bool SCIPbtIsEmpty(SCIP_BT *tree)
SCIP_RETCODE SCIPptrarrayClear(SCIP_PTRARRAY *ptrarray)
static void tarjan(SCIP_DIGRAPH *digraph, int v, int *lowlink, int *dfsidx, int *stack, int *stacksize, SCIP_Bool *unprocessed, SCIP_Bool *nodeinstack, int *maxdfs, int *strongcomponents, int *nstrongcomponents, int *strongcompstartidx, int *nstorednodes)
SCIP_Real SCIPgetRandomReal(SCIP_Real minrandval, SCIP_Real maxrandval, unsigned int *seedp)
SCIP_BTNODE * SCIPbtnodeGetLeftchild(SCIP_BTNODE *node)
static uint32_t hashvalue(uint64_t input)
#define SCIP_DECL_SORTINDCOMP(x)
int SCIPsparseSolGetNVars(SCIP_SPARSESOL *sparsesol)
void SCIPbtSetRoot(SCIP_BT *tree, SCIP_BTNODE *root)
SCIP_RETCODE SCIPhashmapSetImageReal(SCIP_HASHMAP *hashmap, void *origin, SCIP_Real image)
SCIP_RETCODE SCIPhashmapRemove(SCIP_HASHMAP *hashmap, void *origin)
void SCIPbtnodeSetParent(SCIP_BTNODE *node, SCIP_BTNODE *parent)
int SCIPhashmapGetNElements(SCIP_HASHMAP *hashmap)
SCIP_Real SCIPstudentTGetCriticalValue(SCIP_CONFIDENCELEVEL clevel, int df)
void SCIPsort(int *perm, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len)
SCIP_RETCODE SCIPqueueCreate(SCIP_QUEUE **queue, int initsize, SCIP_Real sizefac)
SCIP_RETCODE SCIPptrarrayFree(SCIP_PTRARRAY **ptrarray)
#define GMLNODEBORDERCOLOR
SCIP_RETCODE SCIPpqueueInsert(SCIP_PQUEUE *pqueue, void *elem)
static SCIP_RETCODE hashsetCheckLoad(SCIP_HASHSET *hashset, BMS_BLKMEM *blkmem)
SCIP_Real SCIPcalcMachineEpsilon(void)
SCIP_RETCODE SCIPpqueueCreate(SCIP_PQUEUE **pqueue, int initsize, SCIP_Real sizefac, SCIP_DECL_SORTPTRCOMP((*ptrcomp)))
SCIP_Real SCIPhashmapEntryGetImageReal(SCIP_HASHMAPENTRY *entry)
void * SCIPmultihashRetrieve(SCIP_MULTIHASH *multihash, void *key)
SCIP_RETCODE SCIPintarrayExtend(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
SCIP_RETCODE SCIPptrarraySetVal(SCIP_PTRARRAY *ptrarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, void *val)
SCIP_HASHMAPENTRY * slots
SCIP_Real SCIPnormalCDF(SCIP_Real mean, SCIP_Real variance, SCIP_Real value)
SCIP_Real SCIPregressionGetSlope(SCIP_REGRESSION *regression)
static int profileFindDownFeasibleStart(SCIP_PROFILE *profile, int pos, int ect, int duration, int demand, SCIP_Bool *infeasible)
int SCIPactivityGetDuration(SCIP_RESOURCEACTIVITY *activity)
SCIP_RETCODE SCIPdigraphCopy(SCIP_DIGRAPH **targetdigraph, SCIP_DIGRAPH *sourcedigraph, BMS_BLKMEM *targetblkmem)
SCIP_RETCODE SCIPboolarrayFree(SCIP_BOOLARRAY **boolarray)
public methods for message output
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
void SCIPhashsetPrintStatistics(SCIP_HASHSET *hashset, SCIP_MESSAGEHDLR *messagehdlr)
static const SCIP_Real scalars[]
SCIP_RETCODE SCIPhashsetInsert(SCIP_HASHSET *hashset, BMS_BLKMEM *blkmem, void *element)
SCIP_RETCODE SCIPhashmapSetImage(SCIP_HASHMAP *hashmap, void *origin, void *image)
static SCIP_RETCODE profileInsertTimepoint(SCIP_PROFILE *profile, int timepoint, int *pos)
void SCIPmultihashPrintStatistics(SCIP_MULTIHASH *multihash, SCIP_MESSAGEHDLR *messagehdlr)
void SCIPpermuteIntArray(int *array, int begin, int end, unsigned int *randseed)
#define SCIP_CALL_TERMINATE(retcode, x, TERM)
SCIP_RETCODE SCIPrealarrayExtend(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
SCIP_RETCODE SCIPrandomGetSubset(SCIP_RANDNUMGEN *randnumgen, void **set, int nelems, void **subset, int nsubelems)
SCIP_Longint SCIPcalcBinomCoef(int n, int m)
#define BMSallocMemory(ptr)
#define BMSreallocMemoryArray(ptr, num)
static void hashsetInsert(SCIP_HASHSET *hashset, void *element)
int SCIPhashtableGetNEntries(SCIP_HASHTABLE *hashtable)
static void multihashlistFree(SCIP_MULTIHASHLIST **multihashlist, BMS_BLKMEM *blkmem)
static void btnodeFreeLeaf(SCIP_BT *tree, SCIP_BTNODE **node)
SCIP_RETCODE SCIPcalcIntegralScalar(SCIP_Real *vals, int nvals, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Real *intscalar, SCIP_Bool *success)
static void btPrintSubtree(SCIP_BTNODE *node, FILE *file, int *nnodes)
void SCIPregressionReset(SCIP_REGRESSION *regression)
SCIP_RETCODE SCIPdisjointsetCreate(SCIP_DISJOINTSET **djset, BMS_BLKMEM *blkmem, int ncomponents)
SCIP_RETCODE SCIPrealarraySetVal(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Real val)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
void * SCIPqueueRemove(SCIP_QUEUE *queue)
SCIP_RETCODE SCIPintarrayClear(SCIP_INTARRAY *intarray)
SCIP_RETCODE SCIPmultihashRemove(SCIP_MULTIHASH *multihash, void *element)
#define STARTSUCCESSORSSIZE
int SCIPprofileGetLatestFeasibleStart(SCIP_PROFILE *profile, int est, int lst, int duration, int demand, SCIP_Bool *infeasible)
SCIP_MULTIHASHLIST * next
void SCIPgmlWriteOpening(FILE *file, SCIP_Bool directed)
int SCIPcalcMultihashSize(int minsize)
#define BMSallocBlockMemory(mem, ptr)
SCIP_RETCODE SCIPregressionCreate(SCIP_REGRESSION **regression)
SCIP_RETCODE SCIPboolarrayExtend(SCIP_BOOLARRAY *boolarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
#define BMSclearMemoryArray(ptr, num)
SCIP_Real SCIPhashtableGetLoad(SCIP_HASHTABLE *hashtable)
common defines and data types used in all packages of SCIP
void * SCIPqueueFirst(SCIP_QUEUE *queue)
void SCIPswapInts(int *value1, int *value2)
struct BMS_BlkMem BMS_BLKMEM
SCIP_RETCODE SCIPbtCreate(SCIP_BT **tree, BMS_BLKMEM *blkmem)
#define SCIP_ALLOC_TERMINATE(retcode, x, TERM)
static SCIP_RETCODE queueResize(SCIP_QUEUE *queue, int minsize)
#define SCIP_CALL_ABORT(x)
int SCIPactivityGetDemand(SCIP_RESOURCEACTIVITY *activity)
void SCIPbtnodeSetData(SCIP_BTNODE *node, void *dataptr)
static void * multihashlistRetrieve(SCIP_MULTIHASHLIST *multihashlist, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr, uint64_t keyval, void *key)
SCIP_RETCODE SCIPptrarrayCreate(SCIP_PTRARRAY **ptrarray, BMS_BLKMEM *blkmem)
void SCIPdigraphFree(SCIP_DIGRAPH **digraph)
int SCIPprofileGetNTimepoints(SCIP_PROFILE *profile)
void SCIPpqueueClear(SCIP_PQUEUE *pqueue)
int SCIPregressionGetNObservations(SCIP_REGRESSION *regression)
char * SCIPstrtok(char *s, const char *delim, char **ptrptr)
SCIP_ROUNDMODE SCIPintervalGetRoundingMode(void)
SCIP_Longint SCIPcalcGreComDiv(SCIP_Longint val1, SCIP_Longint val2)
void SCIPdigraphPrintGml(SCIP_DIGRAPH *digraph, FILE *file)
SCIP_RETCODE SCIPintarrayCreate(SCIP_INTARRAY **intarray, BMS_BLKMEM *blkmem)
#define BMSreallocBlockMemoryArray(mem, ptr, oldnum, newnum)
void SCIPbtPrintGml(SCIP_BT *tree, FILE *file)
SCIP_Longint SCIPhashtableGetNElements(SCIP_HASHTABLE *hashtable)
void SCIPintervalSetRoundingModeDownwards(void)
SCIP_Longint SCIPcalcSmaComMul(SCIP_Longint val1, SCIP_Longint val2)
SCIP_RETCODE SCIPptrarrayCopy(SCIP_PTRARRAY **ptrarray, BMS_BLKMEM *blkmem, SCIP_PTRARRAY *sourceptrarray)
SCIP_Bool SCIPbtnodeIsLeaf(SCIP_BTNODE *node)
void SCIPsparseSolFree(SCIP_SPARSESOL **sparsesol)
SCIP_Real SCIPcomputeGap(SCIP_Real eps, SCIP_Real inf, SCIP_Real primalbound, SCIP_Real dualbound)
void SCIPprofileFree(SCIP_PROFILE **profile)
SCIP_RETCODE SCIPrealarrayClear(SCIP_REALARRAY *realarray)