38 #define _USE_MATH_DEFINES 78 1.000, 2.414, 3.078, 6.314, 12.706,
79 0.816, 1.604, 1.886, 2.920, 4.303,
80 0.765, 1.423, 1.638, 2.353, 3.182,
81 0.741, 1.344, 1.533, 2.132, 2.776,
82 0.727, 1.301, 1.476, 2.015, 2.571,
83 0.718, 1.273, 1.440, 1.943, 2.447,
84 0.711, 1.254, 1.415, 1.895, 2.365,
85 0.706, 1.240, 1.397, 1.860, 2.306,
86 0.703, 1.230, 1.383, 1.833, 2.262,
87 0.700, 1.221, 1.372, 1.812, 2.228,
88 0.697, 1.214, 1.363, 1.796, 2.201,
89 0.695, 1.209, 1.356, 1.782, 2.179,
90 0.694, 1.204, 1.350, 1.771, 2.160,
91 0.692, 1.200, 1.345, 1.761, 2.145,
92 0.691, 1.197, 1.341, 1.753, 2.131
99 0.674, 1.150, 1.282, 1.645, 1.960
136 if( countx < 1.9 || county < 1.9 )
140 pooledvariance = (countx - 1) * variancex + (county - 1) * variancey;
141 pooledvariance /= (countx + county - 2);
144 pooledvariance =
MAX(pooledvariance, 1e-9);
149 tresult = (meanx - meany) / sqrt(pooledvariance);
150 tresult *= sqrt(countx * county / (countx + county));
160 #if defined(_WIN32) || defined(_WIN64) 171 sign = (x >= 0) ? 1 : -1;
175 y = 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);
206 assert(variance >= -1e-9);
207 if( variance < 1e-9 )
210 std = sqrt(variance);
215 if( value < mean + 1e-9 )
220 assert( std != 0.0 );
223 normvalue = (value - mean)/(std *
M_SQRT2);
225 SCIPdebugMessage(
" Normalized value %g = ( %g - %g ) / (%g * 1.4142136)\n", normvalue, value, mean, std);
230 if( normvalue < 1e-9 && normvalue > -1e-9 )
232 else if( normvalue > 0 )
236 erfresult =
SCIPerf(normvalue);
237 return erfresult / 2.0 + 0.5;
243 erfresult =
SCIPerf(-normvalue);
245 return 0.5 - erfresult / 2.0;
258 assert(regression !=
NULL);
268 assert(regression !=
NULL);
270 return regression->
slope;
278 assert(regression !=
NULL);
299 regression->
slope = 0.0;
333 assert(meanptr !=
NULL);
334 assert(sumvarptr !=
NULL);
335 assert(nobservations > 0 || add);
337 addfactor = add ? 1.0 : -1.0;
340 *meanptr = oldmean + addfactor * (value - oldmean)/(
SCIP_Real)nobservations;
341 *sumvarptr += addfactor * (value - oldmean) * (value - (*meanptr));
344 assert(*sumvarptr >= -1e-4);
345 *sumvarptr =
MAX(0.0, *sumvarptr);
355 assert(regression !=
NULL);
373 regression->
sumxy -= (x *
y);
388 assert(regression !=
NULL);
394 regression->
sumxy += x *
y;
407 regression->
meanx = 0;
409 regression->
sumxy = 0;
410 regression->
meany = 0;
420 assert(regression !=
NULL);
449 assert(initsize >= 0);
450 assert(growfac >= 1.0);
454 size =
MAX(initsize, num);
460 initsize =
MAX(initsize, 4);
465 while( size < num && size > oldsize )
468 size = (int)(growfac * size + initsize);
472 if( size <= oldsize )
476 assert(size >= initsize);
487 #define GMLNODEWIDTH 120.0 488 #define GMLNODEHEIGTH 30.0 489 #define GMLFONTSIZE 13 490 #define GMLNODETYPE "rectangle" 491 #define GMLNODEFILLCOLOR "#ff0000" 492 #define GMLEDGECOLOR "black" 493 #define GMLNODEBORDERCOLOR "#000000" 501 const char* nodetype,
502 const char* fillcolor,
503 const char* bordercolor
506 assert(file !=
NULL);
507 assert(label !=
NULL);
509 fprintf(file,
" node\n");
510 fprintf(file,
" [\n");
511 fprintf(file,
" id %u\n",
id);
512 fprintf(file,
" label \"%s\"\n", label);
513 fprintf(file,
" graphics\n");
514 fprintf(file,
" [\n");
518 if( nodetype !=
NULL )
519 fprintf(file,
" type \"%s\"\n", nodetype);
523 if( fillcolor !=
NULL )
524 fprintf(file,
" fill \"%s\"\n", fillcolor);
528 if( bordercolor !=
NULL )
529 fprintf(file,
" outline \"%s\"\n", bordercolor);
533 fprintf(file,
" ]\n");
534 fprintf(file,
" LabelGraphics\n");
535 fprintf(file,
" [\n");
536 fprintf(file,
" text \"%s\"\n", label);
538 fprintf(file,
" fontName \"Dialog\"\n");
539 fprintf(file,
" anchor \"c\"\n");
540 fprintf(file,
" ]\n");
541 fprintf(file,
" ]\n");
549 const char* nodetype,
550 const char* fillcolor,
551 const char* bordercolor,
555 assert(file !=
NULL);
556 assert(label !=
NULL);
558 fprintf(file,
" node\n");
559 fprintf(file,
" [\n");
560 fprintf(file,
" id %u\n",
id);
561 fprintf(file,
" label \"%s\"\n", label);
562 fprintf(file,
" weight %g\n", weight);
563 fprintf(file,
" graphics\n");
564 fprintf(file,
" [\n");
568 if( nodetype !=
NULL )
569 fprintf(file,
" type \"%s\"\n", nodetype);
573 if( fillcolor !=
NULL )
574 fprintf(file,
" fill \"%s\"\n", fillcolor);
578 if( bordercolor !=
NULL )
579 fprintf(file,
" outline \"%s\"\n", bordercolor);
583 fprintf(file,
" ]\n");
584 fprintf(file,
" LabelGraphics\n");
585 fprintf(file,
" [\n");
586 fprintf(file,
" text \"%s\"\n", label);
588 fprintf(file,
" fontName \"Dialog\"\n");
589 fprintf(file,
" anchor \"c\"\n");
590 fprintf(file,
" ]\n");
591 fprintf(file,
" ]\n");
603 assert(file !=
NULL);
605 fprintf(file,
" edge\n");
606 fprintf(file,
" [\n");
607 fprintf(file,
" source %u\n", source);
608 fprintf(file,
" target %u\n", target);
611 fprintf(file,
" label \"%s\"\n", label);
613 fprintf(file,
" graphics\n");
614 fprintf(file,
" [\n");
617 fprintf(file,
" fill \"%s\"\n", color);
622 fprintf(file,
" ]\n");
626 fprintf(file,
" LabelGraphics\n");
627 fprintf(file,
" [\n");
628 fprintf(file,
" text \"%s\"\n", label);
630 fprintf(file,
" fontName \"Dialog\"\n");
631 fprintf(file,
" anchor \"c\"\n");
632 fprintf(file,
" ]\n");
635 fprintf(file,
" ]\n");
647 assert(file !=
NULL);
649 fprintf(file,
" edge\n");
650 fprintf(file,
" [\n");
651 fprintf(file,
" source %u\n", source);
652 fprintf(file,
" target %u\n", target);
655 fprintf(file,
" label \"%s\"\n", label);
657 fprintf(file,
" graphics\n");
658 fprintf(file,
" [\n");
661 fprintf(file,
" fill \"%s\"\n", color);
665 fprintf(file,
" targetArrow \"standard\"\n");
666 fprintf(file,
" ]\n");
670 fprintf(file,
" LabelGraphics\n");
671 fprintf(file,
" [\n");
672 fprintf(file,
" text \"%s\"\n", label);
674 fprintf(file,
" fontName \"Dialog\"\n");
675 fprintf(file,
" anchor \"c\"\n");
676 fprintf(file,
" ]\n");
679 fprintf(file,
" ]\n");
688 assert(file !=
NULL);
690 fprintf(file,
"graph\n");
691 fprintf(file,
"[\n");
692 fprintf(file,
" hierarchic 1\n");
695 fprintf(file,
" directed 1\n");
703 assert(file !=
NULL);
705 fprintf(file,
"]\n");
715 assert(file !=
NULL);
717 fprintf(file,
"digraph G {\n");
725 const char* nodetype,
726 const char* fillcolor,
727 const char* bordercolor
730 assert(file !=
NULL);
732 fprintf(file,
"\t%d [shape=\"%s\", label=\"%s\", style=\"filled\", fillcolor=\"%s\", color=\"%s\"];\n", node, nodetype, label, fillcolor, bordercolor);
743 assert(file !=
NULL);
745 fprintf(file,
"\t%d -> %d [color=\"%s\"];\n", source, target, color);
753 assert(file !=
NULL);
755 fprintf(file,
"}\n");
776 assert(sparsesol !=
NULL);
777 assert(vars !=
NULL);
786 for( v = nvars - 1; v >= 0; --v )
788 assert(vars[v] !=
NULL);
809 (*sparsesol)->nvars = nvars;
819 assert(sparsesol !=
NULL);
820 assert(*sparsesol !=
NULL);
833 assert(sparsesol !=
NULL);
835 return sparsesol->
vars;
843 assert(sparsesol !=
NULL);
845 return sparsesol->
nvars;
853 assert(sparsesol !=
NULL);
863 assert(sparsesol !=
NULL);
878 assert(sparsesol !=
NULL);
883 assert(lbvalues !=
NULL);
886 for( v = 0; v < nvars; ++v )
887 sol[v] = lbvalues[v];
906 assert(sparsesol !=
NULL);
917 assert(lbvalues !=
NULL);
918 assert(ubvalues !=
NULL);
923 for( v = 0; v < nvars; ++v )
925 lbvalue = lbvalues[v];
926 ubvalue = ubvalues[v];
928 if( lbvalue < ubvalue )
932 if( carryflag ==
FALSE )
934 if( sol[v] < ubvalue )
942 assert(sol[v] == ubvalue);
949 if( sol[v] < ubvalue )
957 assert(sol[v] == ubvalue);
964 return (!carryflag && !singular);
979 assert(queue !=
NULL);
982 if( minsize <= queue->size )
999 assert(queue !=
NULL);
1001 initsize =
MAX(1, initsize);
1002 sizefac =
MAX(1.0, sizefac);
1005 (*queue)->firstfree = 0;
1006 (*queue)->firstused = -1;
1008 (*queue)->sizefac = sizefac;
1009 (*queue)->slots =
NULL;
1021 assert(queue !=
NULL);
1032 assert(queue !=
NULL);
1047 int oldsize = queue->
size;
1050 assert(oldsize < queue->size);
1052 sizediff = queue->
size - oldsize;
1084 assert(queue !=
NULL);
1089 assert(elem !=
NULL);
1110 assert(queue !=
NULL);
1136 assert(queue !=
NULL);
1170 assert(queue !=
NULL);
1202 assert(queue !=
NULL);
1220 assert(queue !=
NULL);
1238 assert(queue !=
NULL);
1251 assert(queue !=
NULL);
1271 #define PQ_PARENT(q) (((q)+1)/2-1) 1272 #define PQ_LEFTCHILD(p) (2*(p)+1) 1273 #define PQ_RIGHTCHILD(p) (2*(p)+2) 1283 assert(pqueue !=
NULL);
1285 if( minsize <= pqueue->size )
1303 assert(pqueue !=
NULL);
1304 assert(ptrcomp !=
NULL);
1306 initsize =
MAX(1, initsize);
1307 sizefac =
MAX(1.0, sizefac);
1311 (*pqueue)->size = 0;
1312 (*pqueue)->sizefac = sizefac;
1313 (*pqueue)->slots =
NULL;
1314 (*pqueue)->ptrcomp = ptrcomp;
1315 (*pqueue)->elemchgpos = elemchgpos;
1326 assert(pqueue !=
NULL);
1337 assert(pqueue !=
NULL);
1351 pqueue->
slots[newpos] = elem;
1354 if( pqueue->elemchgpos !=
NULL )
1356 pqueue->elemchgpos(elem, oldpos, newpos);
1360 #ifdef SCIP_MORE_DEBUG 1383 if( pqueue->ptrcomp(pqueue->
slots[i], pqueue->
slots[leftchild]) > 0 )
1402 assert(pqueue !=
NULL);
1403 assert(pqueue->
len >= 0);
1404 assert(elem !=
NULL);
1412 while( pos > 0 && (*pqueue->ptrcomp)(elem, pqueue->
slots[parentpos]) < 0 )
1414 assert((*pqueue->ptrcomp)(pqueue->
slots[parentpos], elem) >= 0);
1424 #ifdef SCIP_MORE_DEBUG 1425 assert(pqueueHasHeapProperty(pqueue));
1440 assert(pqueue !=
NULL);
1450 if( pos == pqueue->
len )
1458 while( pos > 0 && (*pqueue->ptrcomp)(last, pqueue->
slots[
PQ_PARENT(pos)]) < 0 )
1470 if( brotherpos < pqueue->len && (*pqueue->ptrcomp)(pqueue->
slots[brotherpos], pqueue->
slots[childpos]) < 0 )
1471 childpos = brotherpos;
1473 if( (*pqueue->ptrcomp)(last, pqueue->
slots[childpos]) <= 0 )
1483 assert(pos <= pqueue->len - 1);
1487 #ifdef SCIP_MORE_DEBUG 1488 assert(pqueueHasHeapProperty(pqueue));
1499 assert(pqueue !=
NULL);
1500 assert(pqueue->
len >= 0);
1502 if( pqueue->
len == 0 )
1505 root = pqueue->
slots[0];
1517 assert(pqueue !=
NULL);
1518 assert(pqueue->
len >= 0);
1520 if( pqueue->
len == 0 )
1523 return pqueue->
slots[0];
1531 assert(pqueue !=
NULL);
1532 assert(pqueue->
len >= 0);
1542 assert(pqueue !=
NULL);
1543 assert(pqueue->
len >= 0);
1545 return pqueue->
slots;
1558 if( pqueue->
slots[pos] == elem )
1633 return ( (uint32_t) ((UINT64_C(0x9e3779b97f4a7c15) * input)>>32) ) | 1u;
1644 assert(0 <= pos && pos < primetablesize);
1646 return primetable[pos];
1659 assert(multihashlist !=
NULL);
1660 assert(blkmem !=
NULL);
1661 assert(element !=
NULL);
1665 newlist->
next = *multihashlist;
1666 *multihashlist = newlist;
1681 assert(multihashlist !=
NULL);
1682 assert(blkmem !=
NULL);
1684 list = *multihashlist;
1685 while( list !=
NULL )
1687 nextlist = list->
next;
1692 *multihashlist =
NULL;
1707 uint64_t currentkeyval;
1710 assert(hashkeyeq !=
NULL);
1711 assert(key !=
NULL);
1713 while( multihashlist !=
NULL )
1715 currentkey = hashgetkey(userptr, multihashlist->
element);
1716 currentkeyval = hashkeyval(userptr, currentkey);
1717 if( currentkeyval == keyval && hashkeyeq(userptr, currentkey, key) )
1718 return multihashlist;
1720 multihashlist = multihashlist->
next;
1741 h =
multihashlistFind(multihashlist, hashgetkey, hashkeyeq, hashkeyval, userptr, keyval, key);
1756 key1 = hashgetkey(userptr, h->
element);
1757 key2 = hashgetkey(userptr, h2->
element);
1758 assert(hashkeyval(userptr, key1) == hashkeyval(userptr, key2));
1760 if( hashkeyeq(userptr, key1, key2) )
1762 SCIPerrorMessage(
"WARNING: hashkey with same value exists multiple times (e.g. duplicate constraint/variable names), so the return value is maybe not correct\n");
1791 assert(multihashlist !=
NULL);
1794 h =
multihashlistFind(*multihashlist, hashgetkey, hashkeyeq, hashkeyval, userptr, keyval, key);
1799 *multihashlist = h->
next;
1804 *multihashlist =
NULL;
1819 assert(multihashlist !=
NULL);
1820 assert(blkmem !=
NULL);
1821 assert(element !=
NULL);
1823 while( *multihashlist !=
NULL && (*multihashlist)->element != element )
1824 multihashlist = &(*multihashlist)->
next;
1826 if( *multihashlist !=
NULL )
1828 nextlist = (*multihashlist)->
next;
1830 *multihashlist = nextlist;
1838 #define SCIP_MULTIHASH_MAXSIZE 33554431 1839 #define SCIP_MULTIHASH_RESIZE_PERCENTAGE 65 1840 #define SCIP_MULTIHASH_GROW_FACTOR 1.31 1854 assert(multihash !=
NULL);
1856 assert(multihash->
nlists > 0);
1857 assert(multihash->hashgetkey !=
NULL);
1858 assert(multihash->hashkeyeq !=
NULL);
1859 assert(multihash->hashkeyval !=
NULL);
1863 nnewlists =
MAX(nnewlists, multihash->
nlists);
1867 if( nnewlists > multihash->
nlists )
1872 unsigned int hashval;
1877 for( l = multihash->
nlists - 1; l >= 0; --l )
1879 multihashlist = multihash->
lists[l];
1883 while( multihashlist !=
NULL )
1886 key = multihash->hashgetkey(multihash->
userptr, multihashlist->
element);
1887 keyval = multihash->hashkeyval(multihash->
userptr, key);
1888 hashval = (
unsigned int) (keyval % (
unsigned) nnewlists);
1893 if( multihashlist->
next ==
NULL && onlyone )
1896 if( newlists[hashval] ==
NULL )
1897 newlists[hashval] = multihashlist;
1904 while( next !=
NULL )
1910 lastnext->
next = multihashlist;
1922 multihashlist = multihashlist->
next;
1934 multihash->
lists = newlists;
1935 multihash->
nlists = nnewlists;
1938 #ifdef SCIP_MORE_DEBUG 1942 for( l = 0; l < multihash->
nlists; ++l )
1944 multihashlist = multihash->
lists[l];
1945 while( multihashlist !=
NULL )
1948 multihashlist = multihashlist->
next;
1951 assert(sumslotsize == multihash->
nelements);
1973 assert(tablesize >= 0);
1974 assert(multihash !=
NULL);
1975 assert(hashgetkey !=
NULL);
1976 assert(hashkeyeq !=
NULL);
1977 assert(hashkeyval !=
NULL);
1981 (*multihash)->blkmem = blkmem;
1982 (*multihash)->nlists = tablesize;
1983 (*multihash)->hashgetkey = hashgetkey;
1984 (*multihash)->hashkeyeq = hashkeyeq;
1985 (*multihash)->hashkeyval = hashkeyval;
1986 (*multihash)->userptr = userptr;
1987 (*multihash)->nelements = 0;
2002 assert(multihash !=
NULL);
2003 assert(*multihash !=
NULL);
2005 table = (*multihash);
2007 lists = table->
lists;
2010 for( i = table->
nlists - 1; i >= 0; --i )
2031 unsigned int hashval;
2033 assert(multihash !=
NULL);
2035 assert(multihash->
nlists > 0);
2036 assert(multihash->hashgetkey !=
NULL);
2037 assert(multihash->hashkeyeq !=
NULL);
2038 assert(multihash->hashkeyval !=
NULL);
2039 assert(element !=
NULL);
2048 key = multihash->hashgetkey(multihash->
userptr, element);
2049 keyval = multihash->hashkeyval(multihash->
userptr, key);
2050 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2070 assert(multihash !=
NULL);
2071 assert(multihash->hashgetkey !=
NULL);
2090 unsigned int hashval;
2092 assert(multihash !=
NULL);
2094 assert(multihash->
nlists > 0);
2095 assert(multihash->hashgetkey !=
NULL);
2096 assert(multihash->hashkeyeq !=
NULL);
2097 assert(multihash->hashkeyval !=
NULL);
2098 assert(key !=
NULL);
2101 keyval = multihash->hashkeyval(multihash->
userptr, key);
2102 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2105 multihash->hashkeyval, multihash->
userptr, keyval, key);
2123 assert(multihash !=
NULL);
2125 assert(multihash->
nlists > 0);
2126 assert(multihash->hashgetkey !=
NULL);
2127 assert(multihash->hashkeyeq !=
NULL);
2128 assert(multihash->hashkeyval !=
NULL);
2129 assert(multihashlist !=
NULL);
2130 assert(key !=
NULL);
2132 keyval = multihash->hashkeyval(multihash->
userptr, key);
2134 if( *multihashlist ==
NULL )
2136 unsigned int hashval;
2139 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2141 *multihashlist = multihash->
lists[hashval];
2145 multihash->hashkeyval, multihash->
userptr, keyval, key);
2156 unsigned int hashval;
2158 assert(multihash !=
NULL);
2160 assert(multihash->
nlists > 0);
2161 assert(multihash->hashgetkey !=
NULL);
2162 assert(multihash->hashkeyeq !=
NULL);
2163 assert(multihash->hashkeyval !=
NULL);
2164 assert(element !=
NULL);
2167 key = multihash->hashgetkey(multihash->
userptr, element);
2168 keyval = multihash->hashkeyval(multihash->
userptr, key);
2169 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2172 multihash->hashkeyval, multihash->
userptr, keyval, key) !=
NULL);
2183 unsigned int hashval;
2185 assert(multihash !=
NULL);
2187 assert(multihash->
nlists > 0);
2188 assert(multihash->hashgetkey !=
NULL);
2189 assert(multihash->hashkeyeq !=
NULL);
2190 assert(multihash->hashkeyval !=
NULL);
2191 assert(element !=
NULL);
2194 key = multihash->hashgetkey(multihash->
userptr, element);
2195 keyval = multihash->hashkeyval(multihash->
userptr, key);
2196 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2218 assert(multihash !=
NULL);
2220 blkmem = multihash->
blkmem;
2221 lists = multihash->
lists;
2224 for( i = multihash->
nlists - 1; i >= 0; --i )
2235 assert(multihash !=
NULL);
2245 assert(multihash !=
NULL);
2263 assert(multihash !=
NULL);
2268 for( i = 0; i < multihash->
nlists; ++i )
2270 multihashlist = multihash->
lists[i];
2271 if( multihashlist !=
NULL )
2275 while( multihashlist !=
NULL )
2278 multihashlist = multihashlist->
next;
2280 maxslotsize =
MAX(maxslotsize, slotsize);
2281 sumslotsize += slotsize;
2284 assert(sumslotsize == multihash->
nelements);
2306 unsigned int nslots;
2311 assert(tablesize >= 0);
2312 assert(hashtable !=
NULL);
2313 assert(hashgetkey !=
NULL);
2314 assert(hashkeyeq !=
NULL);
2315 assert(hashkeyval !=
NULL);
2316 assert(blkmem !=
NULL);
2325 (*hashtable)->shift = 32;
2326 (*hashtable)->shift -= (
unsigned int)ceil(
LOG2(
MAX(32.0, tablesize / 0.9)));
2329 nslots = 1u << (32 - (*hashtable)->shift);
2332 (*hashtable)->mask = nslots - 1;
2335 (*hashtable)->blkmem = blkmem;
2336 (*hashtable)->hashgetkey = hashgetkey;
2337 (*hashtable)->hashkeyeq = hashkeyeq;
2338 (*hashtable)->hashkeyval = hashkeyval;
2339 (*hashtable)->userptr = userptr;
2340 (*hashtable)->nelements = 0;
2353 assert(hashtable !=
NULL);
2354 assert(*hashtable !=
NULL);
2356 nslots = (*hashtable)->
mask + 1;
2359 uint32_t maxprobelen = 0;
2360 uint64_t probelensum = 0;
2363 assert(table !=
NULL);
2365 for( i = 0; i < nslots; ++i )
2367 if( table->
hashes[i] != 0 )
2369 uint32_t probelen = ((i + table->
mask + 1 - (table->
hashes[i]>>(table->
shift))) & table->
mask) + 1;
2370 probelensum += probelen;
2371 maxprobelen =
MAX(probelen, maxprobelen);
2376 (
unsigned int)table->
nelements, (
unsigned int)table->
nelements, (
unsigned int)nslots,
2406 #define ELEM_DISTANCE(pos) (((pos) + hashtable->mask + 1 - (hashtable->hashes[(pos)]>>(hashtable->shift))) & hashtable->mask) 2418 uint32_t elemdistance;
2424 assert(hashtable !=
NULL);
2427 assert(hashtable->
mask > 0);
2428 assert(hashtable->hashgetkey !=
NULL);
2429 assert(hashtable->hashkeyeq !=
NULL);
2430 assert(hashtable->hashkeyval !=
NULL);
2431 assert(element !=
NULL);
2433 pos = hashval>>(hashtable->
shift);
2440 if( hashtable->
hashes[pos] == 0 )
2442 hashtable->
slots[pos] = element;
2443 hashtable->
hashes[pos] = hashval;
2448 if( hashtable->
hashes[pos] == hashval && hashtable->hashkeyeq(hashtable->
userptr,
2449 hashtable->hashgetkey(hashtable->
userptr, hashtable->
slots[pos]), key) )
2456 hashtable->
slots[pos] = element;
2457 hashtable->
hashes[pos] = hashval;
2468 if( distance < elemdistance )
2473 elemdistance = distance;
2476 hashval = hashtable->
hashes[pos];
2477 hashtable->
hashes[pos] = tmp;
2478 key = hashtable->hashgetkey(hashtable->
userptr, element);
2487 pos = (pos + 1) & hashtable->
mask;
2498 assert(hashtable !=
NULL);
2499 assert(hashtable->
shift < 32);
2502 if( ((((uint64_t)hashtable->
nelements)<<10)>>(32-hashtable->
shift) > 921) )
2511 nslots = hashtable->
mask + 1;
2512 newnslots = 2*nslots;
2513 hashtable->
mask = newnslots-1;
2525 for( i = 0; i < nslots; ++i )
2530 if( hashes[i] != 0 )
2556 assert(hashtable !=
NULL);
2559 assert(hashtable->
mask > 0);
2560 assert(hashtable->hashgetkey !=
NULL);
2561 assert(hashtable->hashkeyeq !=
NULL);
2562 assert(hashtable->hashkeyval !=
NULL);
2563 assert(element !=
NULL);
2568 key = hashtable->hashgetkey(hashtable->
userptr, element);
2569 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2588 assert(hashtable !=
NULL);
2591 assert(hashtable->
mask > 0);
2592 assert(hashtable->hashgetkey !=
NULL);
2593 assert(hashtable->hashkeyeq !=
NULL);
2594 assert(hashtable->hashkeyval !=
NULL);
2595 assert(element !=
NULL);
2600 key = hashtable->hashgetkey(hashtable->
userptr, element);
2601 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2616 uint32_t elemdistance;
2618 assert(hashtable !=
NULL);
2621 assert(hashtable->
mask > 0);
2622 assert(hashtable->hashgetkey !=
NULL);
2623 assert(hashtable->hashkeyeq !=
NULL);
2624 assert(hashtable->hashkeyval !=
NULL);
2625 assert(key !=
NULL);
2628 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2631 pos = hashval>>(hashtable->
shift);
2639 if( hashtable->
hashes[pos] == 0 )
2645 if( elemdistance > distance )
2649 if( hashtable->
hashes[pos] == hashval && hashtable->hashkeyeq(hashtable->
userptr,
2650 hashtable->hashgetkey(hashtable->
userptr, hashtable->
slots[pos]), key) )
2651 return hashtable->
slots[pos];
2653 pos = (pos + 1) & hashtable->
mask;
2664 assert(hashtable !=
NULL);
2667 assert(hashtable->
mask > 0);
2668 assert(hashtable->hashgetkey !=
NULL);
2669 assert(hashtable->hashkeyeq !=
NULL);
2670 assert(hashtable->hashkeyval !=
NULL);
2671 assert(element !=
NULL);
2685 uint32_t elemdistance;
2689 assert(hashtable !=
NULL);
2692 assert(hashtable->
mask > 0);
2693 assert(hashtable->hashgetkey !=
NULL);
2694 assert(hashtable->hashkeyeq !=
NULL);
2695 assert(hashtable->hashkeyval !=
NULL);
2696 assert(element !=
NULL);
2699 key = hashtable->hashgetkey(hashtable->
userptr, element);
2700 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2704 pos = hashval>>(hashtable->
shift);
2708 if( hashtable->
hashes[pos] == 0 )
2714 if( elemdistance > distance )
2717 if( hashtable->
hashes[pos] == hashval && hashtable->hashkeyeq(hashtable->
userptr,
2718 hashtable->hashgetkey(hashtable->
userptr, hashtable->
slots[pos]), key) )
2724 pos = (pos + 1) & hashtable->
mask;
2729 hashtable->
hashes[pos] = 0;
2733 uint32_t nextpos = (pos + 1) & hashtable->
mask;
2736 if( hashtable->
hashes[nextpos] == 0 )
2740 if( (hashtable->
hashes[nextpos]>>(hashtable->
shift)) == nextpos )
2744 hashtable->
slots[pos] = hashtable->
slots[nextpos];
2746 hashtable->
hashes[nextpos] = 0;
2759 assert(hashtable !=
NULL);
2771 assert(hashtable !=
NULL);
2781 return (
int) hashtable->
mask + 1;
2790 return hashtable->
hashes[entryidx] == 0 ?
NULL : hashtable->
slots[entryidx];
2798 assert(hashtable !=
NULL);
2809 uint32_t maxprobelen = 0;
2810 uint64_t probelensum = 0;
2814 assert(hashtable !=
NULL);
2816 nslots = hashtable->
mask + 1;
2819 for( i = 0; i < nslots; ++i )
2821 if( hashtable->
hashes[i] != 0 )
2824 probelensum += probelen;
2825 maxprobelen =
MAX(probelen, maxprobelen);
2844 const char* string1 = (
const char*)key1;
2845 const char* string2 = (
const char*)key2;
2847 return (strcmp(string1, string2) == 0);
2856 str = (
const char*)key;
2858 while( *str !=
'\0' )
2861 hash += (
unsigned int)(*str);
2879 return (key1 == key2);
2886 return (uint64_t) (uintptr_t) key;
2896 #undef ELEM_DISTANCE 2898 #define ELEM_DISTANCE(pos) (((pos) + hashmap->mask + 1 - (hashmap->hashes[(pos)]>>(hashmap->shift))) & hashmap->mask) 2910 uint32_t elemdistance;
2913 assert(hashmap !=
NULL);
2916 assert(hashmap->
mask > 0);
2917 assert(hashval != 0);
2919 pos = hashval>>(hashmap->
shift);
2926 if( hashmap->
hashes[pos] == 0 )
2930 hashmap->
hashes[pos] = hashval;
2941 hashmap->
hashes[pos] = hashval;
2952 if( distance < elemdistance )
2958 elemdistance = distance;
2960 hashval = hashmap->
hashes[pos];
2961 hashmap->
hashes[pos] = tmphash;
2969 pos = (pos + 1) & hashmap->
mask;
2985 uint32_t elemdistance;
2987 assert(hashmap !=
NULL);
2990 assert(hashmap->
mask > 0);
2994 assert(hashval != 0);
2996 *pos = hashval>>(hashmap->
shift);
3004 if( hashmap->
hashes[*pos] == 0 )
3009 if( elemdistance > distance )
3016 *pos = (*pos + 1) & hashmap->
mask;
3027 assert(hashmap !=
NULL);
3028 assert(hashmap->
shift < 32);
3031 if( ((((uint64_t)hashmap->
nelements)<<10)>>(32-hashmap->
shift) > 921) )
3040 nslots = hashmap->
mask + 1;
3042 newnslots = 2*nslots;
3043 hashmap->
mask = newnslots-1;
3054 for( i = 0; i < nslots; ++i )
3059 if( hashes[i] != 0 )
3082 assert(hashmap !=
NULL);
3083 assert(mapsize >= 0);
3084 assert(blkmem !=
NULL);
3093 (*hashmap)->shift = 32;
3094 (*hashmap)->shift -= (
unsigned int)ceil(log(
MAX(32, mapsize / 0.9)) / log(2.0));
3095 nslots = 1u << (32 - (*hashmap)->shift);
3096 (*hashmap)->mask = nslots - 1;
3097 (*hashmap)->blkmem = blkmem;
3098 (*hashmap)->nelements = 0;
3114 assert(hashmap !=
NULL);
3115 assert(*hashmap !=
NULL);
3117 nslots = (*hashmap)->mask + 1;
3120 uint32_t maxprobelen = 0;
3121 uint64_t probelensum = 0;
3124 assert(hashmap !=
NULL);
3126 for( i = 0; i < nslots; ++i )
3128 if( (*hashmap)->hashes[i] != 0 )
3130 uint32_t probelen = ((i + (*hashmap)->mask + 1 - ((*hashmap)->hashes[i]>>((*hashmap)->shift))) & (*hashmap)->mask) + 1;
3131 probelensum += probelen;
3132 maxprobelen =
MAX(probelen, maxprobelen);
3137 (
unsigned int)(*hashmap)->nelements, (
unsigned int)(*hashmap)->nelements, (
unsigned int)nslots,
3139 if( (*hashmap)->nelements > 0 )
3140 SCIPdebugPrintf(
", avg. probe length is %.1f, max. probe length is %u",
3141 (
SCIP_Real)(probelensum)/(
SCIP_Real)(*hashmap)->nelements, (
unsigned int)maxprobelen);
3165 assert(hashmap !=
NULL);
3168 assert(hashmap->
mask > 0);
3201 assert(hashmap !=
NULL);
3204 assert(hashmap->
mask > 0);
3237 assert(hashmap !=
NULL);
3240 assert(hashmap->
mask > 0);
3268 assert(hashmap !=
NULL);
3271 assert(hashmap->
mask > 0);
3288 assert(hashmap !=
NULL);
3291 assert(hashmap->
mask > 0);
3308 assert(hashmap !=
NULL);
3311 assert(hashmap->
mask > 0);
3332 assert(hashmap !=
NULL);
3334 assert(hashmap->
mask > 0);
3366 assert(hashmap !=
NULL);
3368 assert(hashmap->
mask > 0);
3400 assert(hashmap !=
NULL);
3402 assert(hashmap->
mask > 0);
3430 assert(hashmap !=
NULL);
3433 assert(hashmap->
mask > 0);
3446 assert(hashmap !=
NULL);
3448 assert(hashmap->
mask > 0);
3450 assert(origin !=
NULL);
3455 hashmap->
hashes[pos] = 0;
3461 uint32_t nextpos = (pos + 1) & hashmap->
mask;
3464 if( hashmap->
hashes[nextpos] == 0 )
3468 if( (hashmap->
hashes[nextpos]>>(hashmap->
shift)) == nextpos )
3475 hashmap->
hashes[nextpos] = 0;
3490 uint32_t maxprobelen = 0;
3491 uint64_t probelensum = 0;
3495 assert(hashmap !=
NULL);
3497 nslots = hashmap->
mask + 1;
3500 for( i = 0; i < nslots; ++i )
3502 if( hashmap->
hashes[i] != 0 )
3505 probelensum += probelen;
3506 maxprobelen =
MAX(probelen, maxprobelen);
3527 assert(hashmap !=
NULL);
3545 return (
int) hashmap->
mask + 1;
3554 assert(hashmap !=
NULL);
3556 return hashmap->
hashes[entryidx] == 0 ?
NULL : &hashmap->
slots[entryidx];
3564 assert(entry !=
NULL);
3574 assert(entry !=
NULL);
3584 assert(entry !=
NULL);
3594 assert(entry !=
NULL);
3605 assert(entry !=
NULL);
3616 assert(entry !=
NULL);
3627 assert(entry !=
NULL);
3637 assert(hashmap !=
NULL);
3652 #undef ELEM_DISTANCE 3654 #define ELEM_DISTANCE(pos) (((pos) + nslots - hashSetDesiredPos(hashset, hashset->slots[(pos)])) & mask) 3663 return (uint32_t)((UINT64_C(0x9e3779b97f4a7c15) * (uintptr_t)element)>>(hashset->
shift));
3672 uint32_t elemdistance;
3677 assert(hashset !=
NULL);
3679 assert(element !=
NULL);
3693 hashset->
slots[pos] = element;
3698 if( hashset->
slots[pos] == element )
3703 if( distance < elemdistance )
3706 elemdistance = distance;
3711 pos = (pos + 1) & mask;
3723 assert(hashset !=
NULL);
3724 assert(hashset->
shift < 64);
3727 if( ((((uint64_t)hashset->
nelements)<<10)>>(64-hashset->
shift) > 921) )
3736 newnslots = 2*nslots;
3746 for( i = 0; i < nslots; ++i )
3748 if( slots[i] !=
NULL )
3768 assert(hashset !=
NULL);
3770 assert(blkmem !=
NULL);
3779 (*hashset)->shift = 64;
3780 (*hashset)->shift -= (
unsigned int)ceil(log(
MAX(8.0, size / 0.9)) / log(2.0));
3782 (*hashset)->nelements = 0;
3806 assert(hashset !=
NULL);
3825 uint32_t elemdistance;
3827 assert(hashset !=
NULL);
3840 if( hashset->
slots[pos] == element )
3849 if( elemdistance > distance )
3852 pos = (pos + 1) & mask;
3866 uint32_t elemdistance;
3868 assert(hashset !=
NULL);
3870 assert(element !=
NULL);
3882 if( hashset->
slots[pos] == element )
3891 if( elemdistance > distance )
3894 pos = (pos + 1) & mask;
3898 assert(hashset->
slots[pos] == element);
3907 uint32_t nextpos = (pos + 1) & mask;
3926 hashset->
slots[pos] = hashset->
slots[nextpos];
3938 uint32_t maxprobelen = 0;
3939 uint64_t probelensum = 0;
3944 assert(hashset !=
NULL);
3950 for( i = 0; i < nslots; ++i )
3955 probelensum += probelen;
3956 maxprobelen =
MAX(probelen, maxprobelen);
3978 #undef SCIPhashsetIsEmpty 3979 #undef SCIPhashsetGetNElements 3980 #undef SCIPhashsetGetNSlots 3981 #undef SCIPhashsetGetSlots 4004 return (
int) (1u << (64 - hashset->
shift));
4012 return hashset->
slots;
4035 assert(realarray !=
NULL);
4036 assert(blkmem !=
NULL);
4039 (*realarray)->blkmem = blkmem;
4040 (*realarray)->vals =
NULL;
4041 (*realarray)->valssize = 0;
4042 (*realarray)->firstidx = -1;
4043 (*realarray)->minusedidx = INT_MAX;
4044 (*realarray)->maxusedidx = INT_MIN;
4056 assert(realarray !=
NULL);
4057 assert(sourcerealarray !=
NULL);
4060 if( sourcerealarray->
valssize > 0 )
4065 (*realarray)->valssize = sourcerealarray->
valssize;
4066 (*realarray)->firstidx = sourcerealarray->
firstidx;
4067 (*realarray)->minusedidx = sourcerealarray->
minusedidx;
4068 (*realarray)->maxusedidx = sourcerealarray->
maxusedidx;
4078 assert(realarray !=
NULL);
4079 assert(*realarray !=
NULL);
4101 assert(realarray !=
NULL);
4106 assert(0 <= minidx);
4107 assert(minidx <= maxidx);
4111 assert(0 <= minidx);
4112 assert(minidx <= maxidx);
4114 SCIPdebugMessage(
"extending realarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
4115 (
void*)realarray, realarray->
firstidx, realarray->valssize, realarray->minusedidx, realarray->maxusedidx, minidx, maxidx);
4118 nused = maxidx - minidx + 1;
4119 if( nused > realarray->valssize )
4125 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
4127 nfree = newvalssize - nused;
4128 newfirstidx = minidx - nfree/2;
4129 newfirstidx =
MAX(newfirstidx, 0);
4130 assert(newfirstidx <= minidx);
4131 assert(maxidx < newfirstidx + newvalssize);
4134 if( realarray->firstidx != -1 )
4136 for( i = 0; i < realarray->minusedidx - newfirstidx; ++i )
4140 assert(realarray->maxusedidx - realarray->minusedidx + 1 > 0);
4143 &(realarray->vals[realarray->minusedidx - realarray->firstidx]),
4144 realarray->maxusedidx - realarray->minusedidx + 1);
4145 for( i = realarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
4150 for( i = 0; i < newvalssize; ++i )
4156 realarray->vals = newvals;
4157 realarray->valssize = newvalssize;
4158 realarray->firstidx = newfirstidx;
4160 else if( realarray->firstidx == -1 )
4163 nfree = realarray->valssize - nused;
4165 realarray->firstidx = minidx - nfree/2;
4166 assert(realarray->firstidx <= minidx);
4167 assert(maxidx < realarray->firstidx + realarray->valssize);
4169 for( i = 0; i < realarray->valssize; ++i )
4170 assert(realarray->vals[i] == 0.0);
4173 else if( minidx < realarray->firstidx )
4176 nfree = realarray->valssize - nused;
4178 newfirstidx = minidx - nfree/2;
4179 newfirstidx =
MAX(newfirstidx, 0);
4180 assert(newfirstidx <= minidx);
4181 assert(maxidx < newfirstidx + realarray->valssize);
4183 if( realarray->minusedidx <= realarray->maxusedidx )
4187 assert(realarray->firstidx <= realarray->minusedidx);
4188 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4191 shift = realarray->firstidx - newfirstidx;
4193 for( i = realarray->maxusedidx - realarray->firstidx; i >= realarray->minusedidx - realarray->firstidx; --i )
4195 assert(0 <= i + shift && i + shift < realarray->valssize);
4196 realarray->vals[i + shift] = realarray->vals[i];
4199 for( i = 0; i < shift; ++i )
4200 realarray->vals[realarray->minusedidx - realarray->firstidx + i] = 0.0;
4202 realarray->firstidx = newfirstidx;
4204 else if( maxidx >= realarray->firstidx + realarray->valssize )
4207 nfree = realarray->valssize - nused;
4209 newfirstidx = minidx - nfree/2;
4210 newfirstidx =
MAX(newfirstidx, 0);
4211 assert(newfirstidx <= minidx);
4212 assert(maxidx < newfirstidx + realarray->valssize);
4214 if( realarray->minusedidx <= realarray->maxusedidx )
4218 assert(realarray->firstidx <= realarray->minusedidx);
4219 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4222 shift = newfirstidx - realarray->firstidx;
4224 for( i = realarray->minusedidx - realarray->firstidx; i <= realarray->maxusedidx - realarray->firstidx; ++i )
4226 assert(0 <= i - shift && i - shift < realarray->valssize);
4227 realarray->vals[i - shift] = realarray->vals[i];
4230 for( i = 0; i < shift; ++i )
4231 realarray->vals[realarray->maxusedidx - realarray->firstidx - i] = 0.0;
4233 realarray->firstidx = newfirstidx;
4236 assert(minidx >= realarray->firstidx);
4237 assert(maxidx < realarray->firstidx + realarray->valssize);
4247 assert(realarray !=
NULL);
4249 SCIPdebugMessage(
"clearing realarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
4250 (
void*)realarray, realarray->
firstidx, realarray->valssize, realarray->minusedidx, realarray->maxusedidx);
4252 if( realarray->minusedidx <= realarray->maxusedidx )
4254 assert(realarray->firstidx <= realarray->minusedidx);
4255 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4256 assert(realarray->firstidx != -1);
4257 assert(realarray->valssize > 0);
4261 realarray->maxusedidx - realarray->minusedidx + 1);
4264 realarray->minusedidx = INT_MAX;
4265 realarray->maxusedidx = INT_MIN;
4267 assert(realarray->minusedidx == INT_MAX);
4268 assert(realarray->maxusedidx == INT_MIN);
4279 assert(realarray !=
NULL);
4282 if( idx < realarray->minusedidx || idx > realarray->
maxusedidx )
4287 assert(idx - realarray->
firstidx >= 0);
4303 assert(realarray !=
NULL);
4306 SCIPdebugMessage(
"setting realarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %g\n",
4307 (
void*)realarray, realarray->
firstidx, realarray->valssize, realarray->minusedidx, realarray->maxusedidx, idx, val);
4313 assert(idx >= realarray->firstidx);
4314 assert(idx < realarray->firstidx + realarray->valssize);
4317 realarray->vals[idx - realarray->firstidx] = val;
4320 realarray->minusedidx =
MIN(realarray->minusedidx, idx);
4321 realarray->maxusedidx =
MAX(realarray->maxusedidx, idx);
4323 else if( idx >= realarray->firstidx && idx < realarray->firstidx + realarray->valssize )
4326 realarray->vals[idx - realarray->firstidx] = 0.0;
4329 if( idx == realarray->minusedidx )
4331 assert(realarray->maxusedidx >= 0);
4332 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4335 realarray->minusedidx++;
4337 while( realarray->minusedidx <= realarray->maxusedidx
4338 && realarray->vals[realarray->minusedidx - realarray->firstidx] == 0.0 );
4340 if( realarray->minusedidx > realarray->maxusedidx )
4342 realarray->minusedidx = INT_MAX;
4343 realarray->maxusedidx = INT_MIN;
4346 else if( idx == realarray->maxusedidx )
4348 assert(realarray->minusedidx >= 0);
4349 assert(realarray->minusedidx < realarray->maxusedidx);
4350 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4353 realarray->maxusedidx--;
4354 assert(realarray->minusedidx <= realarray->maxusedidx);
4356 while( realarray->vals[realarray->maxusedidx - realarray->firstidx] == 0.0 );
4386 assert(realarray !=
NULL);
4396 assert(realarray !=
NULL);
4407 assert(intarray !=
NULL);
4408 assert(blkmem !=
NULL);
4411 (*intarray)->blkmem = blkmem;
4412 (*intarray)->vals =
NULL;
4413 (*intarray)->valssize = 0;
4414 (*intarray)->firstidx = -1;
4415 (*intarray)->minusedidx = INT_MAX;
4416 (*intarray)->maxusedidx = INT_MIN;
4428 assert(intarray !=
NULL);
4429 assert(sourceintarray !=
NULL);
4436 (*intarray)->valssize = sourceintarray->
valssize;
4437 (*intarray)->firstidx = sourceintarray->
firstidx;
4438 (*intarray)->minusedidx = sourceintarray->
minusedidx;
4439 (*intarray)->maxusedidx = sourceintarray->
maxusedidx;
4449 assert(intarray !=
NULL);
4450 assert(*intarray !=
NULL);
4472 assert(intarray !=
NULL);
4477 assert(0 <= minidx);
4478 assert(minidx <= maxidx);
4482 assert(0 <= minidx);
4483 assert(minidx <= maxidx);
4485 SCIPdebugMessage(
"extending intarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
4486 (
void*)intarray, intarray->
firstidx, intarray->valssize, intarray->minusedidx, intarray->maxusedidx, minidx, maxidx);
4489 nused = maxidx - minidx + 1;
4490 if( nused > intarray->valssize )
4496 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
4498 nfree = newvalssize - nused;
4499 newfirstidx = minidx - nfree/2;
4500 newfirstidx =
MAX(newfirstidx, 0);
4501 assert(newfirstidx <= minidx);
4502 assert(maxidx < newfirstidx + newvalssize);
4505 if( intarray->firstidx != -1 )
4507 for( i = 0; i < intarray->minusedidx - newfirstidx; ++i )
4511 assert(intarray->maxusedidx - intarray->minusedidx + 1 > 0);
4514 &intarray->vals[intarray->minusedidx - intarray->firstidx],
4515 intarray->maxusedidx - intarray->minusedidx + 1);
4516 for( i = intarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
4521 for( i = 0; i < newvalssize; ++i )
4527 intarray->vals = newvals;
4528 intarray->valssize = newvalssize;
4529 intarray->firstidx = newfirstidx;
4531 else if( intarray->firstidx == -1 )
4534 nfree = intarray->valssize - nused;
4536 intarray->firstidx = minidx - nfree/2;
4537 assert(intarray->firstidx <= minidx);
4538 assert(maxidx < intarray->firstidx + intarray->valssize);
4540 for( i = 0; i < intarray->valssize; ++i )
4541 assert(intarray->vals[i] == 0);
4544 else if( minidx < intarray->firstidx )
4547 nfree = intarray->valssize - nused;
4549 newfirstidx = minidx - nfree/2;
4550 newfirstidx =
MAX(newfirstidx, 0);
4551 assert(newfirstidx <= minidx);
4552 assert(maxidx < newfirstidx + intarray->valssize);
4554 if( intarray->minusedidx <= intarray->maxusedidx )
4558 assert(intarray->firstidx <= intarray->minusedidx);
4559 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4562 shift = intarray->firstidx - newfirstidx;
4564 for( i = intarray->maxusedidx - intarray->firstidx; i >= intarray->minusedidx - intarray->firstidx; --i )
4566 assert(0 <= i + shift && i + shift < intarray->valssize);
4567 intarray->vals[i + shift] = intarray->vals[i];
4570 for( i = 0; i < shift; ++i )
4571 intarray->vals[intarray->minusedidx - intarray->firstidx + i] = 0;
4573 intarray->firstidx = newfirstidx;
4575 else if( maxidx >= intarray->firstidx + intarray->valssize )
4578 nfree = intarray->valssize - nused;
4580 newfirstidx = minidx - nfree/2;
4581 newfirstidx =
MAX(newfirstidx, 0);
4582 assert(newfirstidx <= minidx);
4583 assert(maxidx < newfirstidx + intarray->valssize);
4585 if( intarray->minusedidx <= intarray->maxusedidx )
4589 assert(intarray->firstidx <= intarray->minusedidx);
4590 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4593 shift = newfirstidx - intarray->firstidx;
4595 for( i = intarray->minusedidx - intarray->firstidx; i <= intarray->maxusedidx - intarray->firstidx; ++i )
4597 assert(0 <= i - shift && i - shift < intarray->valssize);
4598 intarray->vals[i - shift] = intarray->vals[i];
4601 for( i = 0; i < shift; ++i )
4602 intarray->vals[intarray->maxusedidx - intarray->firstidx - i] = 0;
4604 intarray->firstidx = newfirstidx;
4607 assert(minidx >= intarray->firstidx);
4608 assert(maxidx < intarray->firstidx + intarray->valssize);
4618 assert(intarray !=
NULL);
4620 SCIPdebugMessage(
"clearing intarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
4621 (
void*)intarray, intarray->
firstidx, intarray->valssize, intarray->minusedidx, intarray->maxusedidx);
4623 if( intarray->minusedidx <= intarray->maxusedidx )
4625 assert(intarray->firstidx <= intarray->minusedidx);
4626 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4627 assert(intarray->firstidx != -1);
4628 assert(intarray->valssize > 0);
4632 intarray->maxusedidx - intarray->minusedidx + 1);
4635 intarray->minusedidx = INT_MAX;
4636 intarray->maxusedidx = INT_MIN;
4638 assert(intarray->minusedidx == INT_MAX);
4639 assert(intarray->maxusedidx == INT_MIN);
4650 assert(intarray !=
NULL);
4653 if( idx < intarray->minusedidx || idx > intarray->
maxusedidx )
4658 assert(idx - intarray->
firstidx >= 0);
4674 assert(intarray !=
NULL);
4677 SCIPdebugMessage(
"setting intarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %d\n",
4678 (
void*)intarray, intarray->
firstidx, intarray->valssize, intarray->minusedidx, intarray->maxusedidx, idx, val);
4684 assert(idx >= intarray->firstidx);
4685 assert(idx < intarray->firstidx + intarray->valssize);
4688 intarray->vals[idx - intarray->firstidx] = val;
4691 intarray->minusedidx =
MIN(intarray->minusedidx, idx);
4692 intarray->maxusedidx =
MAX(intarray->maxusedidx, idx);
4694 else if( idx >= intarray->firstidx && idx < intarray->firstidx + intarray->valssize )
4697 intarray->vals[idx - intarray->firstidx] = 0;
4700 if( idx == intarray->minusedidx )
4702 assert(intarray->maxusedidx >= 0);
4703 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4706 intarray->minusedidx++;
4708 while( intarray->minusedidx <= intarray->maxusedidx
4709 && intarray->vals[intarray->minusedidx - intarray->firstidx] == 0 );
4710 if( intarray->minusedidx > intarray->maxusedidx )
4712 intarray->minusedidx = INT_MAX;
4713 intarray->maxusedidx = INT_MIN;
4716 else if( idx == intarray->maxusedidx )
4718 assert(intarray->minusedidx >= 0);
4719 assert(intarray->minusedidx < intarray->maxusedidx);
4720 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4723 intarray->maxusedidx--;
4724 assert(intarray->minusedidx <= intarray->maxusedidx);
4726 while( intarray->vals[intarray->maxusedidx - intarray->firstidx] == 0 );
4750 assert(intarray !=
NULL);
4760 assert(intarray !=
NULL);
4772 assert(boolarray !=
NULL);
4773 assert(blkmem !=
NULL);
4776 (*boolarray)->blkmem = blkmem;
4777 (*boolarray)->vals =
NULL;
4778 (*boolarray)->valssize = 0;
4779 (*boolarray)->firstidx = -1;
4780 (*boolarray)->minusedidx = INT_MAX;
4781 (*boolarray)->maxusedidx = INT_MIN;
4793 assert(boolarray !=
NULL);
4794 assert(sourceboolarray !=
NULL);
4797 if( sourceboolarray->
valssize > 0 )
4802 (*boolarray)->valssize = sourceboolarray->
valssize;
4803 (*boolarray)->firstidx = sourceboolarray->
firstidx;
4804 (*boolarray)->minusedidx = sourceboolarray->
minusedidx;
4805 (*boolarray)->maxusedidx = sourceboolarray->
maxusedidx;
4815 assert(boolarray !=
NULL);
4816 assert(*boolarray !=
NULL);
4838 assert(boolarray !=
NULL);
4843 assert(0 <= minidx);
4844 assert(minidx <= maxidx);
4848 assert(0 <= minidx);
4849 assert(minidx <= maxidx);
4851 SCIPdebugMessage(
"extending boolarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
4852 (
void*)boolarray, boolarray->
firstidx, boolarray->valssize, boolarray->minusedidx, boolarray->maxusedidx, minidx, maxidx);
4855 nused = maxidx - minidx + 1;
4856 if( nused > boolarray->valssize )
4862 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
4864 nfree = newvalssize - nused;
4865 newfirstidx = minidx - nfree/2;
4866 newfirstidx =
MAX(newfirstidx, 0);
4867 assert(newfirstidx <= minidx);
4868 assert(maxidx < newfirstidx + newvalssize);
4871 if( boolarray->firstidx != -1 )
4873 for( i = 0; i < boolarray->minusedidx - newfirstidx; ++i )
4877 assert(boolarray->maxusedidx - boolarray->minusedidx + 1 > 0);
4880 &boolarray->vals[boolarray->minusedidx - boolarray->firstidx],
4881 boolarray->maxusedidx - boolarray->minusedidx + 1);
4882 for( i = boolarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
4887 for( i = 0; i < newvalssize; ++i )
4893 boolarray->vals = newvals;
4894 boolarray->valssize = newvalssize;
4895 boolarray->firstidx = newfirstidx;
4897 else if( boolarray->firstidx == -1 )
4900 nfree = boolarray->valssize - nused;
4902 boolarray->firstidx = minidx - nfree/2;
4903 assert(boolarray->firstidx <= minidx);
4904 assert(maxidx < boolarray->firstidx + boolarray->valssize);
4906 for( i = 0; i < boolarray->valssize; ++i )
4907 assert(boolarray->vals[i] ==
FALSE);
4910 else if( minidx < boolarray->firstidx )
4913 nfree = boolarray->valssize - nused;
4915 newfirstidx = minidx - nfree/2;
4916 newfirstidx =
MAX(newfirstidx, 0);
4917 assert(newfirstidx <= minidx);
4918 assert(maxidx < newfirstidx + boolarray->valssize);
4920 if( boolarray->minusedidx <= boolarray->maxusedidx )
4924 assert(boolarray->firstidx <= boolarray->minusedidx);
4925 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4928 shift = boolarray->firstidx - newfirstidx;
4930 for( i = boolarray->maxusedidx - boolarray->firstidx; i >= boolarray->minusedidx - boolarray->firstidx; --i )
4932 assert(0 <= i + shift && i + shift < boolarray->valssize);
4933 boolarray->vals[i + shift] = boolarray->vals[i];
4936 for( i = 0; i < shift; ++i )
4937 boolarray->vals[boolarray->minusedidx - boolarray->firstidx + i] =
FALSE;
4939 boolarray->firstidx = newfirstidx;
4941 else if( maxidx >= boolarray->firstidx + boolarray->valssize )
4944 nfree = boolarray->valssize - nused;
4946 newfirstidx = minidx - nfree/2;
4947 newfirstidx =
MAX(newfirstidx, 0);
4948 assert(newfirstidx <= minidx);
4949 assert(maxidx < newfirstidx + boolarray->valssize);
4951 if( boolarray->minusedidx <= boolarray->maxusedidx )
4955 assert(boolarray->firstidx <= boolarray->minusedidx);
4956 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4959 shift = newfirstidx - boolarray->firstidx;
4962 assert(0 <= boolarray->minusedidx - boolarray->firstidx - shift);
4963 assert(boolarray->maxusedidx - boolarray->firstidx - shift < boolarray->valssize);
4964 BMSmoveMemoryArray(&(boolarray->vals[boolarray->minusedidx - boolarray->firstidx - shift]),
4965 &(boolarray->vals[boolarray->minusedidx - boolarray->firstidx]),
4966 boolarray->maxusedidx - boolarray->minusedidx + 1);
4969 for( i = 0; i < shift; ++i )
4970 boolarray->vals[boolarray->maxusedidx - boolarray->firstidx - i] =
FALSE;
4972 boolarray->firstidx = newfirstidx;
4975 assert(minidx >= boolarray->firstidx);
4976 assert(maxidx < boolarray->firstidx + boolarray->valssize);
4986 assert(boolarray !=
NULL);
4988 SCIPdebugMessage(
"clearing boolarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
4989 (
void*)boolarray, boolarray->
firstidx, boolarray->valssize, boolarray->minusedidx, boolarray->maxusedidx);
4991 if( boolarray->minusedidx <= boolarray->maxusedidx )
4993 assert(boolarray->firstidx <= boolarray->minusedidx);
4994 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4995 assert(boolarray->firstidx != -1);
4996 assert(boolarray->valssize > 0);
5000 boolarray->maxusedidx - boolarray->minusedidx + 1);
5003 boolarray->minusedidx = INT_MAX;
5004 boolarray->maxusedidx = INT_MIN;
5006 assert(boolarray->minusedidx == INT_MAX);
5007 assert(boolarray->maxusedidx == INT_MIN);
5018 assert(boolarray !=
NULL);
5021 if( idx < boolarray->minusedidx || idx > boolarray->
maxusedidx )
5026 assert(idx - boolarray->
firstidx >= 0);
5042 assert(boolarray !=
NULL);
5045 SCIPdebugMessage(
"setting boolarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %u\n",
5046 (
void*)boolarray, boolarray->
firstidx, boolarray->valssize, boolarray->minusedidx, boolarray->maxusedidx, idx, val);
5052 assert(idx >= boolarray->firstidx);
5053 assert(idx < boolarray->firstidx + boolarray->valssize);
5056 boolarray->vals[idx - boolarray->firstidx] = val;
5059 boolarray->minusedidx =
MIN(boolarray->minusedidx, idx);
5060 boolarray->maxusedidx =
MAX(boolarray->maxusedidx, idx);
5062 else if( idx >= boolarray->firstidx && idx < boolarray->firstidx + boolarray->valssize )
5065 boolarray->vals[idx - boolarray->firstidx] =
FALSE;
5068 if( idx == boolarray->minusedidx )
5070 assert(boolarray->maxusedidx >= 0);
5071 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
5074 boolarray->minusedidx++;
5076 while( boolarray->minusedidx <= boolarray->maxusedidx
5077 && boolarray->vals[boolarray->minusedidx - boolarray->firstidx] ==
FALSE );
5078 if( boolarray->minusedidx > boolarray->maxusedidx )
5080 boolarray->minusedidx = INT_MAX;
5081 boolarray->maxusedidx = INT_MIN;
5084 else if( idx == boolarray->maxusedidx )
5086 assert(boolarray->minusedidx >= 0);
5087 assert(boolarray->minusedidx < boolarray->maxusedidx);
5088 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
5091 boolarray->maxusedidx--;
5092 assert(boolarray->minusedidx <= boolarray->maxusedidx);
5094 while( boolarray->vals[boolarray->maxusedidx - boolarray->firstidx] ==
FALSE );
5106 assert(boolarray !=
NULL);
5116 assert(boolarray !=
NULL);
5128 assert(ptrarray !=
NULL);
5129 assert(blkmem !=
NULL);
5132 (*ptrarray)->blkmem = blkmem;
5133 (*ptrarray)->vals =
NULL;
5134 (*ptrarray)->valssize = 0;
5135 (*ptrarray)->firstidx = -1;
5136 (*ptrarray)->minusedidx = INT_MAX;
5137 (*ptrarray)->maxusedidx = INT_MIN;
5149 assert(ptrarray !=
NULL);
5150 assert(sourceptrarray !=
NULL);
5157 (*ptrarray)->valssize = sourceptrarray->
valssize;
5158 (*ptrarray)->firstidx = sourceptrarray->
firstidx;
5159 (*ptrarray)->minusedidx = sourceptrarray->
minusedidx;
5160 (*ptrarray)->maxusedidx = sourceptrarray->
maxusedidx;
5170 assert(ptrarray !=
NULL);
5171 assert(*ptrarray !=
NULL);
5193 assert(ptrarray !=
NULL);
5198 assert(0 <= minidx);
5199 assert(minidx <= maxidx);
5203 assert(0 <= minidx);
5204 assert(minidx <= maxidx);
5206 SCIPdebugMessage(
"extending ptrarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
5207 (
void*)ptrarray, ptrarray->
firstidx, ptrarray->valssize, ptrarray->minusedidx, ptrarray->maxusedidx, minidx, maxidx);
5210 nused = maxidx - minidx + 1;
5211 if( nused > ptrarray->valssize )
5217 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
5219 nfree = newvalssize - nused;
5220 newfirstidx = minidx - nfree/2;
5221 newfirstidx =
MAX(newfirstidx, 0);
5222 assert(newfirstidx <= minidx);
5223 assert(maxidx < newfirstidx + newvalssize);
5226 if( ptrarray->firstidx != -1 )
5228 for( i = 0; i < ptrarray->minusedidx - newfirstidx; ++i )
5232 assert(ptrarray->maxusedidx - ptrarray->minusedidx + 1 > 0);
5235 &(ptrarray->vals[ptrarray->minusedidx - ptrarray->firstidx]),
5236 ptrarray->maxusedidx - ptrarray->minusedidx + 1);
5237 for( i = ptrarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
5242 for( i = 0; i < newvalssize; ++i )
5248 ptrarray->vals = newvals;
5249 ptrarray->valssize = newvalssize;
5250 ptrarray->firstidx = newfirstidx;
5252 else if( ptrarray->firstidx == -1 )
5255 nfree = ptrarray->valssize - nused;
5257 ptrarray->firstidx = minidx - nfree/2;
5258 assert(ptrarray->firstidx <= minidx);
5259 assert(maxidx < ptrarray->firstidx + ptrarray->valssize);
5261 for( i = 0; i < ptrarray->valssize; ++i )
5262 assert(ptrarray->vals[i] ==
NULL);
5265 else if( minidx < ptrarray->firstidx )
5268 nfree = ptrarray->valssize - nused;
5270 newfirstidx = minidx - nfree/2;
5271 newfirstidx =
MAX(newfirstidx, 0);
5272 assert(newfirstidx <= minidx);
5273 assert(maxidx < newfirstidx + ptrarray->valssize);
5275 if( ptrarray->minusedidx <= ptrarray->maxusedidx )
5279 assert(ptrarray->firstidx <= ptrarray->minusedidx);
5280 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5283 shift = ptrarray->firstidx - newfirstidx;
5285 for( i = ptrarray->maxusedidx - ptrarray->firstidx; i >= ptrarray->minusedidx - ptrarray->firstidx; --i )
5287 assert(0 <= i + shift && i + shift < ptrarray->valssize);
5288 ptrarray->vals[i + shift] = ptrarray->vals[i];
5291 for( i = 0; i < shift; ++i )
5292 ptrarray->vals[ptrarray->minusedidx - ptrarray->firstidx + i] =
NULL;
5294 ptrarray->firstidx = newfirstidx;
5296 else if( maxidx >= ptrarray->firstidx + ptrarray->valssize )
5299 nfree = ptrarray->valssize - nused;
5301 newfirstidx = minidx - nfree/2;
5302 newfirstidx =
MAX(newfirstidx, 0);
5303 assert(newfirstidx <= minidx);
5304 assert(maxidx < newfirstidx + ptrarray->valssize);
5306 if( ptrarray->minusedidx <= ptrarray->maxusedidx )
5310 assert(ptrarray->firstidx <= ptrarray->minusedidx);
5311 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5314 shift = newfirstidx - ptrarray->firstidx;
5316 for( i = ptrarray->minusedidx - ptrarray->firstidx; i <= ptrarray->maxusedidx - ptrarray->firstidx; ++i )
5318 assert(0 <= i - shift && i - shift < ptrarray->valssize);
5319 ptrarray->vals[i - shift] = ptrarray->vals[i];
5322 for( i = 0; i < shift; ++i )
5323 ptrarray->vals[ptrarray->maxusedidx - ptrarray->firstidx - i] =
NULL;
5325 ptrarray->firstidx = newfirstidx;
5328 assert(minidx >= ptrarray->firstidx);
5329 assert(maxidx < ptrarray->firstidx + ptrarray->valssize);
5339 assert(ptrarray !=
NULL);
5341 SCIPdebugMessage(
"clearing ptrarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
5342 (
void*)ptrarray, ptrarray->
firstidx, ptrarray->valssize, ptrarray->minusedidx, ptrarray->maxusedidx);
5344 if( ptrarray->minusedidx <= ptrarray->maxusedidx )
5346 assert(ptrarray->firstidx <= ptrarray->minusedidx);
5347 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5348 assert(ptrarray->firstidx != -1);
5349 assert(ptrarray->valssize > 0);
5353 ptrarray->maxusedidx - ptrarray->minusedidx + 1);
5356 ptrarray->minusedidx = INT_MAX;
5357 ptrarray->maxusedidx = INT_MIN;
5359 assert(ptrarray->minusedidx == INT_MAX);
5360 assert(ptrarray->maxusedidx == INT_MIN);
5371 assert(ptrarray !=
NULL);
5374 if( idx < ptrarray->minusedidx || idx > ptrarray->
maxusedidx )
5379 assert(idx - ptrarray->
firstidx >= 0);
5395 assert(ptrarray !=
NULL);
5398 SCIPdebugMessage(
"setting ptrarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %p\n",
5399 (
void*)ptrarray, ptrarray->
firstidx, ptrarray->valssize, ptrarray->minusedidx, ptrarray->maxusedidx, idx, val);
5405 assert(idx >= ptrarray->firstidx);
5406 assert(idx < ptrarray->firstidx + ptrarray->valssize);
5409 ptrarray->vals[idx - ptrarray->firstidx] = val;
5412 ptrarray->minusedidx =
MIN(ptrarray->minusedidx, idx);
5413 ptrarray->maxusedidx =
MAX(ptrarray->maxusedidx, idx);
5415 else if( idx >= ptrarray->firstidx && idx < ptrarray->firstidx + ptrarray->valssize )
5418 ptrarray->vals[idx - ptrarray->firstidx] =
NULL;
5421 if( idx == ptrarray->minusedidx )
5423 assert(ptrarray->maxusedidx >= 0);
5424 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5427 ptrarray->minusedidx++;
5429 while( ptrarray->minusedidx <= ptrarray->maxusedidx
5430 && ptrarray->vals[ptrarray->minusedidx - ptrarray->firstidx] ==
NULL );
5431 if( ptrarray->minusedidx > ptrarray->maxusedidx )
5433 ptrarray->minusedidx = INT_MAX;
5434 ptrarray->maxusedidx = INT_MIN;
5437 else if( idx == ptrarray->maxusedidx )
5439 assert(ptrarray->minusedidx >= 0);
5440 assert(ptrarray->minusedidx < ptrarray->maxusedidx);
5441 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5444 ptrarray->maxusedidx--;
5445 assert(ptrarray->minusedidx <= ptrarray->maxusedidx);
5447 while( ptrarray->vals[ptrarray->maxusedidx - ptrarray->firstidx] ==
NULL );
5459 assert(ptrarray !=
NULL);
5469 assert(ptrarray !=
NULL);
5485 value1 = (int)(
size_t)elem1;
5486 value2 = (int)(
size_t)elem2;
5488 if( value1 < value2 )
5491 if( value2 < value1 )
5504 args = (
int*) dataptr;
5506 if( args[ind1] < args[ind2] )
5509 if( args[ind1] > args[ind2] )
5523 args = (
void*) dataptr;
5525 if( args[ind1] < args[ind2] )
5528 if( args[ind1] > args[ind2] )
5547 assert(indcomp !=
NULL);
5548 assert(len == 0 || perm !=
NULL);
5551 for( pos = 0; pos < len; ++pos )
5558 #define SORTTPL_NAMEEXT Ind 5559 #define SORTTPL_KEYTYPE int 5560 #define SORTTPL_INDCOMP 5565 #define SORTTPL_NAMEEXT Ptr 5566 #define SORTTPL_KEYTYPE void* 5567 #define SORTTPL_PTRCOMP 5572 #define SORTTPL_NAMEEXT PtrPtr 5573 #define SORTTPL_KEYTYPE void* 5574 #define SORTTPL_FIELD1TYPE void* 5575 #define SORTTPL_PTRCOMP 5580 #define SORTTPL_NAMEEXT PtrReal 5581 #define SORTTPL_KEYTYPE void* 5582 #define SORTTPL_FIELD1TYPE SCIP_Real 5583 #define SORTTPL_PTRCOMP 5588 #define SORTTPL_NAMEEXT PtrInt 5589 #define SORTTPL_KEYTYPE void* 5590 #define SORTTPL_FIELD1TYPE int 5591 #define SORTTPL_PTRCOMP 5596 #define SORTTPL_NAMEEXT PtrBool 5597 #define SORTTPL_KEYTYPE void* 5598 #define SORTTPL_FIELD1TYPE SCIP_Bool 5599 #define SORTTPL_PTRCOMP 5604 #define SORTTPL_NAMEEXT PtrIntInt 5605 #define SORTTPL_KEYTYPE void* 5606 #define SORTTPL_FIELD1TYPE int 5607 #define SORTTPL_FIELD2TYPE int 5608 #define SORTTPL_PTRCOMP 5613 #define SORTTPL_NAMEEXT PtrRealInt 5614 #define SORTTPL_KEYTYPE void* 5615 #define SORTTPL_FIELD1TYPE SCIP_Real 5616 #define SORTTPL_FIELD2TYPE int 5617 #define SORTTPL_PTRCOMP 5621 #define SORTTPL_NAMEEXT PtrRealRealInt 5622 #define SORTTPL_KEYTYPE void* 5623 #define SORTTPL_FIELD1TYPE SCIP_Real 5624 #define SORTTPL_FIELD2TYPE SCIP_Real 5625 #define SORTTPL_FIELD3TYPE int 5626 #define SORTTPL_PTRCOMP 5630 #define SORTTPL_NAMEEXT PtrRealRealBoolBool 5631 #define SORTTPL_KEYTYPE void* 5632 #define SORTTPL_FIELD1TYPE SCIP_Real 5633 #define SORTTPL_FIELD2TYPE SCIP_Real 5634 #define SORTTPL_FIELD3TYPE SCIP_Bool 5635 #define SORTTPL_FIELD4TYPE SCIP_Bool 5636 #define SORTTPL_PTRCOMP 5640 #define SORTTPL_NAMEEXT PtrRealRealIntBool 5641 #define SORTTPL_KEYTYPE void* 5642 #define SORTTPL_FIELD1TYPE SCIP_Real 5643 #define SORTTPL_FIELD2TYPE SCIP_Real 5644 #define SORTTPL_FIELD3TYPE int 5645 #define SORTTPL_FIELD4TYPE SCIP_Bool 5646 #define SORTTPL_PTRCOMP 5650 #define SORTTPL_NAMEEXT PtrRealBool 5651 #define SORTTPL_KEYTYPE void* 5652 #define SORTTPL_FIELD1TYPE SCIP_Real 5653 #define SORTTPL_FIELD2TYPE SCIP_Bool 5654 #define SORTTPL_PTRCOMP 5659 #define SORTTPL_NAMEEXT PtrPtrInt 5660 #define SORTTPL_KEYTYPE void* 5661 #define SORTTPL_FIELD1TYPE void* 5662 #define SORTTPL_FIELD2TYPE int 5663 #define SORTTPL_PTRCOMP 5668 #define SORTTPL_NAMEEXT PtrPtrReal 5669 #define SORTTPL_KEYTYPE void* 5670 #define SORTTPL_FIELD1TYPE void* 5671 #define SORTTPL_FIELD2TYPE SCIP_Real 5672 #define SORTTPL_PTRCOMP 5677 #define SORTTPL_NAMEEXT PtrRealIntInt 5678 #define SORTTPL_KEYTYPE void* 5679 #define SORTTPL_FIELD1TYPE SCIP_Real 5680 #define SORTTPL_FIELD2TYPE int 5681 #define SORTTPL_FIELD3TYPE int 5682 #define SORTTPL_PTRCOMP 5687 #define SORTTPL_NAMEEXT PtrPtrIntInt 5688 #define SORTTPL_KEYTYPE void* 5689 #define SORTTPL_FIELD1TYPE void* 5690 #define SORTTPL_FIELD2TYPE int 5691 #define SORTTPL_FIELD3TYPE int 5692 #define SORTTPL_PTRCOMP 5697 #define SORTTPL_NAMEEXT PtrPtrRealInt 5698 #define SORTTPL_KEYTYPE void* 5699 #define SORTTPL_FIELD1TYPE void* 5700 #define SORTTPL_FIELD2TYPE SCIP_Real 5701 #define SORTTPL_FIELD3TYPE int 5702 #define SORTTPL_PTRCOMP 5707 #define SORTTPL_NAMEEXT PtrPtrRealBool 5708 #define SORTTPL_KEYTYPE void* 5709 #define SORTTPL_FIELD1TYPE void* 5710 #define SORTTPL_FIELD2TYPE SCIP_Real 5711 #define SORTTPL_FIELD3TYPE SCIP_Bool 5712 #define SORTTPL_PTRCOMP 5717 #define SORTTPL_NAMEEXT PtrPtrLongInt 5718 #define SORTTPL_KEYTYPE void* 5719 #define SORTTPL_FIELD1TYPE void* 5720 #define SORTTPL_FIELD2TYPE SCIP_Longint 5721 #define SORTTPL_FIELD3TYPE int 5722 #define SORTTPL_PTRCOMP 5727 #define SORTTPL_NAMEEXT PtrPtrLongIntInt 5728 #define SORTTPL_KEYTYPE void* 5729 #define SORTTPL_FIELD1TYPE void* 5730 #define SORTTPL_FIELD2TYPE SCIP_Longint 5731 #define SORTTPL_FIELD3TYPE int 5732 #define SORTTPL_FIELD4TYPE int 5733 #define SORTTPL_PTRCOMP 5738 #define SORTTPL_NAMEEXT Real 5739 #define SORTTPL_KEYTYPE SCIP_Real 5744 #define SORTTPL_NAMEEXT RealBoolPtr 5745 #define SORTTPL_KEYTYPE SCIP_Real 5746 #define SORTTPL_FIELD1TYPE SCIP_Bool 5747 #define SORTTPL_FIELD2TYPE void* 5752 #define SORTTPL_NAMEEXT RealPtr 5753 #define SORTTPL_KEYTYPE SCIP_Real 5754 #define SORTTPL_FIELD1TYPE void* 5759 #define SORTTPL_NAMEEXT RealInt 5760 #define SORTTPL_KEYTYPE SCIP_Real 5761 #define SORTTPL_FIELD1TYPE int 5766 #define SORTTPL_NAMEEXT RealIntInt 5767 #define SORTTPL_KEYTYPE SCIP_Real 5768 #define SORTTPL_FIELD1TYPE int 5769 #define SORTTPL_FIELD2TYPE int 5774 #define SORTTPL_NAMEEXT RealIntLong 5775 #define SORTTPL_KEYTYPE SCIP_Real 5776 #define SORTTPL_FIELD1TYPE int 5777 #define SORTTPL_FIELD2TYPE SCIP_Longint 5782 #define SORTTPL_NAMEEXT RealIntPtr 5783 #define SORTTPL_KEYTYPE SCIP_Real 5784 #define SORTTPL_FIELD1TYPE int 5785 #define SORTTPL_FIELD2TYPE void* 5790 #define SORTTPL_NAMEEXT RealRealPtr 5791 #define SORTTPL_KEYTYPE SCIP_Real 5792 #define SORTTPL_FIELD1TYPE SCIP_Real 5793 #define SORTTPL_FIELD2TYPE void* 5798 #define SORTTPL_NAMEEXT RealLongRealInt 5799 #define SORTTPL_KEYTYPE SCIP_Real 5800 #define SORTTPL_FIELD1TYPE SCIP_Longint 5801 #define SORTTPL_FIELD2TYPE SCIP_Real 5802 #define SORTTPL_FIELD3TYPE int 5806 #define SORTTPL_NAMEEXT RealRealIntInt 5807 #define SORTTPL_KEYTYPE SCIP_Real 5808 #define SORTTPL_FIELD1TYPE SCIP_Real 5809 #define SORTTPL_FIELD2TYPE int 5810 #define SORTTPL_FIELD3TYPE int 5815 #define SORTTPL_NAMEEXT RealRealRealInt 5816 #define SORTTPL_KEYTYPE SCIP_Real 5817 #define SORTTPL_FIELD1TYPE SCIP_Real 5818 #define SORTTPL_FIELD2TYPE SCIP_Real 5819 #define SORTTPL_FIELD3TYPE int 5824 #define SORTTPL_NAMEEXT RealRealRealPtr 5825 #define SORTTPL_KEYTYPE SCIP_Real 5826 #define SORTTPL_FIELD1TYPE SCIP_Real 5827 #define SORTTPL_FIELD2TYPE SCIP_Real 5828 #define SORTTPL_FIELD3TYPE void* 5833 #define SORTTPL_NAMEEXT RealPtrPtrInt 5834 #define SORTTPL_KEYTYPE SCIP_Real 5835 #define SORTTPL_FIELD1TYPE void* 5836 #define SORTTPL_FIELD2TYPE void* 5837 #define SORTTPL_FIELD3TYPE int 5842 #define SORTTPL_NAMEEXT RealPtrPtrIntInt 5843 #define SORTTPL_KEYTYPE SCIP_Real 5844 #define SORTTPL_FIELD1TYPE void* 5845 #define SORTTPL_FIELD2TYPE void* 5846 #define SORTTPL_FIELD3TYPE int 5847 #define SORTTPL_FIELD4TYPE int 5852 #define SORTTPL_NAMEEXT RealRealRealBoolPtr 5853 #define SORTTPL_KEYTYPE SCIP_Real 5854 #define SORTTPL_FIELD1TYPE SCIP_Real 5855 #define SORTTPL_FIELD2TYPE SCIP_Real 5856 #define SORTTPL_FIELD3TYPE SCIP_Bool 5857 #define SORTTPL_FIELD4TYPE void* 5862 #define SORTTPL_NAMEEXT RealRealRealBoolBoolPtr 5863 #define SORTTPL_KEYTYPE SCIP_Real 5864 #define SORTTPL_FIELD1TYPE SCIP_Real 5865 #define SORTTPL_FIELD2TYPE SCIP_Real 5866 #define SORTTPL_FIELD3TYPE SCIP_Bool 5867 #define SORTTPL_FIELD4TYPE SCIP_Bool 5868 #define SORTTPL_FIELD5TYPE void* 5873 #define SORTTPL_NAMEEXT Int 5874 #define SORTTPL_KEYTYPE int 5879 #define SORTTPL_NAMEEXT IntInt 5880 #define SORTTPL_KEYTYPE int 5881 #define SORTTPL_FIELD1TYPE int 5886 #define SORTTPL_NAMEEXT IntReal 5887 #define SORTTPL_KEYTYPE int 5888 #define SORTTPL_FIELD1TYPE SCIP_Real 5893 #define SORTTPL_NAMEEXT IntPtr 5894 #define SORTTPL_KEYTYPE int 5895 #define SORTTPL_FIELD1TYPE void* 5900 #define SORTTPL_NAMEEXT IntIntInt 5901 #define SORTTPL_KEYTYPE int 5902 #define SORTTPL_FIELD1TYPE int 5903 #define SORTTPL_FIELD2TYPE int 5908 #define SORTTPL_NAMEEXT IntIntLong 5909 #define SORTTPL_KEYTYPE int 5910 #define SORTTPL_FIELD1TYPE int 5911 #define SORTTPL_FIELD2TYPE SCIP_Longint 5915 #define SORTTPL_NAMEEXT IntRealLong 5916 #define SORTTPL_KEYTYPE int 5917 #define SORTTPL_FIELD1TYPE SCIP_Real 5918 #define SORTTPL_FIELD2TYPE SCIP_Longint 5923 #define SORTTPL_NAMEEXT IntIntPtr 5924 #define SORTTPL_KEYTYPE int 5925 #define SORTTPL_FIELD1TYPE int 5926 #define SORTTPL_FIELD2TYPE void* 5931 #define SORTTPL_NAMEEXT IntIntReal 5932 #define SORTTPL_KEYTYPE int 5933 #define SORTTPL_FIELD1TYPE int 5934 #define SORTTPL_FIELD2TYPE SCIP_Real 5939 #define SORTTPL_NAMEEXT IntPtrReal 5940 #define SORTTPL_KEYTYPE int 5941 #define SORTTPL_FIELD1TYPE void* 5942 #define SORTTPL_FIELD2TYPE SCIP_Real 5947 #define SORTTPL_NAMEEXT IntIntIntPtr 5948 #define SORTTPL_KEYTYPE int 5949 #define SORTTPL_FIELD1TYPE int 5950 #define SORTTPL_FIELD2TYPE int 5951 #define SORTTPL_FIELD3TYPE void* 5955 #define SORTTPL_NAMEEXT IntIntIntReal 5956 #define SORTTPL_KEYTYPE int 5957 #define SORTTPL_FIELD1TYPE int 5958 #define SORTTPL_FIELD2TYPE int 5959 #define SORTTPL_FIELD3TYPE SCIP_Real 5963 #define SORTTPL_NAMEEXT IntPtrIntReal 5964 #define SORTTPL_KEYTYPE int 5965 #define SORTTPL_FIELD1TYPE void* 5966 #define SORTTPL_FIELD2TYPE int 5967 #define SORTTPL_FIELD3TYPE SCIP_Real 5972 #define SORTTPL_NAMEEXT Long 5973 #define SORTTPL_KEYTYPE SCIP_Longint 5978 #define SORTTPL_NAMEEXT LongPtr 5979 #define SORTTPL_KEYTYPE SCIP_Longint 5980 #define SORTTPL_FIELD1TYPE void* 5985 #define SORTTPL_NAMEEXT LongPtrInt 5986 #define SORTTPL_KEYTYPE SCIP_Longint 5987 #define SORTTPL_FIELD1TYPE void* 5988 #define SORTTPL_FIELD2TYPE int 5993 #define SORTTPL_NAMEEXT LongPtrRealBool 5994 #define SORTTPL_KEYTYPE SCIP_Longint 5995 #define SORTTPL_FIELD1TYPE void* 5996 #define SORTTPL_FIELD2TYPE SCIP_Real 5997 #define SORTTPL_FIELD3TYPE SCIP_Bool 6002 #define SORTTPL_NAMEEXT LongPtrRealRealBool 6003 #define SORTTPL_KEYTYPE SCIP_Longint 6004 #define SORTTPL_FIELD1TYPE void* 6005 #define SORTTPL_FIELD2TYPE SCIP_Real 6006 #define SORTTPL_FIELD3TYPE SCIP_Real 6007 #define SORTTPL_FIELD4TYPE SCIP_Bool 6012 #define SORTTPL_NAMEEXT LongPtrRealRealIntBool 6013 #define SORTTPL_KEYTYPE SCIP_Longint 6014 #define SORTTPL_FIELD1TYPE void* 6015 #define SORTTPL_FIELD2TYPE SCIP_Real 6016 #define SORTTPL_FIELD3TYPE SCIP_Real 6017 #define SORTTPL_FIELD4TYPE int 6018 #define SORTTPL_FIELD5TYPE SCIP_Bool 6023 #define SORTTPL_NAMEEXT LongPtrPtrInt 6024 #define SORTTPL_KEYTYPE SCIP_Longint 6025 #define SORTTPL_FIELD1TYPE void* 6026 #define SORTTPL_FIELD2TYPE void* 6027 #define SORTTPL_FIELD3TYPE int 6032 #define SORTTPL_NAMEEXT LongPtrPtrIntInt 6033 #define SORTTPL_KEYTYPE SCIP_Longint 6034 #define SORTTPL_FIELD1TYPE void* 6035 #define SORTTPL_FIELD2TYPE void* 6036 #define SORTTPL_FIELD3TYPE int 6037 #define SORTTPL_FIELD4TYPE int 6042 #define SORTTPL_NAMEEXT LongPtrPtrBoolInt 6043 #define SORTTPL_KEYTYPE SCIP_Longint 6044 #define SORTTPL_FIELD1TYPE void* 6045 #define SORTTPL_FIELD2TYPE void* 6046 #define SORTTPL_FIELD3TYPE SCIP_Bool 6047 #define SORTTPL_FIELD4TYPE int 6052 #define SORTTPL_NAMEEXT PtrIntIntBoolBool 6053 #define SORTTPL_KEYTYPE void* 6054 #define SORTTPL_FIELD1TYPE int 6055 #define SORTTPL_FIELD2TYPE int 6056 #define SORTTPL_FIELD3TYPE SCIP_Bool 6057 #define SORTTPL_FIELD4TYPE SCIP_Bool 6058 #define SORTTPL_PTRCOMP 6063 #define SORTTPL_NAMEEXT IntPtrIntIntBoolBool 6064 #define SORTTPL_KEYTYPE int 6065 #define SORTTPL_FIELD1TYPE void* 6066 #define SORTTPL_FIELD2TYPE int 6067 #define SORTTPL_FIELD3TYPE int 6068 #define SORTTPL_FIELD4TYPE SCIP_Bool 6069 #define SORTTPL_FIELD5TYPE SCIP_Bool 6086 assert(indcomp !=
NULL);
6087 assert(len == 0 || perm !=
NULL);
6090 for( pos = 0; pos < len; ++pos )
6098 #define SORTTPL_NAMEEXT DownInd 6099 #define SORTTPL_KEYTYPE int 6100 #define SORTTPL_INDCOMP 6101 #define SORTTPL_BACKWARDS 6106 #define SORTTPL_NAMEEXT DownPtr 6107 #define SORTTPL_KEYTYPE void* 6108 #define SORTTPL_PTRCOMP 6109 #define SORTTPL_BACKWARDS 6114 #define SORTTPL_NAMEEXT DownPtrPtr 6115 #define SORTTPL_KEYTYPE void* 6116 #define SORTTPL_FIELD1TYPE void* 6117 #define SORTTPL_PTRCOMP 6118 #define SORTTPL_BACKWARDS 6123 #define SORTTPL_NAMEEXT DownPtrReal 6124 #define SORTTPL_KEYTYPE void* 6125 #define SORTTPL_FIELD1TYPE SCIP_Real 6126 #define SORTTPL_PTRCOMP 6127 #define SORTTPL_BACKWARDS 6132 #define SORTTPL_NAMEEXT DownPtrInt 6133 #define SORTTPL_KEYTYPE void* 6134 #define SORTTPL_FIELD1TYPE int 6135 #define SORTTPL_PTRCOMP 6136 #define SORTTPL_BACKWARDS 6140 #define SORTTPL_NAMEEXT DownPtrBool 6141 #define SORTTPL_KEYTYPE void* 6142 #define SORTTPL_FIELD1TYPE SCIP_Bool 6143 #define SORTTPL_PTRCOMP 6144 #define SORTTPL_BACKWARDS 6148 #define SORTTPL_NAMEEXT DownPtrIntInt 6149 #define SORTTPL_KEYTYPE void* 6150 #define SORTTPL_FIELD1TYPE int 6151 #define SORTTPL_FIELD2TYPE int 6152 #define SORTTPL_PTRCOMP 6153 #define SORTTPL_BACKWARDS 6158 #define SORTTPL_NAMEEXT DownPtrRealInt 6159 #define SORTTPL_KEYTYPE void* 6160 #define SORTTPL_FIELD1TYPE SCIP_Real 6161 #define SORTTPL_FIELD2TYPE int 6162 #define SORTTPL_PTRCOMP 6163 #define SORTTPL_BACKWARDS 6168 #define SORTTPL_NAMEEXT DownPtrRealBool 6169 #define SORTTPL_KEYTYPE void* 6170 #define SORTTPL_FIELD1TYPE SCIP_Real 6171 #define SORTTPL_FIELD2TYPE SCIP_Bool 6172 #define SORTTPL_PTRCOMP 6173 #define SORTTPL_BACKWARDS 6178 #define SORTTPL_NAMEEXT DownPtrPtrInt 6179 #define SORTTPL_KEYTYPE void* 6180 #define SORTTPL_FIELD1TYPE void* 6181 #define SORTTPL_FIELD2TYPE int 6182 #define SORTTPL_PTRCOMP 6183 #define SORTTPL_BACKWARDS 6188 #define SORTTPL_NAMEEXT DownPtrPtrReal 6189 #define SORTTPL_KEYTYPE void* 6190 #define SORTTPL_FIELD1TYPE void* 6191 #define SORTTPL_FIELD2TYPE SCIP_Real 6192 #define SORTTPL_PTRCOMP 6193 #define SORTTPL_BACKWARDS 6198 #define SORTTPL_NAMEEXT DownPtrRealIntInt 6199 #define SORTTPL_KEYTYPE void* 6200 #define SORTTPL_FIELD1TYPE SCIP_Real 6201 #define SORTTPL_FIELD2TYPE int 6202 #define SORTTPL_FIELD3TYPE int 6203 #define SORTTPL_PTRCOMP 6204 #define SORTTPL_BACKWARDS 6209 #define SORTTPL_NAMEEXT DownPtrPtrIntInt 6210 #define SORTTPL_KEYTYPE void* 6211 #define SORTTPL_FIELD1TYPE void* 6212 #define SORTTPL_FIELD2TYPE int 6213 #define SORTTPL_FIELD3TYPE int 6214 #define SORTTPL_PTRCOMP 6215 #define SORTTPL_BACKWARDS