60 #define SQRTOFTWO 1.4142136 77 1.000, 2.414, 3.078, 6.314, 12.706,
78 0.816, 1.604, 1.886, 2.920, 4.303,
79 0.765, 1.423, 1.638, 2.353, 3.182,
80 0.741, 1.344, 1.533, 2.132, 2.776,
81 0.727, 1.301, 1.476, 2.015, 2.571,
82 0.718, 1.273, 1.440, 1.943, 2.447,
83 0.711, 1.254, 1.415, 1.895, 2.365,
84 0.706, 1.240, 1.397, 1.860, 2.306,
85 0.703, 1.230, 1.383, 1.833, 2.262,
86 0.700, 1.221, 1.372, 1.812, 2.228,
87 0.697, 1.214, 1.363, 1.796, 2.201,
88 0.695, 1.209, 1.356, 1.782, 2.179,
89 0.694, 1.204, 1.350, 1.771, 2.160,
90 0.692, 1.200, 1.345, 1.761, 2.145,
91 0.691, 1.197, 1.341, 1.753, 2.131
98 0.674, 1.150, 1.282, 1.645, 1.960
135 if( countx < 1.9 || county < 1.9 )
139 pooledvariance = (countx - 1) * variancex + (county - 1) * variancey;
140 pooledvariance /= (countx + county - 2);
143 pooledvariance =
MAX(pooledvariance, 1e-9);
148 tresult = (meanx - meany) / SQRT(pooledvariance);
149 tresult *= SQRT(countx * county / (countx + county));
159 #if defined(_WIN32) || defined(_WIN64) 170 sign = (x >= 0) ? 1 : -1;
174 y = 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);
205 assert(variance >= -1e-9);
206 if( variance < 1e-9 )
209 std = sqrt(variance);
214 if( value < mean + 1e-9 )
219 assert( std != 0.0 );
222 normvalue = (value - mean)/(std *
SQRTOFTWO);
224 SCIPdebugMessage(
" Normalized value %g = ( %g - %g ) / (%g * 1.4142136)\n", normvalue, value, mean, std);
229 if( normvalue < 1e-9 && normvalue > -1e-9 )
231 else if( normvalue > 0 )
235 erfresult =
SCIPerf(normvalue);
236 return erfresult / 2.0 + 0.5;
242 erfresult =
SCIPerf(-normvalue);
244 return 0.5 - erfresult / 2.0;
257 assert(regression !=
NULL);
267 assert(regression !=
NULL);
269 return regression->
slope;
277 assert(regression !=
NULL);
298 regression->
slope = 0.0;
332 assert(meanptr !=
NULL);
333 assert(sumvarptr !=
NULL);
334 assert(nobservations > 0 || add);
336 addfactor = add ? 1.0 : -1.0;
339 *meanptr = oldmean + addfactor * (value - oldmean)/(
SCIP_Real)nobservations;
340 *sumvarptr += addfactor * (value - oldmean) * (value - (*meanptr));
343 assert(*sumvarptr >= -1e-4);
344 *sumvarptr =
MAX(0.0, *sumvarptr);
354 assert(regression !=
NULL);
372 regression->
sumxy -= (x *
y);
387 assert(regression !=
NULL);
393 regression->
sumxy += x *
y;
406 regression->
meanx = 0;
408 regression->
sumxy = 0;
409 regression->
meany = 0;
419 assert(regression !=
NULL);
448 assert(initsize >= 0);
449 assert(growfac >= 1.0);
453 size =
MAX(initsize, num);
459 initsize =
MAX(initsize, 4);
464 while( size < num && size > oldsize )
467 size = (int)(growfac * size + initsize);
471 if( size <= oldsize )
475 assert(size >= initsize);
486 #define GMLNODEWIDTH 120.0 487 #define GMLNODEHEIGTH 30.0 488 #define GMLFONTSIZE 13 489 #define GMLNODETYPE "rectangle" 490 #define GMLNODEFILLCOLOR "#ff0000" 491 #define GMLEDGECOLOR "black" 492 #define GMLNODEBORDERCOLOR "#000000" 500 const char* nodetype,
501 const char* fillcolor,
502 const char* bordercolor
505 assert(file !=
NULL);
506 assert(label !=
NULL);
508 fprintf(file,
" node\n");
509 fprintf(file,
" [\n");
510 fprintf(file,
" id %u\n",
id);
511 fprintf(file,
" label \"%s\"\n", label);
512 fprintf(file,
" graphics\n");
513 fprintf(file,
" [\n");
517 if( nodetype !=
NULL )
518 fprintf(file,
" type \"%s\"\n", nodetype);
522 if( fillcolor !=
NULL )
523 fprintf(file,
" fill \"%s\"\n", fillcolor);
527 if( bordercolor !=
NULL )
528 fprintf(file,
" outline \"%s\"\n", bordercolor);
532 fprintf(file,
" ]\n");
533 fprintf(file,
" LabelGraphics\n");
534 fprintf(file,
" [\n");
535 fprintf(file,
" text \"%s\"\n", label);
537 fprintf(file,
" fontName \"Dialog\"\n");
538 fprintf(file,
" anchor \"c\"\n");
539 fprintf(file,
" ]\n");
540 fprintf(file,
" ]\n");
548 const char* nodetype,
549 const char* fillcolor,
550 const char* bordercolor,
554 assert(file !=
NULL);
555 assert(label !=
NULL);
557 fprintf(file,
" node\n");
558 fprintf(file,
" [\n");
559 fprintf(file,
" id %u\n",
id);
560 fprintf(file,
" label \"%s\"\n", label);
561 fprintf(file,
" weight %g\n", weight);
562 fprintf(file,
" graphics\n");
563 fprintf(file,
" [\n");
567 if( nodetype !=
NULL )
568 fprintf(file,
" type \"%s\"\n", nodetype);
572 if( fillcolor !=
NULL )
573 fprintf(file,
" fill \"%s\"\n", fillcolor);
577 if( bordercolor !=
NULL )
578 fprintf(file,
" outline \"%s\"\n", bordercolor);
582 fprintf(file,
" ]\n");
583 fprintf(file,
" LabelGraphics\n");
584 fprintf(file,
" [\n");
585 fprintf(file,
" text \"%s\"\n", label);
587 fprintf(file,
" fontName \"Dialog\"\n");
588 fprintf(file,
" anchor \"c\"\n");
589 fprintf(file,
" ]\n");
590 fprintf(file,
" ]\n");
602 assert(file !=
NULL);
604 fprintf(file,
" edge\n");
605 fprintf(file,
" [\n");
606 fprintf(file,
" source %u\n", source);
607 fprintf(file,
" target %u\n", target);
610 fprintf(file,
" label \"%s\"\n", label);
612 fprintf(file,
" graphics\n");
613 fprintf(file,
" [\n");
616 fprintf(file,
" fill \"%s\"\n", color);
621 fprintf(file,
" ]\n");
625 fprintf(file,
" LabelGraphics\n");
626 fprintf(file,
" [\n");
627 fprintf(file,
" text \"%s\"\n", label);
629 fprintf(file,
" fontName \"Dialog\"\n");
630 fprintf(file,
" anchor \"c\"\n");
631 fprintf(file,
" ]\n");
634 fprintf(file,
" ]\n");
646 assert(file !=
NULL);
648 fprintf(file,
" edge\n");
649 fprintf(file,
" [\n");
650 fprintf(file,
" source %u\n", source);
651 fprintf(file,
" target %u\n", target);
654 fprintf(file,
" label \"%s\"\n", label);
656 fprintf(file,
" graphics\n");
657 fprintf(file,
" [\n");
660 fprintf(file,
" fill \"%s\"\n", color);
664 fprintf(file,
" targetArrow \"standard\"\n");
665 fprintf(file,
" ]\n");
669 fprintf(file,
" LabelGraphics\n");
670 fprintf(file,
" [\n");
671 fprintf(file,
" text \"%s\"\n", label);
673 fprintf(file,
" fontName \"Dialog\"\n");
674 fprintf(file,
" anchor \"c\"\n");
675 fprintf(file,
" ]\n");
678 fprintf(file,
" ]\n");
687 assert(file !=
NULL);
689 fprintf(file,
"graph\n");
690 fprintf(file,
"[\n");
691 fprintf(file,
" hierarchic 1\n");
694 fprintf(file,
" directed 1\n");
702 assert(file !=
NULL);
704 fprintf(file,
"]\n");
726 assert(sparsesol !=
NULL);
727 assert(vars !=
NULL);
736 for( v = nvars - 1; v >= 0; --v )
738 assert(vars[v] !=
NULL);
759 (*sparsesol)->nvars = nvars;
769 assert(sparsesol !=
NULL);
770 assert(*sparsesol !=
NULL);
783 assert(sparsesol !=
NULL);
785 return sparsesol->
vars;
793 assert(sparsesol !=
NULL);
795 return sparsesol->
nvars;
803 assert(sparsesol !=
NULL);
813 assert(sparsesol !=
NULL);
828 assert(sparsesol !=
NULL);
833 assert(lbvalues !=
NULL);
836 for( v = 0; v < nvars; ++v )
837 sol[v] = lbvalues[v];
856 assert(sparsesol !=
NULL);
867 assert(lbvalues !=
NULL);
868 assert(ubvalues !=
NULL);
873 for( v = 0; v < nvars; ++v )
875 lbvalue = lbvalues[v];
876 ubvalue = ubvalues[v];
878 if( lbvalue < ubvalue )
882 if( carryflag ==
FALSE )
884 if( sol[v] < ubvalue )
892 assert(sol[v] == ubvalue);
899 if( sol[v] < ubvalue )
907 assert(sol[v] == ubvalue);
914 return (!carryflag && !singular);
929 assert(queue !=
NULL);
932 if( minsize <= queue->size )
949 assert(queue !=
NULL);
951 initsize =
MAX(1, initsize);
952 sizefac =
MAX(1.0, sizefac);
955 (*queue)->firstfree = 0;
956 (*queue)->firstused = -1;
958 (*queue)->sizefac = sizefac;
959 (*queue)->slots =
NULL;
971 assert(queue !=
NULL);
982 assert(queue !=
NULL);
997 int oldsize = queue->
size;
1000 assert(oldsize < queue->size);
1002 sizediff = queue->
size - oldsize;
1034 assert(queue !=
NULL);
1039 assert(elem !=
NULL);
1060 assert(queue !=
NULL);
1086 assert(queue !=
NULL);
1120 assert(queue !=
NULL);
1152 assert(queue !=
NULL);
1170 assert(queue !=
NULL);
1188 assert(queue !=
NULL);
1201 assert(queue !=
NULL);
1221 #define PQ_PARENT(q) (((q)+1)/2-1) 1222 #define PQ_LEFTCHILD(p) (2*(p)+1) 1223 #define PQ_RIGHTCHILD(p) (2*(p)+2) 1233 assert(pqueue !=
NULL);
1235 if( minsize <= pqueue->size )
1253 assert(pqueue !=
NULL);
1254 assert(ptrcomp !=
NULL);
1256 initsize =
MAX(1, initsize);
1257 sizefac =
MAX(1.0, sizefac);
1261 (*pqueue)->size = 0;
1262 (*pqueue)->sizefac = sizefac;
1263 (*pqueue)->slots =
NULL;
1264 (*pqueue)->ptrcomp = ptrcomp;
1265 (*pqueue)->elemchgpos = elemchgpos;
1276 assert(pqueue !=
NULL);
1287 assert(pqueue !=
NULL);
1301 pqueue->
slots[newpos] = elem;
1304 if( pqueue->elemchgpos !=
NULL )
1306 pqueue->elemchgpos(elem, oldpos, newpos);
1310 #ifdef SCIP_MORE_DEBUG 1333 if( pqueue->ptrcomp(pqueue->
slots[i], pqueue->
slots[leftchild]) > 0 )
1352 assert(pqueue !=
NULL);
1353 assert(pqueue->
len >= 0);
1354 assert(elem !=
NULL);
1362 while( pos > 0 && (*pqueue->ptrcomp)(elem, pqueue->
slots[parentpos]) < 0 )
1364 assert((*pqueue->ptrcomp)(pqueue->
slots[parentpos], elem) >= 0);
1374 #ifdef SCIP_MORE_DEBUG 1375 assert(pqueueHasHeapProperty(pqueue));
1390 assert(pqueue !=
NULL);
1400 if( pos == pqueue->
len )
1408 while( pos > 0 && (*pqueue->ptrcomp)(last, pqueue->
slots[
PQ_PARENT(pos)]) < 0 )
1420 if( brotherpos < pqueue->len && (*pqueue->ptrcomp)(pqueue->
slots[brotherpos], pqueue->
slots[childpos]) < 0 )
1421 childpos = brotherpos;
1423 if( (*pqueue->ptrcomp)(last, pqueue->
slots[childpos]) <= 0 )
1433 assert(pos <= pqueue->len - 1);
1437 #ifdef SCIP_MORE_DEBUG 1438 assert(pqueueHasHeapProperty(pqueue));
1449 assert(pqueue !=
NULL);
1450 assert(pqueue->
len >= 0);
1452 if( pqueue->
len == 0 )
1455 root = pqueue->
slots[0];
1467 assert(pqueue !=
NULL);
1468 assert(pqueue->
len >= 0);
1470 if( pqueue->
len == 0 )
1473 return pqueue->
slots[0];
1481 assert(pqueue !=
NULL);
1482 assert(pqueue->
len >= 0);
1492 assert(pqueue !=
NULL);
1493 assert(pqueue->
len >= 0);
1495 return pqueue->
slots;
1508 if( pqueue->
slots[pos] == elem )
1583 return ( (uint32_t) ((UINT64_C(0x9e3779b97f4a7c15) * input)>>32) ) | 1u;
1594 assert(0 <= pos && pos < primetablesize);
1596 return primetable[pos];
1609 assert(multihashlist !=
NULL);
1610 assert(blkmem !=
NULL);
1611 assert(element !=
NULL);
1615 newlist->
next = *multihashlist;
1616 *multihashlist = newlist;
1631 assert(multihashlist !=
NULL);
1632 assert(blkmem !=
NULL);
1634 list = *multihashlist;
1635 while( list !=
NULL )
1637 nextlist = list->
next;
1642 *multihashlist =
NULL;
1657 uint64_t currentkeyval;
1660 assert(hashkeyeq !=
NULL);
1661 assert(key !=
NULL);
1663 while( multihashlist !=
NULL )
1665 currentkey = hashgetkey(userptr, multihashlist->
element);
1666 currentkeyval = hashkeyval(userptr, currentkey);
1667 if( currentkeyval == keyval && hashkeyeq(userptr, currentkey, key) )
1668 return multihashlist;
1670 multihashlist = multihashlist->
next;
1691 h =
multihashlistFind(multihashlist, hashgetkey, hashkeyeq, hashkeyval, userptr, keyval, key);
1706 key1 = hashgetkey(userptr, h->
element);
1707 key2 = hashgetkey(userptr, h2->
element);
1708 assert(hashkeyval(userptr, key1) == hashkeyval(userptr, key2));
1710 if( hashkeyeq(userptr, key1, key2) )
1712 SCIPerrorMessage(
"WARNING: hashkey with same value exists multiple times (e.g. duplicate constraint/variable names), so the return value is maybe not correct\n");
1741 assert(multihashlist !=
NULL);
1744 h =
multihashlistFind(*multihashlist, hashgetkey, hashkeyeq, hashkeyval, userptr, keyval, key);
1749 *multihashlist = h->
next;
1754 *multihashlist =
NULL;
1769 assert(multihashlist !=
NULL);
1770 assert(blkmem !=
NULL);
1771 assert(element !=
NULL);
1773 while( *multihashlist !=
NULL && (*multihashlist)->element != element )
1774 multihashlist = &(*multihashlist)->
next;
1776 if( *multihashlist !=
NULL )
1778 nextlist = (*multihashlist)->
next;
1780 *multihashlist = nextlist;
1788 #define SCIP_MULTIHASH_MAXSIZE 33554431 1789 #define SCIP_MULTIHASH_RESIZE_PERCENTAGE 65 1790 #define SCIP_MULTIHASH_GROW_FACTOR 1.31 1804 assert(multihash !=
NULL);
1806 assert(multihash->
nlists > 0);
1807 assert(multihash->hashgetkey !=
NULL);
1808 assert(multihash->hashkeyeq !=
NULL);
1809 assert(multihash->hashkeyval !=
NULL);
1813 nnewlists =
MAX(nnewlists, multihash->
nlists);
1817 if( nnewlists > multihash->
nlists )
1822 unsigned int hashval;
1827 for( l = multihash->
nlists - 1; l >= 0; --l )
1829 multihashlist = multihash->
lists[l];
1833 while( multihashlist !=
NULL )
1836 key = multihash->hashgetkey(multihash->
userptr, multihashlist->
element);
1837 keyval = multihash->hashkeyval(multihash->
userptr, key);
1838 hashval = (
unsigned int) (keyval % (
unsigned) nnewlists);
1843 if( multihashlist->
next ==
NULL && onlyone )
1846 if( newlists[hashval] ==
NULL )
1847 newlists[hashval] = multihashlist;
1854 while( next !=
NULL )
1860 lastnext->
next = multihashlist;
1872 multihashlist = multihashlist->
next;
1884 multihash->
lists = newlists;
1885 multihash->
nlists = nnewlists;
1888 #ifdef SCIP_MORE_DEBUG 1892 for( l = 0; l < multihash->
nlists; ++l )
1894 multihashlist = multihash->
lists[l];
1895 while( multihashlist !=
NULL )
1898 multihashlist = multihashlist->
next;
1901 assert(sumslotsize == multihash->
nelements);
1923 assert(tablesize >= 0);
1924 assert(multihash !=
NULL);
1925 assert(hashgetkey !=
NULL);
1926 assert(hashkeyeq !=
NULL);
1927 assert(hashkeyval !=
NULL);
1931 (*multihash)->blkmem = blkmem;
1932 (*multihash)->nlists = tablesize;
1933 (*multihash)->hashgetkey = hashgetkey;
1934 (*multihash)->hashkeyeq = hashkeyeq;
1935 (*multihash)->hashkeyval = hashkeyval;
1936 (*multihash)->userptr = userptr;
1937 (*multihash)->nelements = 0;
1952 assert(multihash !=
NULL);
1953 assert(*multihash !=
NULL);
1955 table = (*multihash);
1957 lists = table->
lists;
1960 for( i = table->
nlists - 1; i >= 0; --i )
1981 unsigned int hashval;
1983 assert(multihash !=
NULL);
1985 assert(multihash->
nlists > 0);
1986 assert(multihash->hashgetkey !=
NULL);
1987 assert(multihash->hashkeyeq !=
NULL);
1988 assert(multihash->hashkeyval !=
NULL);
1989 assert(element !=
NULL);
1998 key = multihash->hashgetkey(multihash->
userptr, element);
1999 keyval = multihash->hashkeyval(multihash->
userptr, key);
2000 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2020 assert(multihash !=
NULL);
2021 assert(multihash->hashgetkey !=
NULL);
2040 unsigned int hashval;
2042 assert(multihash !=
NULL);
2044 assert(multihash->
nlists > 0);
2045 assert(multihash->hashgetkey !=
NULL);
2046 assert(multihash->hashkeyeq !=
NULL);
2047 assert(multihash->hashkeyval !=
NULL);
2048 assert(key !=
NULL);
2051 keyval = multihash->hashkeyval(multihash->
userptr, key);
2052 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2055 multihash->hashkeyval, multihash->
userptr, keyval, key);
2073 assert(multihash !=
NULL);
2075 assert(multihash->
nlists > 0);
2076 assert(multihash->hashgetkey !=
NULL);
2077 assert(multihash->hashkeyeq !=
NULL);
2078 assert(multihash->hashkeyval !=
NULL);
2079 assert(multihashlist !=
NULL);
2080 assert(key !=
NULL);
2082 keyval = multihash->hashkeyval(multihash->
userptr, key);
2084 if( *multihashlist ==
NULL )
2086 unsigned int hashval;
2089 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2091 *multihashlist = multihash->
lists[hashval];
2095 multihash->hashkeyval, multihash->
userptr, keyval, key);
2106 unsigned int hashval;
2108 assert(multihash !=
NULL);
2110 assert(multihash->
nlists > 0);
2111 assert(multihash->hashgetkey !=
NULL);
2112 assert(multihash->hashkeyeq !=
NULL);
2113 assert(multihash->hashkeyval !=
NULL);
2114 assert(element !=
NULL);
2117 key = multihash->hashgetkey(multihash->
userptr, element);
2118 keyval = multihash->hashkeyval(multihash->
userptr, key);
2119 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2122 multihash->hashkeyval, multihash->
userptr, keyval, key) !=
NULL);
2133 unsigned int hashval;
2135 assert(multihash !=
NULL);
2137 assert(multihash->
nlists > 0);
2138 assert(multihash->hashgetkey !=
NULL);
2139 assert(multihash->hashkeyeq !=
NULL);
2140 assert(multihash->hashkeyval !=
NULL);
2141 assert(element !=
NULL);
2144 key = multihash->hashgetkey(multihash->
userptr, element);
2145 keyval = multihash->hashkeyval(multihash->
userptr, key);
2146 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2168 assert(multihash !=
NULL);
2170 blkmem = multihash->
blkmem;
2171 lists = multihash->
lists;
2174 for( i = multihash->
nlists - 1; i >= 0; --i )
2185 assert(multihash !=
NULL);
2195 assert(multihash !=
NULL);
2213 assert(multihash !=
NULL);
2218 for( i = 0; i < multihash->
nlists; ++i )
2220 multihashlist = multihash->
lists[i];
2221 if( multihashlist !=
NULL )
2225 while( multihashlist !=
NULL )
2228 multihashlist = multihashlist->
next;
2230 maxslotsize =
MAX(maxslotsize, slotsize);
2231 sumslotsize += slotsize;
2234 assert(sumslotsize == multihash->
nelements);
2237 SCIPmessagePrintInfo(messagehdlr,
"%" SCIP_LONGINT_FORMAT
" multihash entries, used %d/%d slots (%.1f%%)",
2256 unsigned int nslots;
2261 assert(tablesize >= 0);
2262 assert(hashtable !=
NULL);
2263 assert(hashgetkey !=
NULL);
2264 assert(hashkeyeq !=
NULL);
2265 assert(hashkeyval !=
NULL);
2266 assert(blkmem !=
NULL);
2275 (*hashtable)->shift = 32;
2276 (*hashtable)->shift -= (
unsigned int)ceil(LOG2(
MAX(32.0, tablesize / 0.9)));
2279 nslots = 1u << (32 - (*hashtable)->shift);
2282 (*hashtable)->mask = nslots - 1;
2285 (*hashtable)->blkmem = blkmem;
2286 (*hashtable)->hashgetkey = hashgetkey;
2287 (*hashtable)->hashkeyeq = hashkeyeq;
2288 (*hashtable)->hashkeyval = hashkeyval;
2289 (*hashtable)->userptr = userptr;
2290 (*hashtable)->nelements = 0;
2303 assert(hashtable !=
NULL);
2304 assert(*hashtable !=
NULL);
2306 nslots = (*hashtable)->
mask + 1;
2309 uint32_t maxprobelen = 0;
2310 uint64_t probelensum = 0;
2313 assert(table !=
NULL);
2315 for( i = 0; i < nslots; ++i )
2317 if( table->
hashes[i] != 0 )
2319 uint32_t probelen = ((i + table->
mask + 1 - (table->
hashes[i]>>(table->
shift))) & table->
mask) + 1;
2320 probelensum += probelen;
2321 maxprobelen =
MAX(probelen, maxprobelen);
2326 (
unsigned int)table->
nelements, (
unsigned int)table->
nelements, (
unsigned int)nslots,
2356 #define ELEM_DISTANCE(pos) (((pos) + hashtable->mask + 1 - (hashtable->hashes[(pos)]>>(hashtable->shift))) & hashtable->mask) 2368 uint32_t elemdistance;
2374 assert(hashtable !=
NULL);
2377 assert(hashtable->
mask > 0);
2378 assert(hashtable->hashgetkey !=
NULL);
2379 assert(hashtable->hashkeyeq !=
NULL);
2380 assert(hashtable->hashkeyval !=
NULL);
2381 assert(element !=
NULL);
2383 pos = hashval>>(hashtable->
shift);
2390 if( hashtable->
hashes[pos] == 0 )
2392 hashtable->
slots[pos] = element;
2393 hashtable->
hashes[pos] = hashval;
2398 if( hashtable->
hashes[pos] == hashval && hashtable->hashkeyeq(hashtable->
userptr,
2399 hashtable->hashgetkey(hashtable->
userptr, hashtable->
slots[pos]), key) )
2406 hashtable->
slots[pos] = element;
2407 hashtable->
hashes[pos] = hashval;
2418 if( distance < elemdistance )
2423 elemdistance = distance;
2426 hashval = hashtable->
hashes[pos];
2427 hashtable->
hashes[pos] = tmp;
2428 key = hashtable->hashgetkey(hashtable->
userptr, element);
2437 pos = (pos + 1) & hashtable->
mask;
2448 assert(hashtable !=
NULL);
2449 assert(hashtable->
shift < 32);
2452 if( ((((uint64_t)hashtable->
nelements)<<10)>>(32-hashtable->
shift) > 921) )
2461 nslots = hashtable->
mask + 1;
2462 newnslots = 2*nslots;
2463 hashtable->
mask = newnslots-1;
2475 for( i = 0; i < nslots; ++i )
2480 if( hashes[i] != 0 )
2506 assert(hashtable !=
NULL);
2509 assert(hashtable->
mask > 0);
2510 assert(hashtable->hashgetkey !=
NULL);
2511 assert(hashtable->hashkeyeq !=
NULL);
2512 assert(hashtable->hashkeyval !=
NULL);
2513 assert(element !=
NULL);
2518 key = hashtable->hashgetkey(hashtable->
userptr, element);
2519 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2538 assert(hashtable !=
NULL);
2541 assert(hashtable->
mask > 0);
2542 assert(hashtable->hashgetkey !=
NULL);
2543 assert(hashtable->hashkeyeq !=
NULL);
2544 assert(hashtable->hashkeyval !=
NULL);
2545 assert(element !=
NULL);
2550 key = hashtable->hashgetkey(hashtable->
userptr, element);
2551 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2566 uint32_t elemdistance;
2568 assert(hashtable !=
NULL);
2571 assert(hashtable->
mask > 0);
2572 assert(hashtable->hashgetkey !=
NULL);
2573 assert(hashtable->hashkeyeq !=
NULL);
2574 assert(hashtable->hashkeyval !=
NULL);
2575 assert(key !=
NULL);
2578 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2581 pos = hashval>>(hashtable->
shift);
2589 if( hashtable->
hashes[pos] == 0 )
2595 if( elemdistance > distance )
2599 if( hashtable->
hashes[pos] == hashval && hashtable->hashkeyeq(hashtable->
userptr,
2600 hashtable->hashgetkey(hashtable->
userptr, hashtable->
slots[pos]), key) )
2601 return hashtable->
slots[pos];
2603 pos = (pos + 1) & hashtable->
mask;
2614 assert(hashtable !=
NULL);
2617 assert(hashtable->
mask > 0);
2618 assert(hashtable->hashgetkey !=
NULL);
2619 assert(hashtable->hashkeyeq !=
NULL);
2620 assert(hashtable->hashkeyval !=
NULL);
2621 assert(element !=
NULL);
2635 uint32_t elemdistance;
2639 assert(hashtable !=
NULL);
2642 assert(hashtable->
mask > 0);
2643 assert(hashtable->hashgetkey !=
NULL);
2644 assert(hashtable->hashkeyeq !=
NULL);
2645 assert(hashtable->hashkeyval !=
NULL);
2646 assert(element !=
NULL);
2649 key = hashtable->hashgetkey(hashtable->
userptr, element);
2650 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2654 pos = hashval>>(hashtable->
shift);
2658 if( hashtable->
hashes[pos] == 0 )
2664 if( elemdistance > distance )
2667 if( hashtable->
hashes[pos] == hashval && hashtable->hashkeyeq(hashtable->
userptr,
2668 hashtable->hashgetkey(hashtable->
userptr, hashtable->
slots[pos]), key) )
2674 pos = (pos + 1) & hashtable->
mask;
2679 hashtable->
hashes[pos] = 0;
2683 uint32_t nextpos = (pos + 1) & hashtable->
mask;
2686 if( hashtable->
hashes[nextpos] == 0 )
2690 if( (hashtable->
hashes[nextpos]>>(hashtable->
shift)) == nextpos )
2694 hashtable->
slots[pos] = hashtable->
slots[nextpos];
2696 hashtable->
hashes[nextpos] = 0;
2709 assert(hashtable !=
NULL);
2721 assert(hashtable !=
NULL);
2731 return (
int) hashtable->
mask + 1;
2740 return hashtable->
hashes[entryidx] == 0 ?
NULL : hashtable->
slots[entryidx];
2748 assert(hashtable !=
NULL);
2759 uint32_t maxprobelen = 0;
2760 uint64_t probelensum = 0;
2764 assert(hashtable !=
NULL);
2766 nslots = hashtable->
mask + 1;
2769 for( i = 0; i < nslots; ++i )
2771 if( hashtable->
hashes[i] != 0 )
2774 probelensum += probelen;
2775 maxprobelen =
MAX(probelen, maxprobelen);
2794 const char* string1 = (
const char*)key1;
2795 const char* string2 = (
const char*)key2;
2797 return (strcmp(string1, string2) == 0);
2806 str = (
const char*)key;
2808 while( *str !=
'\0' )
2811 hash += (
unsigned int)(*str);
2829 return (key1 == key2);
2836 return (uint64_t) (uintptr_t) key;
2846 #undef ELEM_DISTANCE 2848 #define ELEM_DISTANCE(pos) (((pos) + hashmap->mask + 1 - (hashmap->hashes[(pos)]>>(hashmap->shift))) & hashmap->mask) 2860 uint32_t elemdistance;
2863 assert(hashmap !=
NULL);
2866 assert(hashmap->
mask > 0);
2867 assert(hashval != 0);
2869 pos = hashval>>(hashmap->
shift);
2876 if( hashmap->
hashes[pos] == 0 )
2880 hashmap->
hashes[pos] = hashval;
2891 hashmap->
hashes[pos] = hashval;
2902 if( distance < elemdistance )
2908 elemdistance = distance;
2910 hashval = hashmap->
hashes[pos];
2911 hashmap->
hashes[pos] = tmphash;
2919 pos = (pos + 1) & hashmap->
mask;
2935 uint32_t elemdistance;
2937 assert(hashmap !=
NULL);
2940 assert(hashmap->
mask > 0);
2944 assert(hashval != 0);
2946 *pos = hashval>>(hashmap->
shift);
2954 if( hashmap->
hashes[*pos] == 0 )
2959 if( elemdistance > distance )
2966 *pos = (*pos + 1) & hashmap->
mask;
2977 assert(hashmap !=
NULL);
2978 assert(hashmap->
shift < 32);
2981 if( ((((uint64_t)hashmap->
nelements)<<10)>>(32-hashmap->
shift) > 921) )
2990 nslots = hashmap->
mask + 1;
2992 newnslots = 2*nslots;
2993 hashmap->
mask = newnslots-1;
3004 for( i = 0; i < nslots; ++i )
3009 if( hashes[i] != 0 )
3032 assert(hashmap !=
NULL);
3033 assert(mapsize >= 0);
3034 assert(blkmem !=
NULL);
3043 (*hashmap)->shift = 32;
3044 (*hashmap)->shift -= (
unsigned int)ceil(log(
MAX(32, mapsize / 0.9)) / log(2.0));
3045 nslots = 1u << (32 - (*hashmap)->shift);
3046 (*hashmap)->mask = nslots - 1;
3047 (*hashmap)->blkmem = blkmem;
3048 (*hashmap)->nelements = 0;
3064 assert(hashmap !=
NULL);
3065 assert(*hashmap !=
NULL);
3067 nslots = (*hashmap)->mask + 1;
3070 uint32_t maxprobelen = 0;
3071 uint64_t probelensum = 0;
3074 assert(hashmap !=
NULL);
3076 for( i = 0; i < nslots; ++i )
3078 if( (*hashmap)->hashes[i] != 0 )
3080 uint32_t probelen = ((i + (*hashmap)->mask + 1 - ((*hashmap)->hashes[i]>>((*hashmap)->shift))) & (*hashmap)->mask) + 1;
3081 probelensum += probelen;
3082 maxprobelen =
MAX(probelen, maxprobelen);
3087 (
unsigned int)(*hashmap)->nelements, (
unsigned int)(*hashmap)->nelements, (
unsigned int)nslots,
3089 if( (*hashmap)->nelements > 0 )
3090 SCIPdebugPrintf(
", avg. probe length is %.1f, max. probe length is %u",
3091 (
SCIP_Real)(probelensum)/(
SCIP_Real)(*hashmap)->nelements, (
unsigned int)maxprobelen);
3115 assert(hashmap !=
NULL);
3118 assert(hashmap->
mask > 0);
3151 assert(hashmap !=
NULL);
3154 assert(hashmap->
mask > 0);
3187 assert(hashmap !=
NULL);
3190 assert(hashmap->
mask > 0);
3218 assert(hashmap !=
NULL);
3221 assert(hashmap->
mask > 0);
3238 assert(hashmap !=
NULL);
3241 assert(hashmap->
mask > 0);
3258 assert(hashmap !=
NULL);
3261 assert(hashmap->
mask > 0);
3282 assert(hashmap !=
NULL);
3284 assert(hashmap->
mask > 0);
3316 assert(hashmap !=
NULL);
3318 assert(hashmap->
mask > 0);
3350 assert(hashmap !=
NULL);
3352 assert(hashmap->
mask > 0);
3380 assert(hashmap !=
NULL);
3383 assert(hashmap->
mask > 0);
3396 assert(hashmap !=
NULL);
3398 assert(hashmap->
mask > 0);
3400 assert(origin !=
NULL);
3405 hashmap->
hashes[pos] = 0;
3411 uint32_t nextpos = (pos + 1) & hashmap->
mask;
3414 if( hashmap->
hashes[nextpos] == 0 )
3418 if( (hashmap->
hashes[nextpos]>>(hashmap->
shift)) == nextpos )
3425 hashmap->
hashes[nextpos] = 0;
3440 uint32_t maxprobelen = 0;
3441 uint64_t probelensum = 0;
3445 assert(hashmap !=
NULL);
3447 nslots = hashmap->
mask + 1;
3450 for( i = 0; i < nslots; ++i )
3452 if( hashmap->
hashes[i] != 0 )
3455 probelensum += probelen;
3456 maxprobelen =
MAX(probelen, maxprobelen);
3477 assert(hashmap !=
NULL);
3495 return (
int) hashmap->
mask + 1;
3504 assert(hashmap !=
NULL);
3506 return hashmap->
hashes[entryidx] == 0 ?
NULL : &hashmap->
slots[entryidx];
3514 assert(entry !=
NULL);
3524 assert(entry !=
NULL);
3534 assert(entry !=
NULL);
3544 assert(entry !=
NULL);
3555 assert(entry !=
NULL);
3566 assert(entry !=
NULL);
3577 assert(entry !=
NULL);
3587 assert(hashmap !=
NULL);
3602 #undef ELEM_DISTANCE 3604 #define ELEM_DISTANCE(pos) (((pos) + nslots - hashSetDesiredPos(hashset, hashset->slots[(pos)])) & mask) 3613 return (uint32_t)((UINT64_C(0x9e3779b97f4a7c15) * (uintptr_t)element)>>(hashset->
shift));
3622 uint32_t elemdistance;
3627 assert(hashset !=
NULL);
3629 assert(element !=
NULL);
3643 hashset->
slots[pos] = element;
3648 if( hashset->
slots[pos] == element )
3653 if( distance < elemdistance )
3656 elemdistance = distance;
3661 pos = (pos + 1) & mask;
3673 assert(hashset !=
NULL);
3674 assert(hashset->
shift < 64);
3677 if( ((((uint64_t)hashset->
nelements)<<10)>>(64-hashset->
shift) > 921) )
3686 newnslots = 2*nslots;
3696 for( i = 0; i < nslots; ++i )
3698 if( slots[i] !=
NULL )
3718 assert(hashset !=
NULL);
3720 assert(blkmem !=
NULL);
3729 (*hashset)->shift = 64;
3730 (*hashset)->shift -= (
unsigned int)ceil(log(
MAX(8.0, size / 0.9)) / log(2.0));
3732 (*hashset)->nelements = 0;
3756 assert(hashset !=
NULL);
3775 uint32_t elemdistance;
3777 assert(hashset !=
NULL);
3790 if( hashset->
slots[pos] == element )
3799 if( elemdistance > distance )
3802 pos = (pos + 1) & mask;
3816 uint32_t elemdistance;
3818 assert(hashset !=
NULL);
3820 assert(element !=
NULL);
3832 if( hashset->
slots[pos] == element )
3841 if( elemdistance > distance )
3844 pos = (pos + 1) & mask;
3848 assert(hashset->
slots[pos] == element);
3857 uint32_t nextpos = (pos + 1) & mask;
3876 hashset->
slots[pos] = hashset->
slots[nextpos];
3888 uint32_t maxprobelen = 0;
3889 uint64_t probelensum = 0;
3894 assert(hashset !=
NULL);
3900 for( i = 0; i < nslots; ++i )
3905 probelensum += probelen;
3906 maxprobelen =
MAX(probelen, maxprobelen);
3928 #undef SCIPhashsetIsEmpty 3929 #undef SCIPhashsetGetNElements 3930 #undef SCIPhashsetGetNSlots 3931 #undef SCIPhashsetGetSlots 3954 return (
int) (1u << (64 - hashset->
shift));
3962 return hashset->
slots;
3985 assert(realarray !=
NULL);
3986 assert(blkmem !=
NULL);
3989 (*realarray)->blkmem = blkmem;
3990 (*realarray)->vals =
NULL;
3991 (*realarray)->valssize = 0;
3992 (*realarray)->firstidx = -1;
3993 (*realarray)->minusedidx = INT_MAX;
3994 (*realarray)->maxusedidx = INT_MIN;
4006 assert(realarray !=
NULL);
4007 assert(sourcerealarray !=
NULL);
4010 if( sourcerealarray->
valssize > 0 )
4015 (*realarray)->valssize = sourcerealarray->
valssize;
4016 (*realarray)->firstidx = sourcerealarray->
firstidx;
4017 (*realarray)->minusedidx = sourcerealarray->
minusedidx;
4018 (*realarray)->maxusedidx = sourcerealarray->
maxusedidx;
4028 assert(realarray !=
NULL);
4029 assert(*realarray !=
NULL);
4051 assert(realarray !=
NULL);
4056 assert(0 <= minidx);
4057 assert(minidx <= maxidx);
4061 assert(0 <= minidx);
4062 assert(minidx <= maxidx);
4064 SCIPdebugMessage(
"extending realarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
4065 (
void*)realarray, realarray->
firstidx, realarray->valssize, realarray->minusedidx, realarray->maxusedidx, minidx, maxidx);
4068 nused = maxidx - minidx + 1;
4069 if( nused > realarray->valssize )
4075 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
4077 nfree = newvalssize - nused;
4078 newfirstidx = minidx - nfree/2;
4079 newfirstidx =
MAX(newfirstidx, 0);
4080 assert(newfirstidx <= minidx);
4081 assert(maxidx < newfirstidx + newvalssize);
4084 if( realarray->firstidx != -1 )
4086 for( i = 0; i < realarray->minusedidx - newfirstidx; ++i )
4090 assert(realarray->maxusedidx - realarray->minusedidx + 1 > 0);
4093 &(realarray->vals[realarray->minusedidx - realarray->firstidx]),
4094 realarray->maxusedidx - realarray->minusedidx + 1);
4095 for( i = realarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
4100 for( i = 0; i < newvalssize; ++i )
4106 realarray->vals = newvals;
4107 realarray->valssize = newvalssize;
4108 realarray->firstidx = newfirstidx;
4110 else if( realarray->firstidx == -1 )
4113 nfree = realarray->valssize - nused;
4115 realarray->firstidx = minidx - nfree/2;
4116 assert(realarray->firstidx <= minidx);
4117 assert(maxidx < realarray->firstidx + realarray->valssize);
4119 for( i = 0; i < realarray->valssize; ++i )
4120 assert(realarray->vals[i] == 0.0);
4123 else if( minidx < realarray->firstidx )
4126 nfree = realarray->valssize - nused;
4128 newfirstidx = minidx - nfree/2;
4129 newfirstidx =
MAX(newfirstidx, 0);
4130 assert(newfirstidx <= minidx);
4131 assert(maxidx < newfirstidx + realarray->valssize);
4133 if( realarray->minusedidx <= realarray->maxusedidx )
4137 assert(realarray->firstidx <= realarray->minusedidx);
4138 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4141 shift = realarray->firstidx - newfirstidx;
4143 for( i = realarray->maxusedidx - realarray->firstidx; i >= realarray->minusedidx - realarray->firstidx; --i )
4145 assert(0 <= i + shift && i + shift < realarray->valssize);
4146 realarray->vals[i + shift] = realarray->vals[i];
4149 for( i = 0; i < shift; ++i )
4150 realarray->vals[realarray->minusedidx - realarray->firstidx + i] = 0.0;
4152 realarray->firstidx = newfirstidx;
4154 else if( maxidx >= realarray->firstidx + realarray->valssize )
4157 nfree = realarray->valssize - nused;
4159 newfirstidx = minidx - nfree/2;
4160 newfirstidx =
MAX(newfirstidx, 0);
4161 assert(newfirstidx <= minidx);
4162 assert(maxidx < newfirstidx + realarray->valssize);
4164 if( realarray->minusedidx <= realarray->maxusedidx )
4168 assert(realarray->firstidx <= realarray->minusedidx);
4169 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4172 shift = newfirstidx - realarray->firstidx;
4174 for( i = realarray->minusedidx - realarray->firstidx; i <= realarray->maxusedidx - realarray->firstidx; ++i )
4176 assert(0 <= i - shift && i - shift < realarray->valssize);
4177 realarray->vals[i - shift] = realarray->vals[i];
4180 for( i = 0; i < shift; ++i )
4181 realarray->vals[realarray->maxusedidx - realarray->firstidx - i] = 0.0;
4183 realarray->firstidx = newfirstidx;
4186 assert(minidx >= realarray->firstidx);
4187 assert(maxidx < realarray->firstidx + realarray->valssize);
4197 assert(realarray !=
NULL);
4199 SCIPdebugMessage(
"clearing realarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
4200 (
void*)realarray, realarray->
firstidx, realarray->valssize, realarray->minusedidx, realarray->maxusedidx);
4202 if( realarray->minusedidx <= realarray->maxusedidx )
4204 assert(realarray->firstidx <= realarray->minusedidx);
4205 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4206 assert(realarray->firstidx != -1);
4207 assert(realarray->valssize > 0);
4211 realarray->maxusedidx - realarray->minusedidx + 1);
4214 realarray->minusedidx = INT_MAX;
4215 realarray->maxusedidx = INT_MIN;
4217 assert(realarray->minusedidx == INT_MAX);
4218 assert(realarray->maxusedidx == INT_MIN);
4229 assert(realarray !=
NULL);
4232 if( idx < realarray->minusedidx || idx > realarray->
maxusedidx )
4237 assert(idx - realarray->
firstidx >= 0);
4253 assert(realarray !=
NULL);
4256 SCIPdebugMessage(
"setting realarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %g\n",
4257 (
void*)realarray, realarray->
firstidx, realarray->valssize, realarray->minusedidx, realarray->maxusedidx, idx, val);
4263 assert(idx >= realarray->firstidx);
4264 assert(idx < realarray->firstidx + realarray->valssize);
4267 realarray->vals[idx - realarray->firstidx] = val;
4270 realarray->minusedidx = MIN(realarray->minusedidx, idx);
4271 realarray->maxusedidx =
MAX(realarray->maxusedidx, idx);
4273 else if( idx >= realarray->firstidx && idx < realarray->firstidx + realarray->valssize )
4276 realarray->vals[idx - realarray->firstidx] = 0.0;
4279 if( idx == realarray->minusedidx )
4281 assert(realarray->maxusedidx >= 0);
4282 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4285 realarray->minusedidx++;
4287 while( realarray->minusedidx <= realarray->maxusedidx
4288 && realarray->vals[realarray->minusedidx - realarray->firstidx] == 0.0 );
4290 if( realarray->minusedidx > realarray->maxusedidx )
4292 realarray->minusedidx = INT_MAX;
4293 realarray->maxusedidx = INT_MIN;
4296 else if( idx == realarray->maxusedidx )
4298 assert(realarray->minusedidx >= 0);
4299 assert(realarray->minusedidx < realarray->maxusedidx);
4300 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4303 realarray->maxusedidx--;
4304 assert(realarray->minusedidx <= realarray->maxusedidx);
4306 while( realarray->vals[realarray->maxusedidx - realarray->firstidx] == 0.0 );
4336 assert(realarray !=
NULL);
4346 assert(realarray !=
NULL);
4357 assert(intarray !=
NULL);
4358 assert(blkmem !=
NULL);
4361 (*intarray)->blkmem = blkmem;
4362 (*intarray)->vals =
NULL;
4363 (*intarray)->valssize = 0;
4364 (*intarray)->firstidx = -1;
4365 (*intarray)->minusedidx = INT_MAX;
4366 (*intarray)->maxusedidx = INT_MIN;
4378 assert(intarray !=
NULL);
4379 assert(sourceintarray !=
NULL);
4386 (*intarray)->valssize = sourceintarray->
valssize;
4387 (*intarray)->firstidx = sourceintarray->
firstidx;
4388 (*intarray)->minusedidx = sourceintarray->
minusedidx;
4389 (*intarray)->maxusedidx = sourceintarray->
maxusedidx;
4399 assert(intarray !=
NULL);
4400 assert(*intarray !=
NULL);
4422 assert(intarray !=
NULL);
4427 assert(0 <= minidx);
4428 assert(minidx <= maxidx);
4432 assert(0 <= minidx);
4433 assert(minidx <= maxidx);
4435 SCIPdebugMessage(
"extending intarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
4436 (
void*)intarray, intarray->
firstidx, intarray->valssize, intarray->minusedidx, intarray->maxusedidx, minidx, maxidx);
4439 nused = maxidx - minidx + 1;
4440 if( nused > intarray->valssize )
4446 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
4448 nfree = newvalssize - nused;
4449 newfirstidx = minidx - nfree/2;
4450 newfirstidx =
MAX(newfirstidx, 0);
4451 assert(newfirstidx <= minidx);
4452 assert(maxidx < newfirstidx + newvalssize);
4455 if( intarray->firstidx != -1 )
4457 for( i = 0; i < intarray->minusedidx - newfirstidx; ++i )
4461 assert(intarray->maxusedidx - intarray->minusedidx + 1 > 0);
4464 &intarray->vals[intarray->minusedidx - intarray->firstidx],
4465 intarray->maxusedidx - intarray->minusedidx + 1);
4466 for( i = intarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
4471 for( i = 0; i < newvalssize; ++i )
4477 intarray->vals = newvals;
4478 intarray->valssize = newvalssize;
4479 intarray->firstidx = newfirstidx;
4481 else if( intarray->firstidx == -1 )
4484 nfree = intarray->valssize - nused;
4486 intarray->firstidx = minidx - nfree/2;
4487 assert(intarray->firstidx <= minidx);
4488 assert(maxidx < intarray->firstidx + intarray->valssize);
4490 for( i = 0; i < intarray->valssize; ++i )
4491 assert(intarray->vals[i] == 0);
4494 else if( minidx < intarray->firstidx )
4497 nfree = intarray->valssize - nused;
4499 newfirstidx = minidx - nfree/2;
4500 newfirstidx =
MAX(newfirstidx, 0);
4501 assert(newfirstidx <= minidx);
4502 assert(maxidx < newfirstidx + intarray->valssize);
4504 if( intarray->minusedidx <= intarray->maxusedidx )
4508 assert(intarray->firstidx <= intarray->minusedidx);
4509 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4512 shift = intarray->firstidx - newfirstidx;
4514 for( i = intarray->maxusedidx - intarray->firstidx; i >= intarray->minusedidx - intarray->firstidx; --i )
4516 assert(0 <= i + shift && i + shift < intarray->valssize);
4517 intarray->vals[i + shift] = intarray->vals[i];
4520 for( i = 0; i < shift; ++i )
4521 intarray->vals[intarray->minusedidx - intarray->firstidx + i] = 0;
4523 intarray->firstidx = newfirstidx;
4525 else if( maxidx >= intarray->firstidx + intarray->valssize )
4528 nfree = intarray->valssize - nused;
4530 newfirstidx = minidx - nfree/2;
4531 newfirstidx =
MAX(newfirstidx, 0);
4532 assert(newfirstidx <= minidx);
4533 assert(maxidx < newfirstidx + intarray->valssize);
4535 if( intarray->minusedidx <= intarray->maxusedidx )
4539 assert(intarray->firstidx <= intarray->minusedidx);
4540 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4543 shift = newfirstidx - intarray->firstidx;
4545 for( i = intarray->minusedidx - intarray->firstidx; i <= intarray->maxusedidx - intarray->firstidx; ++i )
4547 assert(0 <= i - shift && i - shift < intarray->valssize);
4548 intarray->vals[i - shift] = intarray->vals[i];
4551 for( i = 0; i < shift; ++i )
4552 intarray->vals[intarray->maxusedidx - intarray->firstidx - i] = 0;
4554 intarray->firstidx = newfirstidx;
4557 assert(minidx >= intarray->firstidx);
4558 assert(maxidx < intarray->firstidx + intarray->valssize);
4568 assert(intarray !=
NULL);
4570 SCIPdebugMessage(
"clearing intarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
4571 (
void*)intarray, intarray->
firstidx, intarray->valssize, intarray->minusedidx, intarray->maxusedidx);
4573 if( intarray->minusedidx <= intarray->maxusedidx )
4575 assert(intarray->firstidx <= intarray->minusedidx);
4576 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4577 assert(intarray->firstidx != -1);
4578 assert(intarray->valssize > 0);
4582 intarray->maxusedidx - intarray->minusedidx + 1);
4585 intarray->minusedidx = INT_MAX;
4586 intarray->maxusedidx = INT_MIN;
4588 assert(intarray->minusedidx == INT_MAX);
4589 assert(intarray->maxusedidx == INT_MIN);
4600 assert(intarray !=
NULL);
4603 if( idx < intarray->minusedidx || idx > intarray->
maxusedidx )
4608 assert(idx - intarray->
firstidx >= 0);
4624 assert(intarray !=
NULL);
4627 SCIPdebugMessage(
"setting intarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %d\n",
4628 (
void*)intarray, intarray->
firstidx, intarray->valssize, intarray->minusedidx, intarray->maxusedidx, idx, val);
4634 assert(idx >= intarray->firstidx);
4635 assert(idx < intarray->firstidx + intarray->valssize);
4638 intarray->vals[idx - intarray->firstidx] = val;
4641 intarray->minusedidx = MIN(intarray->minusedidx, idx);
4642 intarray->maxusedidx =
MAX(intarray->maxusedidx, idx);
4644 else if( idx >= intarray->firstidx && idx < intarray->firstidx + intarray->valssize )
4647 intarray->vals[idx - intarray->firstidx] = 0;
4650 if( idx == intarray->minusedidx )
4652 assert(intarray->maxusedidx >= 0);
4653 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4656 intarray->minusedidx++;
4658 while( intarray->minusedidx <= intarray->maxusedidx
4659 && intarray->vals[intarray->minusedidx - intarray->firstidx] == 0 );
4660 if( intarray->minusedidx > intarray->maxusedidx )
4662 intarray->minusedidx = INT_MAX;
4663 intarray->maxusedidx = INT_MIN;
4666 else if( idx == intarray->maxusedidx )
4668 assert(intarray->minusedidx >= 0);
4669 assert(intarray->minusedidx < intarray->maxusedidx);
4670 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4673 intarray->maxusedidx--;
4674 assert(intarray->minusedidx <= intarray->maxusedidx);
4676 while( intarray->vals[intarray->maxusedidx - intarray->firstidx] == 0 );
4700 assert(intarray !=
NULL);
4710 assert(intarray !=
NULL);
4722 assert(boolarray !=
NULL);
4723 assert(blkmem !=
NULL);
4726 (*boolarray)->blkmem = blkmem;
4727 (*boolarray)->vals =
NULL;
4728 (*boolarray)->valssize = 0;
4729 (*boolarray)->firstidx = -1;
4730 (*boolarray)->minusedidx = INT_MAX;
4731 (*boolarray)->maxusedidx = INT_MIN;
4743 assert(boolarray !=
NULL);
4744 assert(sourceboolarray !=
NULL);
4747 if( sourceboolarray->
valssize > 0 )
4752 (*boolarray)->valssize = sourceboolarray->
valssize;
4753 (*boolarray)->firstidx = sourceboolarray->
firstidx;
4754 (*boolarray)->minusedidx = sourceboolarray->
minusedidx;
4755 (*boolarray)->maxusedidx = sourceboolarray->
maxusedidx;
4765 assert(boolarray !=
NULL);
4766 assert(*boolarray !=
NULL);
4788 assert(boolarray !=
NULL);
4793 assert(0 <= minidx);
4794 assert(minidx <= maxidx);
4798 assert(0 <= minidx);
4799 assert(minidx <= maxidx);
4801 SCIPdebugMessage(
"extending boolarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
4802 (
void*)boolarray, boolarray->
firstidx, boolarray->valssize, boolarray->minusedidx, boolarray->maxusedidx, minidx, maxidx);
4805 nused = maxidx - minidx + 1;
4806 if( nused > boolarray->valssize )
4812 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
4814 nfree = newvalssize - nused;
4815 newfirstidx = minidx - nfree/2;
4816 newfirstidx =
MAX(newfirstidx, 0);
4817 assert(newfirstidx <= minidx);
4818 assert(maxidx < newfirstidx + newvalssize);
4821 if( boolarray->firstidx != -1 )
4823 for( i = 0; i < boolarray->minusedidx - newfirstidx; ++i )
4827 assert(boolarray->maxusedidx - boolarray->minusedidx + 1 > 0);
4830 &boolarray->vals[boolarray->minusedidx - boolarray->firstidx],
4831 boolarray->maxusedidx - boolarray->minusedidx + 1);
4832 for( i = boolarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
4837 for( i = 0; i < newvalssize; ++i )
4843 boolarray->vals = newvals;
4844 boolarray->valssize = newvalssize;
4845 boolarray->firstidx = newfirstidx;
4847 else if( boolarray->firstidx == -1 )
4850 nfree = boolarray->valssize - nused;
4852 boolarray->firstidx = minidx - nfree/2;
4853 assert(boolarray->firstidx <= minidx);
4854 assert(maxidx < boolarray->firstidx + boolarray->valssize);
4856 for( i = 0; i < boolarray->valssize; ++i )
4857 assert(boolarray->vals[i] ==
FALSE);
4860 else if( minidx < boolarray->firstidx )
4863 nfree = boolarray->valssize - nused;
4865 newfirstidx = minidx - nfree/2;
4866 newfirstidx =
MAX(newfirstidx, 0);
4867 assert(newfirstidx <= minidx);
4868 assert(maxidx < newfirstidx + boolarray->valssize);
4870 if( boolarray->minusedidx <= boolarray->maxusedidx )
4874 assert(boolarray->firstidx <= boolarray->minusedidx);
4875 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4878 shift = boolarray->firstidx - newfirstidx;
4880 for( i = boolarray->maxusedidx - boolarray->firstidx; i >= boolarray->minusedidx - boolarray->firstidx; --i )
4882 assert(0 <= i + shift && i + shift < boolarray->valssize);
4883 boolarray->vals[i + shift] = boolarray->vals[i];
4886 for( i = 0; i < shift; ++i )
4887 boolarray->vals[boolarray->minusedidx - boolarray->firstidx + i] =
FALSE;
4889 boolarray->firstidx = newfirstidx;
4891 else if( maxidx >= boolarray->firstidx + boolarray->valssize )
4894 nfree = boolarray->valssize - nused;
4896 newfirstidx = minidx - nfree/2;
4897 newfirstidx =
MAX(newfirstidx, 0);
4898 assert(newfirstidx <= minidx);
4899 assert(maxidx < newfirstidx + boolarray->valssize);
4901 if( boolarray->minusedidx <= boolarray->maxusedidx )
4905 assert(boolarray->firstidx <= boolarray->minusedidx);
4906 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4909 shift = newfirstidx - boolarray->firstidx;
4912 assert(0 <= boolarray->minusedidx - boolarray->firstidx - shift);
4913 assert(boolarray->maxusedidx - boolarray->firstidx - shift < boolarray->valssize);
4914 BMSmoveMemoryArray(&(boolarray->vals[boolarray->minusedidx - boolarray->firstidx - shift]),
4915 &(boolarray->vals[boolarray->minusedidx - boolarray->firstidx]),
4916 boolarray->maxusedidx - boolarray->minusedidx + 1);
4919 for( i = 0; i < shift; ++i )
4920 boolarray->vals[boolarray->maxusedidx - boolarray->firstidx - i] =
FALSE;
4922 boolarray->firstidx = newfirstidx;
4925 assert(minidx >= boolarray->firstidx);
4926 assert(maxidx < boolarray->firstidx + boolarray->valssize);
4936 assert(boolarray !=
NULL);
4938 SCIPdebugMessage(
"clearing boolarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
4939 (
void*)boolarray, boolarray->
firstidx, boolarray->valssize, boolarray->minusedidx, boolarray->maxusedidx);
4941 if( boolarray->minusedidx <= boolarray->maxusedidx )
4943 assert(boolarray->firstidx <= boolarray->minusedidx);
4944 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4945 assert(boolarray->firstidx != -1);
4946 assert(boolarray->valssize > 0);
4950 boolarray->maxusedidx - boolarray->minusedidx + 1);
4953 boolarray->minusedidx = INT_MAX;
4954 boolarray->maxusedidx = INT_MIN;
4956 assert(boolarray->minusedidx == INT_MAX);
4957 assert(boolarray->maxusedidx == INT_MIN);
4968 assert(boolarray !=
NULL);
4971 if( idx < boolarray->minusedidx || idx > boolarray->
maxusedidx )
4976 assert(idx - boolarray->
firstidx >= 0);
4992 assert(boolarray !=
NULL);
4995 SCIPdebugMessage(
"setting boolarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %u\n",
4996 (
void*)boolarray, boolarray->
firstidx, boolarray->valssize, boolarray->minusedidx, boolarray->maxusedidx, idx, val);
5002 assert(idx >= boolarray->firstidx);
5003 assert(idx < boolarray->firstidx + boolarray->valssize);
5006 boolarray->vals[idx - boolarray->firstidx] = val;
5009 boolarray->minusedidx = MIN(boolarray->minusedidx, idx);
5010 boolarray->maxusedidx =
MAX(boolarray->maxusedidx, idx);
5012 else if( idx >= boolarray->firstidx && idx < boolarray->firstidx + boolarray->valssize )
5015 boolarray->vals[idx - boolarray->firstidx] =
FALSE;
5018 if( idx == boolarray->minusedidx )
5020 assert(boolarray->maxusedidx >= 0);
5021 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
5024 boolarray->minusedidx++;
5026 while( boolarray->minusedidx <= boolarray->maxusedidx
5027 && boolarray->vals[boolarray->minusedidx - boolarray->firstidx] ==
FALSE );
5028 if( boolarray->minusedidx > boolarray->maxusedidx )
5030 boolarray->minusedidx = INT_MAX;
5031 boolarray->maxusedidx = INT_MIN;
5034 else if( idx == boolarray->maxusedidx )
5036 assert(boolarray->minusedidx >= 0);
5037 assert(boolarray->minusedidx < boolarray->maxusedidx);
5038 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
5041 boolarray->maxusedidx--;
5042 assert(boolarray->minusedidx <= boolarray->maxusedidx);
5044 while( boolarray->vals[boolarray->maxusedidx - boolarray->firstidx] ==
FALSE );
5056 assert(boolarray !=
NULL);
5066 assert(boolarray !=
NULL);
5078 assert(ptrarray !=
NULL);
5079 assert(blkmem !=
NULL);
5082 (*ptrarray)->blkmem = blkmem;
5083 (*ptrarray)->vals =
NULL;
5084 (*ptrarray)->valssize = 0;
5085 (*ptrarray)->firstidx = -1;
5086 (*ptrarray)->minusedidx = INT_MAX;
5087 (*ptrarray)->maxusedidx = INT_MIN;
5099 assert(ptrarray !=
NULL);
5100 assert(sourceptrarray !=
NULL);
5107 (*ptrarray)->valssize = sourceptrarray->
valssize;
5108 (*ptrarray)->firstidx = sourceptrarray->
firstidx;
5109 (*ptrarray)->minusedidx = sourceptrarray->
minusedidx;
5110 (*ptrarray)->maxusedidx = sourceptrarray->
maxusedidx;
5120 assert(ptrarray !=
NULL);
5121 assert(*ptrarray !=
NULL);
5143 assert(ptrarray !=
NULL);
5148 assert(0 <= minidx);
5149 assert(minidx <= maxidx);
5153 assert(0 <= minidx);
5154 assert(minidx <= maxidx);
5156 SCIPdebugMessage(
"extending ptrarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
5157 (
void*)ptrarray, ptrarray->
firstidx, ptrarray->valssize, ptrarray->minusedidx, ptrarray->maxusedidx, minidx, maxidx);
5160 nused = maxidx - minidx + 1;
5161 if( nused > ptrarray->valssize )
5167 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
5169 nfree = newvalssize - nused;
5170 newfirstidx = minidx - nfree/2;
5171 newfirstidx =
MAX(newfirstidx, 0);
5172 assert(newfirstidx <= minidx);
5173 assert(maxidx < newfirstidx + newvalssize);
5176 if( ptrarray->firstidx != -1 )
5178 for( i = 0; i < ptrarray->minusedidx - newfirstidx; ++i )
5182 assert(ptrarray->maxusedidx - ptrarray->minusedidx + 1 > 0);
5185 &(ptrarray->vals[ptrarray->minusedidx - ptrarray->firstidx]),
5186 ptrarray->maxusedidx - ptrarray->minusedidx + 1);
5187 for( i = ptrarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
5192 for( i = 0; i < newvalssize; ++i )
5198 ptrarray->vals = newvals;
5199 ptrarray->valssize = newvalssize;
5200 ptrarray->firstidx = newfirstidx;
5202 else if( ptrarray->firstidx == -1 )
5205 nfree = ptrarray->valssize - nused;
5207 ptrarray->firstidx = minidx - nfree/2;
5208 assert(ptrarray->firstidx <= minidx);
5209 assert(maxidx < ptrarray->firstidx + ptrarray->valssize);
5211 for( i = 0; i < ptrarray->valssize; ++i )
5212 assert(ptrarray->vals[i] ==
NULL);
5215 else if( minidx < ptrarray->firstidx )
5218 nfree = ptrarray->valssize - nused;
5220 newfirstidx = minidx - nfree/2;
5221 newfirstidx =
MAX(newfirstidx, 0);
5222 assert(newfirstidx <= minidx);
5223 assert(maxidx < newfirstidx + ptrarray->valssize);
5225 if( ptrarray->minusedidx <= ptrarray->maxusedidx )
5229 assert(ptrarray->firstidx <= ptrarray->minusedidx);
5230 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5233 shift = ptrarray->firstidx - newfirstidx;
5235 for( i = ptrarray->maxusedidx - ptrarray->firstidx; i >= ptrarray->minusedidx - ptrarray->firstidx; --i )
5237 assert(0 <= i + shift && i + shift < ptrarray->valssize);
5238 ptrarray->vals[i + shift] = ptrarray->vals[i];
5241 for( i = 0; i < shift; ++i )
5242 ptrarray->vals[ptrarray->minusedidx - ptrarray->firstidx + i] =
NULL;
5244 ptrarray->firstidx = newfirstidx;
5246 else if( maxidx >= ptrarray->firstidx + ptrarray->valssize )
5249 nfree = ptrarray->valssize - nused;
5251 newfirstidx = minidx - nfree/2;
5252 newfirstidx =
MAX(newfirstidx, 0);
5253 assert(newfirstidx <= minidx);
5254 assert(maxidx < newfirstidx + ptrarray->valssize);
5256 if( ptrarray->minusedidx <= ptrarray->maxusedidx )
5260 assert(ptrarray->firstidx <= ptrarray->minusedidx);
5261 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5264 shift = newfirstidx - ptrarray->firstidx;
5266 for( i = ptrarray->minusedidx - ptrarray->firstidx; i <= ptrarray->maxusedidx - ptrarray->firstidx; ++i )
5268 assert(0 <= i - shift && i - shift < ptrarray->valssize);
5269 ptrarray->vals[i - shift] = ptrarray->vals[i];
5272 for( i = 0; i < shift; ++i )
5273 ptrarray->vals[ptrarray->maxusedidx - ptrarray->firstidx - i] =
NULL;
5275 ptrarray->firstidx = newfirstidx;
5278 assert(minidx >= ptrarray->firstidx);
5279 assert(maxidx < ptrarray->firstidx + ptrarray->valssize);
5289 assert(ptrarray !=
NULL);
5291 SCIPdebugMessage(
"clearing ptrarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
5292 (
void*)ptrarray, ptrarray->
firstidx, ptrarray->valssize, ptrarray->minusedidx, ptrarray->maxusedidx);
5294 if( ptrarray->minusedidx <= ptrarray->maxusedidx )
5296 assert(ptrarray->firstidx <= ptrarray->minusedidx);
5297 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5298 assert(ptrarray->firstidx != -1);
5299 assert(ptrarray->valssize > 0);
5303 ptrarray->maxusedidx - ptrarray->minusedidx + 1);
5306 ptrarray->minusedidx = INT_MAX;
5307 ptrarray->maxusedidx = INT_MIN;
5309 assert(ptrarray->minusedidx == INT_MAX);
5310 assert(ptrarray->maxusedidx == INT_MIN);
5321 assert(ptrarray !=
NULL);
5324 if( idx < ptrarray->minusedidx || idx > ptrarray->
maxusedidx )
5329 assert(idx - ptrarray->
firstidx >= 0);
5345 assert(ptrarray !=
NULL);
5348 SCIPdebugMessage(
"setting ptrarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %p\n",
5349 (
void*)ptrarray, ptrarray->
firstidx, ptrarray->valssize, ptrarray->minusedidx, ptrarray->maxusedidx, idx, val);
5355 assert(idx >= ptrarray->firstidx);
5356 assert(idx < ptrarray->firstidx + ptrarray->valssize);
5359 ptrarray->vals[idx - ptrarray->firstidx] = val;
5362 ptrarray->minusedidx = MIN(ptrarray->minusedidx, idx);
5363 ptrarray->maxusedidx =
MAX(ptrarray->maxusedidx, idx);
5365 else if( idx >= ptrarray->firstidx && idx < ptrarray->firstidx + ptrarray->valssize )
5368 ptrarray->vals[idx - ptrarray->firstidx] =
NULL;
5371 if( idx == ptrarray->minusedidx )
5373 assert(ptrarray->maxusedidx >= 0);
5374 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5377 ptrarray->minusedidx++;
5379 while( ptrarray->minusedidx <= ptrarray->maxusedidx
5380 && ptrarray->vals[ptrarray->minusedidx - ptrarray->firstidx] ==
NULL );
5381 if( ptrarray->minusedidx > ptrarray->maxusedidx )
5383 ptrarray->minusedidx = INT_MAX;
5384 ptrarray->maxusedidx = INT_MIN;
5387 else if( idx == ptrarray->maxusedidx )
5389 assert(ptrarray->minusedidx >= 0);
5390 assert(ptrarray->minusedidx < ptrarray->maxusedidx);
5391 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5394 ptrarray->maxusedidx--;
5395 assert(ptrarray->minusedidx <= ptrarray->maxusedidx);
5397 while( ptrarray->vals[ptrarray->maxusedidx - ptrarray->firstidx] ==
NULL );
5409 assert(ptrarray !=
NULL);
5419 assert(ptrarray !=
NULL);
5435 value1 = (int)(
size_t)elem1;
5436 value2 = (int)(
size_t)elem2;
5438 if( value1 < value2 )
5441 if( value2 < value1 )
5459 assert(indcomp !=
NULL);
5460 assert(len == 0 || perm !=
NULL);
5463 for( pos = 0; pos < len; ++pos )
5470 #define SORTTPL_NAMEEXT Ind 5471 #define SORTTPL_KEYTYPE int 5472 #define SORTTPL_INDCOMP 5477 #define SORTTPL_NAMEEXT Ptr 5478 #define SORTTPL_KEYTYPE void* 5479 #define SORTTPL_PTRCOMP 5484 #define SORTTPL_NAMEEXT PtrPtr 5485 #define SORTTPL_KEYTYPE void* 5486 #define SORTTPL_FIELD1TYPE void* 5487 #define SORTTPL_PTRCOMP 5492 #define SORTTPL_NAMEEXT PtrReal 5493 #define SORTTPL_KEYTYPE void* 5494 #define SORTTPL_FIELD1TYPE SCIP_Real 5495 #define SORTTPL_PTRCOMP 5500 #define SORTTPL_NAMEEXT PtrInt 5501 #define SORTTPL_KEYTYPE void* 5502 #define SORTTPL_FIELD1TYPE int 5503 #define SORTTPL_PTRCOMP 5508 #define SORTTPL_NAMEEXT PtrBool 5509 #define SORTTPL_KEYTYPE void* 5510 #define SORTTPL_FIELD1TYPE SCIP_Bool 5511 #define SORTTPL_PTRCOMP 5516 #define SORTTPL_NAMEEXT PtrIntInt 5517 #define SORTTPL_KEYTYPE void* 5518 #define SORTTPL_FIELD1TYPE int 5519 #define SORTTPL_FIELD2TYPE int 5520 #define SORTTPL_PTRCOMP 5525 #define SORTTPL_NAMEEXT PtrRealInt 5526 #define SORTTPL_KEYTYPE void* 5527 #define SORTTPL_FIELD1TYPE SCIP_Real 5528 #define SORTTPL_FIELD2TYPE int 5529 #define SORTTPL_PTRCOMP 5533 #define SORTTPL_NAMEEXT PtrRealRealInt 5534 #define SORTTPL_KEYTYPE void* 5535 #define SORTTPL_FIELD1TYPE SCIP_Real 5536 #define SORTTPL_FIELD2TYPE SCIP_Real 5537 #define SORTTPL_FIELD3TYPE int 5538 #define SORTTPL_PTRCOMP 5542 #define SORTTPL_NAMEEXT PtrRealRealBoolBool 5543 #define SORTTPL_KEYTYPE void* 5544 #define SORTTPL_FIELD1TYPE SCIP_Real 5545 #define SORTTPL_FIELD2TYPE SCIP_Real 5546 #define SORTTPL_FIELD3TYPE SCIP_Bool 5547 #define SORTTPL_FIELD4TYPE SCIP_Bool 5548 #define SORTTPL_PTRCOMP 5552 #define SORTTPL_NAMEEXT PtrRealRealIntBool 5553 #define SORTTPL_KEYTYPE void* 5554 #define SORTTPL_FIELD1TYPE SCIP_Real 5555 #define SORTTPL_FIELD2TYPE SCIP_Real 5556 #define SORTTPL_FIELD3TYPE int 5557 #define SORTTPL_FIELD4TYPE SCIP_Bool 5558 #define SORTTPL_PTRCOMP 5562 #define SORTTPL_NAMEEXT PtrRealBool 5563 #define SORTTPL_KEYTYPE void* 5564 #define SORTTPL_FIELD1TYPE SCIP_Real 5565 #define SORTTPL_FIELD2TYPE SCIP_Bool 5566 #define SORTTPL_PTRCOMP 5571 #define SORTTPL_NAMEEXT PtrPtrInt 5572 #define SORTTPL_KEYTYPE void* 5573 #define SORTTPL_FIELD1TYPE void* 5574 #define SORTTPL_FIELD2TYPE int 5575 #define SORTTPL_PTRCOMP 5580 #define SORTTPL_NAMEEXT PtrPtrReal 5581 #define SORTTPL_KEYTYPE void* 5582 #define SORTTPL_FIELD1TYPE void* 5583 #define SORTTPL_FIELD2TYPE SCIP_Real 5584 #define SORTTPL_PTRCOMP 5589 #define SORTTPL_NAMEEXT PtrRealIntInt 5590 #define SORTTPL_KEYTYPE void* 5591 #define SORTTPL_FIELD1TYPE SCIP_Real 5592 #define SORTTPL_FIELD2TYPE int 5593 #define SORTTPL_FIELD3TYPE int 5594 #define SORTTPL_PTRCOMP 5599 #define SORTTPL_NAMEEXT PtrPtrIntInt 5600 #define SORTTPL_KEYTYPE void* 5601 #define SORTTPL_FIELD1TYPE void* 5602 #define SORTTPL_FIELD2TYPE int 5603 #define SORTTPL_FIELD3TYPE int 5604 #define SORTTPL_PTRCOMP 5609 #define SORTTPL_NAMEEXT PtrPtrRealInt 5610 #define SORTTPL_KEYTYPE void* 5611 #define SORTTPL_FIELD1TYPE void* 5612 #define SORTTPL_FIELD2TYPE SCIP_Real 5613 #define SORTTPL_FIELD3TYPE int 5614 #define SORTTPL_PTRCOMP 5619 #define SORTTPL_NAMEEXT PtrPtrRealBool 5620 #define SORTTPL_KEYTYPE void* 5621 #define SORTTPL_FIELD1TYPE void* 5622 #define SORTTPL_FIELD2TYPE SCIP_Real 5623 #define SORTTPL_FIELD3TYPE SCIP_Bool 5624 #define SORTTPL_PTRCOMP 5629 #define SORTTPL_NAMEEXT PtrPtrLongInt 5630 #define SORTTPL_KEYTYPE void* 5631 #define SORTTPL_FIELD1TYPE void* 5632 #define SORTTPL_FIELD2TYPE SCIP_Longint 5633 #define SORTTPL_FIELD3TYPE int 5634 #define SORTTPL_PTRCOMP 5639 #define SORTTPL_NAMEEXT PtrPtrLongIntInt 5640 #define SORTTPL_KEYTYPE void* 5641 #define SORTTPL_FIELD1TYPE void* 5642 #define SORTTPL_FIELD2TYPE SCIP_Longint 5643 #define SORTTPL_FIELD3TYPE int 5644 #define SORTTPL_FIELD4TYPE int 5645 #define SORTTPL_PTRCOMP 5650 #define SORTTPL_NAMEEXT Real 5651 #define SORTTPL_KEYTYPE SCIP_Real 5656 #define SORTTPL_NAMEEXT RealBoolPtr 5657 #define SORTTPL_KEYTYPE SCIP_Real 5658 #define SORTTPL_FIELD1TYPE SCIP_Bool 5659 #define SORTTPL_FIELD2TYPE void* 5664 #define SORTTPL_NAMEEXT RealPtr 5665 #define SORTTPL_KEYTYPE SCIP_Real 5666 #define SORTTPL_FIELD1TYPE void* 5671 #define SORTTPL_NAMEEXT RealInt 5672 #define SORTTPL_KEYTYPE SCIP_Real 5673 #define SORTTPL_FIELD1TYPE int 5678 #define SORTTPL_NAMEEXT RealIntInt 5679 #define SORTTPL_KEYTYPE SCIP_Real 5680 #define SORTTPL_FIELD1TYPE int 5681 #define SORTTPL_FIELD2TYPE int 5686 #define SORTTPL_NAMEEXT RealIntLong 5687 #define SORTTPL_KEYTYPE SCIP_Real 5688 #define SORTTPL_FIELD1TYPE int 5689 #define SORTTPL_FIELD2TYPE SCIP_Longint 5694 #define SORTTPL_NAMEEXT RealIntPtr 5695 #define SORTTPL_KEYTYPE SCIP_Real 5696 #define SORTTPL_FIELD1TYPE int 5697 #define SORTTPL_FIELD2TYPE void* 5702 #define SORTTPL_NAMEEXT RealRealPtr 5703 #define SORTTPL_KEYTYPE SCIP_Real 5704 #define SORTTPL_FIELD1TYPE SCIP_Real 5705 #define SORTTPL_FIELD2TYPE void* 5710 #define SORTTPL_NAMEEXT RealLongRealInt 5711 #define SORTTPL_KEYTYPE SCIP_Real 5712 #define SORTTPL_FIELD1TYPE SCIP_Longint 5713 #define SORTTPL_FIELD2TYPE SCIP_Real 5714 #define SORTTPL_FIELD3TYPE int 5718 #define SORTTPL_NAMEEXT RealRealIntInt 5719 #define SORTTPL_KEYTYPE SCIP_Real 5720 #define SORTTPL_FIELD1TYPE SCIP_Real 5721 #define SORTTPL_FIELD2TYPE int 5722 #define SORTTPL_FIELD3TYPE int 5727 #define SORTTPL_NAMEEXT RealRealRealInt 5728 #define SORTTPL_KEYTYPE SCIP_Real 5729 #define SORTTPL_FIELD1TYPE SCIP_Real 5730 #define SORTTPL_FIELD2TYPE SCIP_Real 5731 #define SORTTPL_FIELD3TYPE int 5736 #define SORTTPL_NAMEEXT RealRealRealPtr 5737 #define SORTTPL_KEYTYPE SCIP_Real 5738 #define SORTTPL_FIELD1TYPE SCIP_Real 5739 #define SORTTPL_FIELD2TYPE SCIP_Real 5740 #define SORTTPL_FIELD3TYPE void* 5745 #define SORTTPL_NAMEEXT RealPtrPtrInt 5746 #define SORTTPL_KEYTYPE SCIP_Real 5747 #define SORTTPL_FIELD1TYPE void* 5748 #define SORTTPL_FIELD2TYPE void* 5749 #define SORTTPL_FIELD3TYPE int 5754 #define SORTTPL_NAMEEXT RealPtrPtrIntInt 5755 #define SORTTPL_KEYTYPE SCIP_Real 5756 #define SORTTPL_FIELD1TYPE void* 5757 #define SORTTPL_FIELD2TYPE void* 5758 #define SORTTPL_FIELD3TYPE int 5759 #define SORTTPL_FIELD4TYPE int 5764 #define SORTTPL_NAMEEXT RealRealRealBoolPtr 5765 #define SORTTPL_KEYTYPE SCIP_Real 5766 #define SORTTPL_FIELD1TYPE SCIP_Real 5767 #define SORTTPL_FIELD2TYPE SCIP_Real 5768 #define SORTTPL_FIELD3TYPE SCIP_Bool 5769 #define SORTTPL_FIELD4TYPE void* 5774 #define SORTTPL_NAMEEXT RealRealRealBoolBoolPtr 5775 #define SORTTPL_KEYTYPE SCIP_Real 5776 #define SORTTPL_FIELD1TYPE SCIP_Real 5777 #define SORTTPL_FIELD2TYPE SCIP_Real 5778 #define SORTTPL_FIELD3TYPE SCIP_Bool 5779 #define SORTTPL_FIELD4TYPE SCIP_Bool 5780 #define SORTTPL_FIELD5TYPE void* 5785 #define SORTTPL_NAMEEXT Int 5786 #define SORTTPL_KEYTYPE int 5791 #define SORTTPL_NAMEEXT IntInt 5792 #define SORTTPL_KEYTYPE int 5793 #define SORTTPL_FIELD1TYPE int 5798 #define SORTTPL_NAMEEXT IntReal 5799 #define SORTTPL_KEYTYPE int 5800 #define SORTTPL_FIELD1TYPE SCIP_Real 5805 #define SORTTPL_NAMEEXT IntPtr 5806 #define SORTTPL_KEYTYPE int 5807 #define SORTTPL_FIELD1TYPE void* 5812 #define SORTTPL_NAMEEXT IntIntInt 5813 #define SORTTPL_KEYTYPE int 5814 #define SORTTPL_FIELD1TYPE int 5815 #define SORTTPL_FIELD2TYPE int 5820 #define SORTTPL_NAMEEXT IntIntLong 5821 #define SORTTPL_KEYTYPE int 5822 #define SORTTPL_FIELD1TYPE int 5823 #define SORTTPL_FIELD2TYPE SCIP_Longint 5827 #define SORTTPL_NAMEEXT IntRealLong 5828 #define SORTTPL_KEYTYPE int 5829 #define SORTTPL_FIELD1TYPE SCIP_Real 5830 #define SORTTPL_FIELD2TYPE SCIP_Longint 5835 #define SORTTPL_NAMEEXT IntIntPtr 5836 #define SORTTPL_KEYTYPE int 5837 #define SORTTPL_FIELD1TYPE int 5838 #define SORTTPL_FIELD2TYPE void* 5843 #define SORTTPL_NAMEEXT IntIntReal 5844 #define SORTTPL_KEYTYPE int 5845 #define SORTTPL_FIELD1TYPE int 5846 #define SORTTPL_FIELD2TYPE SCIP_Real 5851 #define SORTTPL_NAMEEXT IntPtrReal 5852 #define SORTTPL_KEYTYPE int 5853 #define SORTTPL_FIELD1TYPE void* 5854 #define SORTTPL_FIELD2TYPE SCIP_Real 5859 #define SORTTPL_NAMEEXT IntIntIntPtr 5860 #define SORTTPL_KEYTYPE int 5861 #define SORTTPL_FIELD1TYPE int 5862 #define SORTTPL_FIELD2TYPE int 5863 #define SORTTPL_FIELD3TYPE void* 5867 #define SORTTPL_NAMEEXT IntIntIntReal 5868 #define SORTTPL_KEYTYPE int 5869 #define SORTTPL_FIELD1TYPE int 5870 #define SORTTPL_FIELD2TYPE int 5871 #define SORTTPL_FIELD3TYPE SCIP_Real 5875 #define SORTTPL_NAMEEXT IntPtrIntReal 5876 #define SORTTPL_KEYTYPE int 5877 #define SORTTPL_FIELD1TYPE void* 5878 #define SORTTPL_FIELD2TYPE int 5879 #define SORTTPL_FIELD3TYPE SCIP_Real 5884 #define SORTTPL_NAMEEXT Long 5885 #define SORTTPL_KEYTYPE SCIP_Longint 5890 #define SORTTPL_NAMEEXT LongPtr 5891 #define SORTTPL_KEYTYPE SCIP_Longint 5892 #define SORTTPL_FIELD1TYPE void* 5897 #define SORTTPL_NAMEEXT LongPtrInt 5898 #define SORTTPL_KEYTYPE SCIP_Longint 5899 #define SORTTPL_FIELD1TYPE void* 5900 #define SORTTPL_FIELD2TYPE int 5905 #define SORTTPL_NAMEEXT LongPtrRealBool 5906 #define SORTTPL_KEYTYPE SCIP_Longint 5907 #define SORTTPL_FIELD1TYPE void* 5908 #define SORTTPL_FIELD2TYPE SCIP_Real 5909 #define SORTTPL_FIELD3TYPE SCIP_Bool 5914 #define SORTTPL_NAMEEXT LongPtrRealRealBool 5915 #define SORTTPL_KEYTYPE SCIP_Longint 5916 #define SORTTPL_FIELD1TYPE void* 5917 #define SORTTPL_FIELD2TYPE SCIP_Real 5918 #define SORTTPL_FIELD3TYPE SCIP_Real 5919 #define SORTTPL_FIELD4TYPE SCIP_Bool 5924 #define SORTTPL_NAMEEXT LongPtrRealRealIntBool 5925 #define SORTTPL_KEYTYPE SCIP_Longint 5926 #define SORTTPL_FIELD1TYPE void* 5927 #define SORTTPL_FIELD2TYPE SCIP_Real 5928 #define SORTTPL_FIELD3TYPE SCIP_Real 5929 #define SORTTPL_FIELD4TYPE int 5930 #define SORTTPL_FIELD5TYPE SCIP_Bool 5935 #define SORTTPL_NAMEEXT LongPtrPtrInt 5936 #define SORTTPL_KEYTYPE SCIP_Longint 5937 #define SORTTPL_FIELD1TYPE void* 5938 #define SORTTPL_FIELD2TYPE void* 5939 #define SORTTPL_FIELD3TYPE int 5944 #define SORTTPL_NAMEEXT LongPtrPtrIntInt 5945 #define SORTTPL_KEYTYPE SCIP_Longint 5946 #define SORTTPL_FIELD1TYPE void* 5947 #define SORTTPL_FIELD2TYPE void* 5948 #define SORTTPL_FIELD3TYPE int 5949 #define SORTTPL_FIELD4TYPE int 5954 #define SORTTPL_NAMEEXT LongPtrPtrBoolInt 5955 #define SORTTPL_KEYTYPE SCIP_Longint 5956 #define SORTTPL_FIELD1TYPE void* 5957 #define SORTTPL_FIELD2TYPE void* 5958 #define SORTTPL_FIELD3TYPE SCIP_Bool 5959 #define SORTTPL_FIELD4TYPE int 5964 #define SORTTPL_NAMEEXT PtrIntIntBoolBool 5965 #define SORTTPL_KEYTYPE void* 5966 #define SORTTPL_FIELD1TYPE int 5967 #define SORTTPL_FIELD2TYPE int 5968 #define SORTTPL_FIELD3TYPE SCIP_Bool 5969 #define SORTTPL_FIELD4TYPE SCIP_Bool 5970 #define SORTTPL_PTRCOMP 5975 #define SORTTPL_NAMEEXT IntPtrIntIntBoolBool 5976 #define SORTTPL_KEYTYPE int 5977 #define SORTTPL_FIELD1TYPE void* 5978 #define SORTTPL_FIELD2TYPE int 5979 #define SORTTPL_FIELD3TYPE int 5980 #define SORTTPL_FIELD4TYPE SCIP_Bool 5981 #define SORTTPL_FIELD5TYPE SCIP_Bool 5998 assert(indcomp !=
NULL);
5999 assert(len == 0 || perm !=
NULL);
6002 for( pos = 0; pos < len; ++pos )
6010 #define SORTTPL_NAMEEXT DownInd 6011 #define SORTTPL_KEYTYPE int 6012 #define SORTTPL_INDCOMP 6013 #define SORTTPL_BACKWARDS 6018 #define SORTTPL_NAMEEXT DownPtr 6019 #define SORTTPL_KEYTYPE void* 6020 #define SORTTPL_PTRCOMP 6021 #define SORTTPL_BACKWARDS 6026 #define SORTTPL_NAMEEXT DownPtrPtr 6027 #define SORTTPL_KEYTYPE void* 6028 #define SORTTPL_FIELD1TYPE void* 6029 #define SORTTPL_PTRCOMP 6030 #define SORTTPL_BACKWARDS 6035 #define SORTTPL_NAMEEXT DownPtrReal 6036 #define SORTTPL_KEYTYPE void* 6037 #define SORTTPL_FIELD1TYPE SCIP_Real 6038 #define SORTTPL_PTRCOMP 6039 #define SORTTPL_BACKWARDS 6044 #define SORTTPL_NAMEEXT DownPtrInt 6045 #define SORTTPL_KEYTYPE void* 6046 #define SORTTPL_FIELD1TYPE int 6047 #define SORTTPL_PTRCOMP 6048 #define SORTTPL_BACKWARDS 6052 #define SORTTPL_NAMEEXT DownPtrBool 6053 #define SORTTPL_KEYTYPE void* 6054 #define SORTTPL_FIELD1TYPE SCIP_Bool 6055 #define SORTTPL_PTRCOMP 6056 #define SORTTPL_BACKWARDS 6060 #define SORTTPL_NAMEEXT DownPtrIntInt 6061 #define SORTTPL_KEYTYPE void* 6062 #define SORTTPL_FIELD1TYPE int 6063 #define SORTTPL_FIELD2TYPE int 6064 #define SORTTPL_PTRCOMP 6065 #define SORTTPL_BACKWARDS 6070 #define SORTTPL_NAMEEXT DownPtrRealInt 6071 #define SORTTPL_KEYTYPE void* 6072 #define SORTTPL_FIELD1TYPE SCIP_Real 6073 #define SORTTPL_FIELD2TYPE int 6074 #define SORTTPL_PTRCOMP 6075 #define SORTTPL_BACKWARDS 6080 #define SORTTPL_NAMEEXT DownPtrRealBool 6081 #define SORTTPL_KEYTYPE void* 6082 #define SORTTPL_FIELD1TYPE SCIP_Real 6083 #define SORTTPL_FIELD2TYPE SCIP_Bool 6084 #define SORTTPL_PTRCOMP 6085 #define SORTTPL_BACKWARDS 6090 #define SORTTPL_NAMEEXT DownPtrPtrInt 6091 #define SORTTPL_KEYTYPE void* 6092 #define SORTTPL_FIELD1TYPE void* 6093 #define SORTTPL_FIELD2TYPE int 6094 #define SORTTPL_PTRCOMP 6095 #define SORTTPL_BACKWARDS 6100 #define SORTTPL_NAMEEXT DownPtrPtrReal 6101 #define SORTTPL_KEYTYPE void* 6102 #define SORTTPL_FIELD1TYPE void* 6103 #define SORTTPL_FIELD2TYPE SCIP_Real 6104 #define SORTTPL_PTRCOMP 6105 #define SORTTPL_BACKWARDS 6110 #define SORTTPL_NAMEEXT DownPtrRealIntInt 6111 #define SORTTPL_KEYTYPE void* 6112 #define SORTTPL_FIELD1TYPE SCIP_Real 6113 #define SORTTPL_FIELD2TYPE int 6114 #define SORTTPL_FIELD3TYPE int 6115 #define SORTTPL_PTRCOMP 6116 #define SORTTPL_BACKWARDS 6121 #define SORTTPL_NAMEEXT DownPtrPtrIntInt 6122 #define SORTTPL_KEYTYPE void* 6123 #define SORTTPL_FIELD1TYPE void* 6124 #define SORTTPL_FIELD2TYPE int 6125 #define SORTTPL_FIELD3TYPE int 6126 #define SORTTPL_PTRCOMP 6127 #define SORTTPL_BACKWARDS 6132 #define SORTTPL_NAMEEXT DownPtrPtrRealInt 6133 #define SORTTPL_KEYTYPE void* 6134 #define SORTTPL_FIELD1TYPE void* 6135 #define SORTTPL_FIELD2TYPE SCIP_Real 6136 #define SORTTPL_FIELD3TYPE int 6137 #define SORTTPL_PTRCOMP 6138 #define SORTTPL_BACKWARDS 6143 #define SORTTPL_NAMEEXT DownPtrPtrRealBool 6144 #define SORTTPL_KEYTYPE void* 6145 #define SORTTPL_FIELD1TYPE void* 6146 #define SORTTPL_FIELD2TYPE SCIP_Real 6147 #define SORTTPL_FIELD3TYPE SCIP_Bool 6148 #define SORTTPL_PTRCOMP 6149 #define SORTTPL_BACKWARDS 6154 #define SORTTPL_NAMEEXT DownPtrPtrLongInt 6155 #define SORTTPL_KEYTYPE void* 6156 #define SORTTPL_FIELD1TYPE void* 6157 #define SORTTPL_FIELD2TYPE SCIP_Longint 6158 #define SORTTPL_FIELD3TYPE int 6159 #define SORTTPL_PTRCOMP 6160 #define SORTTPL_BACKWARDS 6165 #define SORTTPL_NAMEEXT DownPtrPtrLongIntInt 6166 #define SORTTPL_KEYTYPE void* 6167 #define SORTTPL_FIELD1TYPE void* 6168 #define SORTTPL_FIELD2TYPE SCIP_Longint 6169 #define SORTTPL_FIELD3TYPE int 6170 #define SORTTPL_FIELD4TYPE int 6171 #define SORTTPL_PTRCOMP 6172 #define SORTTPL_BACKWARDS 6177 #define SORTTPL_NAMEEXT DownReal 6178 #define SORTTPL_KEYTYPE SCIP_Real 6179 #define SORTTPL_BACKWARDS 6184 #define SORTTPL_NAMEEXT DownRealBoolPtr 6185 #define SORTTPL_KEYTYPE SCIP_Real 6186 #define SORTTPL_FIELD1TYPE SCIP_Bool 6187 #define SORTTPL_FIELD2TYPE void* 6188 #define SORTTPL_BACKWARDS 6193 #define SORTTPL_NAMEEXT DownRealPtr 6194 #define SORTTPL_KEYTYPE SCIP_Real 6195 #define SORTTPL_FIELD1TYPE void* 6196 #define SORTTPL_BACKWARDS