51 #define SQRTOFTWO 1.4142136 68 1.000, 2.414, 3.078, 6.314, 12.706,
69 0.816, 1.604, 1.886, 2.920, 4.303,
70 0.765, 1.423, 1.638, 2.353, 3.182,
71 0.741, 1.344, 1.533, 2.132, 2.776,
72 0.727, 1.301, 1.476, 2.015, 2.571,
73 0.718, 1.273, 1.440, 1.943, 2.447,
74 0.711, 1.254, 1.415, 1.895, 2.365,
75 0.706, 1.240, 1.397, 1.860, 2.306,
76 0.703, 1.230, 1.383, 1.833, 2.262,
77 0.700, 1.221, 1.372, 1.812, 2.228,
78 0.697, 1.214, 1.363, 1.796, 2.201,
79 0.695, 1.209, 1.356, 1.782, 2.179,
80 0.694, 1.204, 1.350, 1.771, 2.160,
81 0.692, 1.200, 1.345, 1.761, 2.145,
82 0.691, 1.197, 1.341, 1.753, 2.131
89 0.674, 1.150, 1.282, 1.645, 1.960
126 if( countx < 1.9 || county < 1.9 )
130 pooledvariance = (countx - 1) * variancex + (county - 1) * variancey;
131 pooledvariance /= (countx + county - 2);
134 pooledvariance =
MAX(pooledvariance, 1e-9);
139 tresult = (meanx - meany) / pooledvariance;
140 tresult *= SQRT(countx * county / (countx + county));
150 #if defined(_WIN32) || defined(_WIN64) 161 sign = (x >= 0) ? 1 : -1;
165 y = 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*
exp(-x*x);
196 assert(variance >= -1e-9);
197 if( variance < 1e-9 )
200 std =
sqrt(variance);
205 if( value < mean + 1e-9 )
210 assert( std != 0.0 );
213 normvalue = (value - mean)/(std *
SQRTOFTWO);
215 SCIPdebugMessage(
" Normalized value %g = ( %g - %g ) / (%g * 1.4142136)\n", normvalue, value, mean, std);
220 if( normvalue < 1e-9 && normvalue > -1e-9 )
222 else if( normvalue > 0 )
226 erfresult =
SCIPerf(normvalue);
227 return erfresult / 2.0 + 0.5;
233 erfresult =
SCIPerf(-normvalue);
235 return 0.5 - erfresult / 2.0;
248 assert(regression !=
NULL);
258 assert(regression !=
NULL);
260 return regression->
slope;
268 assert(regression !=
NULL);
289 regression->
slope = 0.0;
323 assert(meanptr !=
NULL);
324 assert(sumvarptr !=
NULL);
325 assert(nobservations > 0 || add);
327 addfactor = add ? 1.0 : -1.0;
330 *meanptr = oldmean + addfactor * (value - oldmean)/(
SCIP_Real)nobservations;
331 *sumvarptr += addfactor * (value - oldmean) * (value - (*meanptr));
334 assert(*sumvarptr >= -1e-4);
335 *sumvarptr =
MAX(0.0, *sumvarptr);
345 assert(regression !=
NULL);
363 regression->
sumxy -= (x *
y);
378 assert(regression !=
NULL);
384 regression->
sumxy += x *
y;
397 regression->
meanx = 0;
399 regression->
sumxy = 0;
400 regression->
meany = 0;
410 assert(regression !=
NULL);
439 assert(initsize >= 0);
440 assert(growfac >= 1.0);
444 size =
MAX(initsize, num);
450 initsize =
MAX(initsize, 4);
455 while( size < num && size > oldsize )
458 size = (int)(growfac * size + initsize);
462 if( size <= oldsize )
466 assert(size >= initsize);
477 #define GMLNODEWIDTH 120.0 478 #define GMLNODEHEIGTH 30.0 479 #define GMLFONTSIZE 13 480 #define GMLNODETYPE "rectangle" 481 #define GMLNODEFILLCOLOR "#ff0000" 482 #define GMLEDGECOLOR "black" 483 #define GMLNODEBORDERCOLOR "#000000" 491 const char* nodetype,
492 const char* fillcolor,
493 const char* bordercolor
496 assert(file !=
NULL);
497 assert(label !=
NULL);
499 fprintf(file,
" node\n");
500 fprintf(file,
" [\n");
501 fprintf(file,
" id %u\n",
id);
502 fprintf(file,
" label \"%s\"\n", label);
503 fprintf(file,
" graphics\n");
504 fprintf(file,
" [\n");
508 if( nodetype !=
NULL )
509 fprintf(file,
" type \"%s\"\n", nodetype);
513 if( fillcolor !=
NULL )
514 fprintf(file,
" fill \"%s\"\n", fillcolor);
518 if( bordercolor !=
NULL )
519 fprintf(file,
" outline \"%s\"\n", bordercolor);
523 fprintf(file,
" ]\n");
524 fprintf(file,
" LabelGraphics\n");
525 fprintf(file,
" [\n");
526 fprintf(file,
" text \"%s\"\n", label);
528 fprintf(file,
" fontName \"Dialog\"\n");
529 fprintf(file,
" anchor \"c\"\n");
530 fprintf(file,
" ]\n");
531 fprintf(file,
" ]\n");
539 const char* nodetype,
540 const char* fillcolor,
541 const char* bordercolor,
545 assert(file !=
NULL);
546 assert(label !=
NULL);
548 fprintf(file,
" node\n");
549 fprintf(file,
" [\n");
550 fprintf(file,
" id %u\n",
id);
551 fprintf(file,
" label \"%s\"\n", label);
552 fprintf(file,
" weight %g\n", weight);
553 fprintf(file,
" graphics\n");
554 fprintf(file,
" [\n");
558 if( nodetype !=
NULL )
559 fprintf(file,
" type \"%s\"\n", nodetype);
563 if( fillcolor !=
NULL )
564 fprintf(file,
" fill \"%s\"\n", fillcolor);
568 if( bordercolor !=
NULL )
569 fprintf(file,
" outline \"%s\"\n", bordercolor);
573 fprintf(file,
" ]\n");
574 fprintf(file,
" LabelGraphics\n");
575 fprintf(file,
" [\n");
576 fprintf(file,
" text \"%s\"\n", label);
578 fprintf(file,
" fontName \"Dialog\"\n");
579 fprintf(file,
" anchor \"c\"\n");
580 fprintf(file,
" ]\n");
581 fprintf(file,
" ]\n");
593 assert(file !=
NULL);
595 fprintf(file,
" edge\n");
596 fprintf(file,
" [\n");
597 fprintf(file,
" source %u\n", source);
598 fprintf(file,
" target %u\n", target);
601 fprintf(file,
" label \"%s\"\n", label);
603 fprintf(file,
" graphics\n");
604 fprintf(file,
" [\n");
607 fprintf(file,
" fill \"%s\"\n", color);
612 fprintf(file,
" ]\n");
616 fprintf(file,
" LabelGraphics\n");
617 fprintf(file,
" [\n");
618 fprintf(file,
" text \"%s\"\n", label);
620 fprintf(file,
" fontName \"Dialog\"\n");
621 fprintf(file,
" anchor \"c\"\n");
622 fprintf(file,
" ]\n");
625 fprintf(file,
" ]\n");
637 assert(file !=
NULL);
639 fprintf(file,
" edge\n");
640 fprintf(file,
" [\n");
641 fprintf(file,
" source %u\n", source);
642 fprintf(file,
" target %u\n", target);
645 fprintf(file,
" label \"%s\"\n", label);
647 fprintf(file,
" graphics\n");
648 fprintf(file,
" [\n");
651 fprintf(file,
" fill \"%s\"\n", color);
655 fprintf(file,
" targetArrow \"standard\"\n");
656 fprintf(file,
" ]\n");
660 fprintf(file,
" LabelGraphics\n");
661 fprintf(file,
" [\n");
662 fprintf(file,
" text \"%s\"\n", label);
664 fprintf(file,
" fontName \"Dialog\"\n");
665 fprintf(file,
" anchor \"c\"\n");
666 fprintf(file,
" ]\n");
669 fprintf(file,
" ]\n");
678 assert(file !=
NULL);
680 fprintf(file,
"graph\n");
681 fprintf(file,
"[\n");
682 fprintf(file,
" hierarchic 1\n");
685 fprintf(file,
" directed 1\n");
693 assert(file !=
NULL);
695 fprintf(file,
"]\n");
717 assert(sparsesol !=
NULL);
718 assert(vars !=
NULL);
727 for( v = nvars - 1; v >= 0; --v )
729 assert(vars[v] !=
NULL);
750 (*sparsesol)->nvars = nvars;
760 assert(sparsesol !=
NULL);
761 assert(*sparsesol !=
NULL);
774 assert(sparsesol !=
NULL);
776 return sparsesol->
vars;
784 assert(sparsesol !=
NULL);
786 return sparsesol->
nvars;
794 assert(sparsesol !=
NULL);
804 assert(sparsesol !=
NULL);
819 assert(sparsesol !=
NULL);
824 assert(lbvalues !=
NULL);
827 for( v = 0; v < nvars; ++v )
828 sol[v] = lbvalues[v];
847 assert(sparsesol !=
NULL);
858 assert(lbvalues !=
NULL);
859 assert(ubvalues !=
NULL);
864 for( v = 0; v < nvars; ++v )
866 lbvalue = lbvalues[v];
867 ubvalue = ubvalues[v];
869 if( lbvalue < ubvalue )
873 if( carryflag ==
FALSE )
875 if( sol[v] < ubvalue )
883 assert(sol[v] == ubvalue);
890 if( sol[v] < ubvalue )
898 assert(sol[v] == ubvalue);
905 return (!carryflag && !singular);
920 assert(queue !=
NULL);
923 if( minsize <= queue->size )
940 assert(queue !=
NULL);
942 initsize =
MAX(1, initsize);
943 sizefac =
MAX(1.0, sizefac);
946 (*queue)->firstfree = 0;
947 (*queue)->firstused = -1;
949 (*queue)->sizefac = sizefac;
950 (*queue)->slots =
NULL;
962 assert(queue !=
NULL);
973 assert(queue !=
NULL);
988 int oldsize = queue->
size;
991 assert(oldsize < queue->size);
993 sizediff = queue->
size - oldsize;
1025 assert(queue !=
NULL);
1030 assert(elem !=
NULL);
1051 assert(queue !=
NULL);
1077 assert(queue !=
NULL);
1111 assert(queue !=
NULL);
1143 assert(queue !=
NULL);
1161 assert(queue !=
NULL);
1179 assert(queue !=
NULL);
1192 assert(queue !=
NULL);
1212 #define PQ_PARENT(q) (((q)+1)/2-1) 1213 #define PQ_LEFTCHILD(p) (2*(p)+1) 1214 #define PQ_RIGHTCHILD(p) (2*(p)+2) 1224 assert(pqueue !=
NULL);
1226 if( minsize <= pqueue->size )
1244 assert(pqueue !=
NULL);
1245 assert(ptrcomp !=
NULL);
1247 initsize =
MAX(1, initsize);
1248 sizefac =
MAX(1.0, sizefac);
1252 (*pqueue)->size = 0;
1253 (*pqueue)->sizefac = sizefac;
1254 (*pqueue)->slots =
NULL;
1255 (*pqueue)->ptrcomp = ptrcomp;
1256 (*pqueue)->elemchgpos = elemchgpos;
1267 assert(pqueue !=
NULL);
1278 assert(pqueue !=
NULL);
1292 pqueue->
slots[newpos] = elem;
1295 if( pqueue->elemchgpos !=
NULL )
1297 pqueue->elemchgpos(elem, oldpos, newpos);
1301 #ifdef SCIP_MORE_DEBUG 1324 if( pqueue->ptrcomp(pqueue->
slots[i], pqueue->
slots[leftchild]) > 0 )
1343 assert(pqueue !=
NULL);
1344 assert(pqueue->
len >= 0);
1345 assert(elem !=
NULL);
1353 while( pos > 0 && (*pqueue->ptrcomp)(elem, pqueue->
slots[parentpos]) < 0 )
1355 assert((*pqueue->ptrcomp)(pqueue->
slots[parentpos], elem) >= 0);
1365 #ifdef SCIP_MORE_DEBUG 1366 assert(pqueueHasHeapProperty(pqueue));
1381 assert(pqueue !=
NULL);
1391 if( pos == pqueue->
len )
1399 while( pos > 0 && (*pqueue->ptrcomp)(last, pqueue->
slots[
PQ_PARENT(pos)]) < 0 )
1411 if( brotherpos < pqueue->len && (*pqueue->ptrcomp)(pqueue->
slots[brotherpos], pqueue->
slots[childpos]) < 0 )
1412 childpos = brotherpos;
1414 if( (*pqueue->ptrcomp)(last, pqueue->
slots[childpos]) <= 0 )
1424 assert(pos <= pqueue->len - 1);
1428 #ifdef SCIP_MORE_DEBUG 1429 assert(pqueueHasHeapProperty(pqueue));
1440 assert(pqueue !=
NULL);
1441 assert(pqueue->
len >= 0);
1443 if( pqueue->
len == 0 )
1446 root = pqueue->
slots[0];
1458 assert(pqueue !=
NULL);
1459 assert(pqueue->
len >= 0);
1461 if( pqueue->
len == 0 )
1464 return pqueue->
slots[0];
1472 assert(pqueue !=
NULL);
1473 assert(pqueue->
len >= 0);
1483 assert(pqueue !=
NULL);
1484 assert(pqueue->
len >= 0);
1486 return pqueue->
slots;
1499 if( pqueue->
slots[pos] == elem )
1574 return ( (uint32_t) ((UINT64_C(0x9e3779b97f4a7c15) * input)>>32) ) | 1u;
1585 assert(0 <= pos && pos < primetablesize);
1587 return primetable[pos];
1600 assert(multihashlist !=
NULL);
1601 assert(blkmem !=
NULL);
1602 assert(element !=
NULL);
1606 newlist->
next = *multihashlist;
1607 *multihashlist = newlist;
1622 assert(multihashlist !=
NULL);
1623 assert(blkmem !=
NULL);
1625 list = *multihashlist;
1626 while( list !=
NULL )
1628 nextlist = list->
next;
1633 *multihashlist =
NULL;
1648 uint64_t currentkeyval;
1651 assert(hashkeyeq !=
NULL);
1652 assert(key !=
NULL);
1654 while( multihashlist !=
NULL )
1656 currentkey = hashgetkey(userptr, multihashlist->
element);
1657 currentkeyval = hashkeyval(userptr, currentkey);
1658 if( currentkeyval == keyval && hashkeyeq(userptr, currentkey, key) )
1659 return multihashlist;
1661 multihashlist = multihashlist->
next;
1682 h =
multihashlistFind(multihashlist, hashgetkey, hashkeyeq, hashkeyval, userptr, keyval, key);
1697 key1 = hashgetkey(userptr, h->
element);
1698 key2 = hashgetkey(userptr, h2->
element);
1699 assert(hashkeyval(userptr, key1) == hashkeyval(userptr, key2));
1701 if( hashkeyeq(userptr, key1, key2) )
1703 SCIPerrorMessage(
"WARNING: hashkey with same value exists multiple times (e.g. duplicate constraint/variable names), so the return value is maybe not correct\n");
1732 assert(multihashlist !=
NULL);
1735 h =
multihashlistFind(*multihashlist, hashgetkey, hashkeyeq, hashkeyval, userptr, keyval, key);
1740 *multihashlist = h->
next;
1745 *multihashlist =
NULL;
1760 assert(multihashlist !=
NULL);
1761 assert(blkmem !=
NULL);
1762 assert(element !=
NULL);
1764 while( *multihashlist !=
NULL && (*multihashlist)->element != element )
1765 multihashlist = &(*multihashlist)->
next;
1767 if( *multihashlist !=
NULL )
1769 nextlist = (*multihashlist)->
next;
1771 *multihashlist = nextlist;
1779 #define SCIP_MULTIHASH_MAXSIZE 33554431 1780 #define SCIP_MULTIHASH_RESIZE_PERCENTAGE 65 1781 #define SCIP_MULTIHASH_GROW_FACTOR 1.31 1795 assert(multihash !=
NULL);
1797 assert(multihash->
nlists > 0);
1798 assert(multihash->hashgetkey !=
NULL);
1799 assert(multihash->hashkeyeq !=
NULL);
1800 assert(multihash->hashkeyval !=
NULL);
1804 nnewlists =
MAX(nnewlists, multihash->
nlists);
1808 if( nnewlists > multihash->
nlists )
1813 unsigned int hashval;
1818 for( l = multihash->
nlists - 1; l >= 0; --l )
1820 multihashlist = multihash->
lists[l];
1824 while( multihashlist !=
NULL )
1827 key = multihash->hashgetkey(multihash->
userptr, multihashlist->
element);
1828 keyval = multihash->hashkeyval(multihash->
userptr, key);
1829 hashval = (
unsigned int) (keyval % (
unsigned) nnewlists);
1834 if( multihashlist->
next ==
NULL && onlyone )
1837 if( newlists[hashval] ==
NULL )
1838 newlists[hashval] = multihashlist;
1845 while( next !=
NULL )
1851 lastnext->
next = multihashlist;
1863 multihashlist = multihashlist->
next;
1875 multihash->
lists = newlists;
1876 multihash->
nlists = nnewlists;
1879 #ifdef SCIP_MORE_DEBUG 1883 for( l = 0; l < multihash->
nlists; ++l )
1885 multihashlist = multihash->
lists[l];
1886 while( multihashlist !=
NULL )
1889 multihashlist = multihashlist->
next;
1892 assert(sumslotsize == multihash->
nelements);
1914 assert(tablesize >= 0);
1915 assert(multihash !=
NULL);
1916 assert(hashgetkey !=
NULL);
1917 assert(hashkeyeq !=
NULL);
1918 assert(hashkeyval !=
NULL);
1922 (*multihash)->blkmem = blkmem;
1923 (*multihash)->nlists = tablesize;
1924 (*multihash)->hashgetkey = hashgetkey;
1925 (*multihash)->hashkeyeq = hashkeyeq;
1926 (*multihash)->hashkeyval = hashkeyval;
1927 (*multihash)->userptr = userptr;
1928 (*multihash)->nelements = 0;
1943 assert(multihash !=
NULL);
1944 assert(*multihash !=
NULL);
1946 table = (*multihash);
1948 lists = table->
lists;
1951 for( i = table->
nlists - 1; i >= 0; --i )
1972 unsigned int hashval;
1974 assert(multihash !=
NULL);
1976 assert(multihash->
nlists > 0);
1977 assert(multihash->hashgetkey !=
NULL);
1978 assert(multihash->hashkeyeq !=
NULL);
1979 assert(multihash->hashkeyval !=
NULL);
1980 assert(element !=
NULL);
1989 key = multihash->hashgetkey(multihash->
userptr, element);
1990 keyval = multihash->hashkeyval(multihash->
userptr, key);
1991 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2011 assert(multihash !=
NULL);
2012 assert(multihash->hashgetkey !=
NULL);
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(key !=
NULL);
2042 keyval = multihash->hashkeyval(multihash->
userptr, key);
2043 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2046 multihash->hashkeyval, multihash->
userptr, keyval, key);
2064 assert(multihash !=
NULL);
2066 assert(multihash->
nlists > 0);
2067 assert(multihash->hashgetkey !=
NULL);
2068 assert(multihash->hashkeyeq !=
NULL);
2069 assert(multihash->hashkeyval !=
NULL);
2070 assert(multihashlist !=
NULL);
2071 assert(key !=
NULL);
2073 keyval = multihash->hashkeyval(multihash->
userptr, key);
2075 if( *multihashlist ==
NULL )
2077 unsigned int hashval;
2080 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2082 *multihashlist = multihash->
lists[hashval];
2086 multihash->hashkeyval, multihash->
userptr, keyval, key);
2097 unsigned int hashval;
2099 assert(multihash !=
NULL);
2101 assert(multihash->
nlists > 0);
2102 assert(multihash->hashgetkey !=
NULL);
2103 assert(multihash->hashkeyeq !=
NULL);
2104 assert(multihash->hashkeyval !=
NULL);
2105 assert(element !=
NULL);
2108 key = multihash->hashgetkey(multihash->
userptr, element);
2109 keyval = multihash->hashkeyval(multihash->
userptr, key);
2110 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2113 multihash->hashkeyval, multihash->
userptr, keyval, key) !=
NULL);
2124 unsigned int hashval;
2126 assert(multihash !=
NULL);
2128 assert(multihash->
nlists > 0);
2129 assert(multihash->hashgetkey !=
NULL);
2130 assert(multihash->hashkeyeq !=
NULL);
2131 assert(multihash->hashkeyval !=
NULL);
2132 assert(element !=
NULL);
2135 key = multihash->hashgetkey(multihash->
userptr, element);
2136 keyval = multihash->hashkeyval(multihash->
userptr, key);
2137 hashval = (
unsigned int) (keyval % (
unsigned) multihash->
nlists);
2159 assert(multihash !=
NULL);
2161 blkmem = multihash->
blkmem;
2162 lists = multihash->
lists;
2165 for( i = multihash->
nlists - 1; i >= 0; --i )
2176 assert(multihash !=
NULL);
2186 assert(multihash !=
NULL);
2204 assert(multihash !=
NULL);
2209 for( i = 0; i < multihash->
nlists; ++i )
2211 multihashlist = multihash->
lists[i];
2212 if( multihashlist !=
NULL )
2216 while( multihashlist !=
NULL )
2219 multihashlist = multihashlist->
next;
2221 maxslotsize =
MAX(maxslotsize, slotsize);
2222 sumslotsize += slotsize;
2225 assert(sumslotsize == multihash->
nelements);
2227 SCIPmessagePrintInfo(messagehdlr,
"%" SCIP_LONGINT_FORMAT
" multihash entries, used %d/%d slots (%.1f%%)",
2246 unsigned int nslots;
2251 assert(tablesize >= 0);
2252 assert(hashtable !=
NULL);
2253 assert(hashgetkey !=
NULL);
2254 assert(hashkeyeq !=
NULL);
2255 assert(hashkeyval !=
NULL);
2256 assert(blkmem !=
NULL);
2265 (*hashtable)->shift = 32;
2266 (*hashtable)->shift -= (
unsigned int)ceil(LOG2(
MAX(32.0, tablesize / 0.9)));
2269 nslots = 1u << (32 - (*hashtable)->shift);
2272 (*hashtable)->mask = nslots - 1;
2275 (*hashtable)->blkmem = blkmem;
2276 (*hashtable)->hashgetkey = hashgetkey;
2277 (*hashtable)->hashkeyeq = hashkeyeq;
2278 (*hashtable)->hashkeyval = hashkeyval;
2279 (*hashtable)->userptr = userptr;
2280 (*hashtable)->nelements = 0;
2293 assert(hashtable !=
NULL);
2294 assert(*hashtable !=
NULL);
2296 nslots = (*hashtable)->
mask + 1;
2299 uint32_t maxprobelen = 0;
2300 uint64_t probelensum = 0;
2303 assert(table !=
NULL);
2305 for( i = 0; i < nslots; ++i )
2307 if( table->
hashes[i] != 0 )
2309 uint32_t probelen = ((i + table->
mask + 1 - (table->
hashes[i]>>(table->
shift))) & table->
mask) + 1;
2310 probelensum += probelen;
2311 maxprobelen =
MAX(probelen, maxprobelen);
2316 (
unsigned int)table->
nelements, (
unsigned int)table->
nelements, (
unsigned int)nslots,
2346 #define ELEM_DISTANCE(pos) (((pos) + hashtable->mask + 1 - (hashtable->hashes[(pos)]>>(hashtable->shift))) & hashtable->mask) 2358 uint32_t elemdistance;
2364 assert(hashtable !=
NULL);
2367 assert(hashtable->
mask > 0);
2368 assert(hashtable->hashgetkey !=
NULL);
2369 assert(hashtable->hashkeyeq !=
NULL);
2370 assert(hashtable->hashkeyval !=
NULL);
2371 assert(element !=
NULL);
2373 pos = hashval>>(hashtable->
shift);
2380 if( hashtable->
hashes[pos] == 0 )
2382 hashtable->
slots[pos] = element;
2383 hashtable->
hashes[pos] = hashval;
2388 if( hashtable->
hashes[pos] == hashval && hashtable->hashkeyeq(hashtable->
userptr,
2389 hashtable->hashgetkey(hashtable->
userptr, hashtable->
slots[pos]), key) )
2396 hashtable->
slots[pos] = element;
2397 hashtable->
hashes[pos] = hashval;
2408 if( distance < elemdistance )
2413 elemdistance = distance;
2416 hashval = hashtable->
hashes[pos];
2417 hashtable->
hashes[pos] = tmp;
2418 key = hashtable->hashgetkey(hashtable->
userptr, element);
2427 pos = (pos + 1) & hashtable->
mask;
2438 assert(hashtable !=
NULL);
2439 assert(hashtable->
shift < 32);
2442 if( ((((uint64_t)hashtable->
nelements)<<10)>>(32-hashtable->
shift) > 921) )
2451 nslots = hashtable->
mask + 1;
2452 newnslots = 2*nslots;
2453 hashtable->
mask = newnslots-1;
2465 for( i = 0; i < nslots; ++i )
2470 if( hashes[i] != 0 )
2496 assert(hashtable !=
NULL);
2499 assert(hashtable->
mask > 0);
2500 assert(hashtable->hashgetkey !=
NULL);
2501 assert(hashtable->hashkeyeq !=
NULL);
2502 assert(hashtable->hashkeyval !=
NULL);
2503 assert(element !=
NULL);
2508 key = hashtable->hashgetkey(hashtable->
userptr, element);
2509 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2528 assert(hashtable !=
NULL);
2531 assert(hashtable->
mask > 0);
2532 assert(hashtable->hashgetkey !=
NULL);
2533 assert(hashtable->hashkeyeq !=
NULL);
2534 assert(hashtable->hashkeyval !=
NULL);
2535 assert(element !=
NULL);
2540 key = hashtable->hashgetkey(hashtable->
userptr, element);
2541 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2556 uint32_t elemdistance;
2558 assert(hashtable !=
NULL);
2561 assert(hashtable->
mask > 0);
2562 assert(hashtable->hashgetkey !=
NULL);
2563 assert(hashtable->hashkeyeq !=
NULL);
2564 assert(hashtable->hashkeyval !=
NULL);
2565 assert(key !=
NULL);
2568 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2571 pos = hashval>>(hashtable->
shift);
2579 if( hashtable->
hashes[pos] == 0 )
2585 if( elemdistance > distance )
2589 if( hashtable->
hashes[pos] == hashval && hashtable->hashkeyeq(hashtable->
userptr,
2590 hashtable->hashgetkey(hashtable->
userptr, hashtable->
slots[pos]), key) )
2591 return hashtable->
slots[pos];
2593 pos = (pos + 1) & hashtable->
mask;
2604 assert(hashtable !=
NULL);
2607 assert(hashtable->
mask > 0);
2608 assert(hashtable->hashgetkey !=
NULL);
2609 assert(hashtable->hashkeyeq !=
NULL);
2610 assert(hashtable->hashkeyval !=
NULL);
2611 assert(element !=
NULL);
2625 uint32_t elemdistance;
2629 assert(hashtable !=
NULL);
2632 assert(hashtable->
mask > 0);
2633 assert(hashtable->hashgetkey !=
NULL);
2634 assert(hashtable->hashkeyeq !=
NULL);
2635 assert(hashtable->hashkeyval !=
NULL);
2636 assert(element !=
NULL);
2639 key = hashtable->hashgetkey(hashtable->
userptr, element);
2640 keyval = hashtable->hashkeyval(hashtable->
userptr, key);
2644 pos = hashval>>(hashtable->
shift);
2648 if( hashtable->
hashes[pos] == 0 )
2654 if( elemdistance > distance )
2657 if( hashtable->
hashes[pos] == hashval && hashtable->hashkeyeq(hashtable->
userptr,
2658 hashtable->hashgetkey(hashtable->
userptr, hashtable->
slots[pos]), key) )
2664 pos = (pos + 1) & hashtable->
mask;
2669 hashtable->
hashes[pos] = 0;
2673 uint32_t nextpos = (pos + 1) & hashtable->
mask;
2676 if( hashtable->
hashes[nextpos] == 0 )
2680 if( (hashtable->
hashes[nextpos]>>(hashtable->
shift)) == nextpos )
2684 hashtable->
slots[pos] = hashtable->
slots[nextpos];
2686 hashtable->
hashes[nextpos] = 0;
2699 assert(hashtable !=
NULL);
2711 assert(hashtable !=
NULL);
2721 return (
int) hashtable->
mask + 1;
2730 return hashtable->
hashes[entryidx] == 0 ?
NULL : hashtable->
slots[entryidx];
2738 assert(hashtable !=
NULL);
2749 uint32_t maxprobelen = 0;
2750 uint64_t probelensum = 0;
2754 assert(hashtable !=
NULL);
2756 nslots = hashtable->
mask + 1;
2759 for( i = 0; i < nslots; ++i )
2761 if( hashtable->
hashes[i] != 0 )
2764 probelensum += probelen;
2765 maxprobelen =
MAX(probelen, maxprobelen);
2784 const char* string1 = (
const char*)key1;
2785 const char* string2 = (
const char*)key2;
2787 return (strcmp(string1, string2) == 0);
2796 str = (
const char*)
key;
2798 while( *str !=
'\0' )
2801 hash += (
unsigned int)(*str);
2819 return (key1 == key2);
2826 return (uint64_t) (uintptr_t)
key;
2836 #undef ELEM_DISTANCE 2838 #define ELEM_DISTANCE(pos) (((pos) + hashmap->mask + 1 - (hashmap->hashes[(pos)]>>(hashmap->shift))) & hashmap->mask) 2850 uint32_t elemdistance;
2853 assert(hashmap !=
NULL);
2856 assert(hashmap->
mask > 0);
2857 assert(hashval != 0);
2859 pos = hashval>>(hashmap->
shift);
2866 if( hashmap->
hashes[pos] == 0 )
2870 hashmap->
hashes[pos] = hashval;
2881 hashmap->
hashes[pos] = hashval;
2892 if( distance < elemdistance )
2898 elemdistance = distance;
2900 hashval = hashmap->
hashes[pos];
2901 hashmap->
hashes[pos] = tmphash;
2909 pos = (pos + 1) & hashmap->
mask;
2925 uint32_t elemdistance;
2927 assert(hashmap !=
NULL);
2930 assert(hashmap->
mask > 0);
2934 assert(hashval != 0);
2936 *pos = hashval>>(hashmap->
shift);
2944 if( hashmap->
hashes[*pos] == 0 )
2949 if( elemdistance > distance )
2956 *pos = (*pos + 1) & hashmap->
mask;
2967 assert(hashmap !=
NULL);
2968 assert(hashmap->
shift < 32);
2971 if( ((((uint64_t)hashmap->
nelements)<<10)>>(32-hashmap->
shift) > 921) )
2980 nslots = hashmap->
mask + 1;
2982 newnslots = 2*nslots;
2983 hashmap->
mask = newnslots-1;
2994 for( i = 0; i < nslots; ++i )
2999 if( hashes[i] != 0 )
3022 assert(hashmap !=
NULL);
3023 assert(mapsize >= 0);
3024 assert(blkmem !=
NULL);
3033 (*hashmap)->shift = 32;
3034 (*hashmap)->shift -= (
unsigned int)ceil(
log(
MAX(32, mapsize / 0.9)) /
log(2.0));
3035 nslots = 1u << (32 - (*hashmap)->shift);
3036 (*hashmap)->mask = nslots - 1;
3037 (*hashmap)->blkmem = blkmem;
3038 (*hashmap)->nelements = 0;
3054 assert(hashmap !=
NULL);
3055 assert(*hashmap !=
NULL);
3057 nslots = (*hashmap)->mask + 1;
3060 uint32_t maxprobelen = 0;
3061 uint64_t probelensum = 0;
3064 assert(hashmap !=
NULL);
3066 for( i = 0; i < nslots; ++i )
3068 if( (*hashmap)->hashes[i] != 0 )
3070 uint32_t probelen = ((i + (*hashmap)->mask + 1 - ((*hashmap)->hashes[i]>>((*hashmap)->shift))) & (*hashmap)->mask) + 1;
3071 probelensum += probelen;
3072 maxprobelen =
MAX(probelen, maxprobelen);
3077 (
unsigned int)(*hashmap)->nelements, (
unsigned int)(*hashmap)->nelements, (
unsigned int)nslots,
3079 if( (*hashmap)->nelements > 0 )
3080 SCIPdebugPrintf(
", avg. probe length is %.1f, max. probe length is %u",
3081 (
SCIP_Real)(probelensum)/(
SCIP_Real)(*hashmap)->nelements, (
unsigned int)maxprobelen);
3105 assert(hashmap !=
NULL);
3108 assert(hashmap->
mask > 0);
3141 assert(hashmap !=
NULL);
3144 assert(hashmap->
mask > 0);
3177 assert(hashmap !=
NULL);
3180 assert(hashmap->
mask > 0);
3208 assert(hashmap !=
NULL);
3211 assert(hashmap->
mask > 0);
3228 assert(hashmap !=
NULL);
3231 assert(hashmap->
mask > 0);
3248 assert(hashmap !=
NULL);
3251 assert(hashmap->
mask > 0);
3272 assert(hashmap !=
NULL);
3274 assert(hashmap->
mask > 0);
3306 assert(hashmap !=
NULL);
3308 assert(hashmap->
mask > 0);
3340 assert(hashmap !=
NULL);
3342 assert(hashmap->
mask > 0);
3370 assert(hashmap !=
NULL);
3373 assert(hashmap->
mask > 0);
3386 assert(hashmap !=
NULL);
3388 assert(hashmap->
mask > 0);
3390 assert(origin !=
NULL);
3395 hashmap->
hashes[pos] = 0;
3401 uint32_t nextpos = (pos + 1) & hashmap->
mask;
3404 if( hashmap->
hashes[nextpos] == 0 )
3408 if( (hashmap->
hashes[nextpos]>>(hashmap->
shift)) == nextpos )
3415 hashmap->
hashes[nextpos] = 0;
3430 uint32_t maxprobelen = 0;
3431 uint64_t probelensum = 0;
3435 assert(hashmap !=
NULL);
3437 nslots = hashmap->
mask + 1;
3440 for( i = 0; i < nslots; ++i )
3442 if( hashmap->
hashes[i] != 0 )
3445 probelensum += probelen;
3446 maxprobelen =
MAX(probelen, maxprobelen);
3467 assert(hashmap !=
NULL);
3485 return (
int) hashmap->
mask + 1;
3494 assert(hashmap !=
NULL);
3496 return hashmap->
hashes[entryidx] == 0 ?
NULL : &hashmap->
slots[entryidx];
3504 assert(entry !=
NULL);
3514 assert(entry !=
NULL);
3524 assert(entry !=
NULL);
3534 assert(entry !=
NULL);
3545 assert(entry !=
NULL);
3556 assert(entry !=
NULL);
3567 assert(entry !=
NULL);
3577 assert(hashmap !=
NULL);
3592 #undef ELEM_DISTANCE 3594 #define ELEM_DISTANCE(pos) (((pos) + nslots - hashSetDesiredPos(hashset, hashset->slots[(pos)])) & mask) 3603 return (uint32_t)((UINT64_C(0x9e3779b97f4a7c15) * (uintptr_t)element)>>(hashset->
shift));
3612 uint32_t elemdistance;
3617 assert(hashset !=
NULL);
3619 assert(element !=
NULL);
3633 hashset->
slots[pos] = element;
3638 if( hashset->
slots[pos] == element )
3643 if( distance < elemdistance )
3646 elemdistance = distance;
3651 pos = (pos + 1) & mask;
3663 assert(hashset !=
NULL);
3664 assert(hashset->
shift < 64);
3667 if( ((((uint64_t)hashset->
nelements)<<10)>>(64-hashset->
shift) > 921) )
3676 newnslots = 2*nslots;
3686 for( i = 0; i < nslots; ++i )
3688 if( slots[i] !=
NULL )
3708 assert(hashset !=
NULL);
3710 assert(blkmem !=
NULL);
3719 (*hashset)->shift = 64;
3720 (*hashset)->shift -= (
unsigned int)ceil(
log(
MAX(8.0, size / 0.9)) /
log(2.0));
3722 (*hashset)->nelements = 0;
3746 assert(hashset !=
NULL);
3765 uint32_t elemdistance;
3767 assert(hashset !=
NULL);
3780 if( hashset->
slots[pos] == element )
3789 if( elemdistance > distance )
3792 pos = (pos + 1) & mask;
3806 uint32_t elemdistance;
3808 assert(hashset !=
NULL);
3810 assert(element !=
NULL);
3822 if( hashset->
slots[pos] == element )
3831 if( elemdistance > distance )
3834 pos = (pos + 1) & mask;
3838 assert(hashset->
slots[pos] == element);
3847 uint32_t nextpos = (pos + 1) & mask;
3866 hashset->
slots[pos] = hashset->
slots[nextpos];
3878 uint32_t maxprobelen = 0;
3879 uint64_t probelensum = 0;
3884 assert(hashset !=
NULL);
3890 for( i = 0; i < nslots; ++i )
3895 probelensum += probelen;
3896 maxprobelen =
MAX(probelen, maxprobelen);
3918 #undef SCIPhashsetIsEmpty 3919 #undef SCIPhashsetGetNElements 3920 #undef SCIPhashsetGetNSlots 3921 #undef SCIPhashsetGetSlots 3944 return (
int) (1u << (64 - hashset->
shift));
3952 return hashset->
slots;
3975 assert(realarray !=
NULL);
3976 assert(blkmem !=
NULL);
3979 (*realarray)->blkmem = blkmem;
3980 (*realarray)->vals =
NULL;
3981 (*realarray)->valssize = 0;
3982 (*realarray)->firstidx = -1;
3983 (*realarray)->minusedidx = INT_MAX;
3984 (*realarray)->maxusedidx = INT_MIN;
3996 assert(realarray !=
NULL);
3997 assert(sourcerealarray !=
NULL);
4000 if( sourcerealarray->
valssize > 0 )
4005 (*realarray)->valssize = sourcerealarray->
valssize;
4006 (*realarray)->firstidx = sourcerealarray->
firstidx;
4007 (*realarray)->minusedidx = sourcerealarray->
minusedidx;
4008 (*realarray)->maxusedidx = sourcerealarray->
maxusedidx;
4018 assert(realarray !=
NULL);
4019 assert(*realarray !=
NULL);
4041 assert(realarray !=
NULL);
4046 assert(0 <= minidx);
4047 assert(minidx <= maxidx);
4051 assert(0 <= minidx);
4052 assert(minidx <= maxidx);
4054 SCIPdebugMessage(
"extending realarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
4055 (
void*)realarray, realarray->
firstidx, realarray->valssize, realarray->minusedidx, realarray->maxusedidx, minidx, maxidx);
4058 nused = maxidx - minidx + 1;
4059 if( nused > realarray->valssize )
4065 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
4067 nfree = newvalssize - nused;
4068 newfirstidx = minidx - nfree/2;
4069 newfirstidx =
MAX(newfirstidx, 0);
4070 assert(newfirstidx <= minidx);
4071 assert(maxidx < newfirstidx + newvalssize);
4074 if( realarray->firstidx != -1 )
4076 for( i = 0; i < realarray->minusedidx - newfirstidx; ++i )
4080 assert(realarray->maxusedidx - realarray->minusedidx + 1 > 0);
4083 &(realarray->vals[realarray->minusedidx - realarray->firstidx]),
4084 realarray->maxusedidx - realarray->minusedidx + 1);
4085 for( i = realarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
4090 for( i = 0; i < newvalssize; ++i )
4096 realarray->vals = newvals;
4097 realarray->valssize = newvalssize;
4098 realarray->firstidx = newfirstidx;
4100 else if( realarray->firstidx == -1 )
4103 nfree = realarray->valssize - nused;
4105 realarray->firstidx = minidx - nfree/2;
4106 assert(realarray->firstidx <= minidx);
4107 assert(maxidx < realarray->firstidx + realarray->valssize);
4109 for( i = 0; i < realarray->valssize; ++i )
4110 assert(realarray->vals[i] == 0.0);
4113 else if( minidx < realarray->firstidx )
4116 nfree = realarray->valssize - nused;
4118 newfirstidx = minidx - nfree/2;
4119 newfirstidx =
MAX(newfirstidx, 0);
4120 assert(newfirstidx <= minidx);
4121 assert(maxidx < newfirstidx + realarray->valssize);
4123 if( realarray->minusedidx <= realarray->maxusedidx )
4127 assert(realarray->firstidx <= realarray->minusedidx);
4128 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4131 shift = realarray->firstidx - newfirstidx;
4133 for( i = realarray->maxusedidx - realarray->firstidx; i >= realarray->minusedidx - realarray->firstidx; --i )
4135 assert(0 <= i + shift && i + shift < realarray->valssize);
4136 realarray->vals[i + shift] = realarray->vals[i];
4139 for( i = 0; i < shift; ++i )
4140 realarray->vals[realarray->minusedidx - realarray->firstidx + i] = 0.0;
4142 realarray->firstidx = newfirstidx;
4144 else if( maxidx >= realarray->firstidx + realarray->valssize )
4147 nfree = realarray->valssize - nused;
4149 newfirstidx = minidx - nfree/2;
4150 newfirstidx =
MAX(newfirstidx, 0);
4151 assert(newfirstidx <= minidx);
4152 assert(maxidx < newfirstidx + realarray->valssize);
4154 if( realarray->minusedidx <= realarray->maxusedidx )
4158 assert(realarray->firstidx <= realarray->minusedidx);
4159 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4162 shift = newfirstidx - realarray->firstidx;
4164 for( i = realarray->minusedidx - realarray->firstidx; i <= realarray->maxusedidx - realarray->firstidx; ++i )
4166 assert(0 <= i - shift && i - shift < realarray->valssize);
4167 realarray->vals[i - shift] = realarray->vals[i];
4170 for( i = 0; i < shift; ++i )
4171 realarray->vals[realarray->maxusedidx - realarray->firstidx - i] = 0.0;
4173 realarray->firstidx = newfirstidx;
4176 assert(minidx >= realarray->firstidx);
4177 assert(maxidx < realarray->firstidx + realarray->valssize);
4187 assert(realarray !=
NULL);
4189 SCIPdebugMessage(
"clearing realarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
4190 (
void*)realarray, realarray->
firstidx, realarray->valssize, realarray->minusedidx, realarray->maxusedidx);
4192 if( realarray->minusedidx <= realarray->maxusedidx )
4194 assert(realarray->firstidx <= realarray->minusedidx);
4195 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4196 assert(realarray->firstidx != -1);
4197 assert(realarray->valssize > 0);
4201 realarray->maxusedidx - realarray->minusedidx + 1);
4204 realarray->minusedidx = INT_MAX;
4205 realarray->maxusedidx = INT_MIN;
4207 assert(realarray->minusedidx == INT_MAX);
4208 assert(realarray->maxusedidx == INT_MIN);
4219 assert(realarray !=
NULL);
4222 if( idx < realarray->minusedidx || idx > realarray->
maxusedidx )
4227 assert(idx - realarray->
firstidx >= 0);
4243 assert(realarray !=
NULL);
4246 SCIPdebugMessage(
"setting realarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %g\n",
4247 (
void*)realarray, realarray->
firstidx, realarray->valssize, realarray->minusedidx, realarray->maxusedidx, idx, val);
4253 assert(idx >= realarray->firstidx);
4254 assert(idx < realarray->firstidx + realarray->valssize);
4257 realarray->vals[idx - realarray->firstidx] = val;
4260 realarray->minusedidx = MIN(realarray->minusedidx, idx);
4261 realarray->maxusedidx =
MAX(realarray->maxusedidx, idx);
4263 else if( idx >= realarray->firstidx && idx < realarray->firstidx + realarray->valssize )
4266 realarray->vals[idx - realarray->firstidx] = 0.0;
4269 if( idx == realarray->minusedidx )
4271 assert(realarray->maxusedidx >= 0);
4272 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4275 realarray->minusedidx++;
4277 while( realarray->minusedidx <= realarray->maxusedidx
4278 && realarray->vals[realarray->minusedidx - realarray->firstidx] == 0.0 );
4280 if( realarray->minusedidx > realarray->maxusedidx )
4282 realarray->minusedidx = INT_MAX;
4283 realarray->maxusedidx = INT_MIN;
4286 else if( idx == realarray->maxusedidx )
4288 assert(realarray->minusedidx >= 0);
4289 assert(realarray->minusedidx < realarray->maxusedidx);
4290 assert(realarray->maxusedidx < realarray->firstidx + realarray->valssize);
4293 realarray->maxusedidx--;
4294 assert(realarray->minusedidx <= realarray->maxusedidx);
4296 while( realarray->vals[realarray->maxusedidx - realarray->firstidx] == 0.0 );
4326 assert(realarray !=
NULL);
4336 assert(realarray !=
NULL);
4347 assert(intarray !=
NULL);
4348 assert(blkmem !=
NULL);
4351 (*intarray)->blkmem = blkmem;
4352 (*intarray)->vals =
NULL;
4353 (*intarray)->valssize = 0;
4354 (*intarray)->firstidx = -1;
4355 (*intarray)->minusedidx = INT_MAX;
4356 (*intarray)->maxusedidx = INT_MIN;
4368 assert(intarray !=
NULL);
4369 assert(sourceintarray !=
NULL);
4376 (*intarray)->valssize = sourceintarray->
valssize;
4377 (*intarray)->firstidx = sourceintarray->
firstidx;
4378 (*intarray)->minusedidx = sourceintarray->
minusedidx;
4379 (*intarray)->maxusedidx = sourceintarray->
maxusedidx;
4389 assert(intarray !=
NULL);
4390 assert(*intarray !=
NULL);
4412 assert(intarray !=
NULL);
4417 assert(0 <= minidx);
4418 assert(minidx <= maxidx);
4422 assert(0 <= minidx);
4423 assert(minidx <= maxidx);
4425 SCIPdebugMessage(
"extending intarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
4426 (
void*)intarray, intarray->
firstidx, intarray->valssize, intarray->minusedidx, intarray->maxusedidx, minidx, maxidx);
4429 nused = maxidx - minidx + 1;
4430 if( nused > intarray->valssize )
4436 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
4438 nfree = newvalssize - nused;
4439 newfirstidx = minidx - nfree/2;
4440 newfirstidx =
MAX(newfirstidx, 0);
4441 assert(newfirstidx <= minidx);
4442 assert(maxidx < newfirstidx + newvalssize);
4445 if( intarray->firstidx != -1 )
4447 for( i = 0; i < intarray->minusedidx - newfirstidx; ++i )
4451 assert(intarray->maxusedidx - intarray->minusedidx + 1 > 0);
4454 &intarray->vals[intarray->minusedidx - intarray->firstidx],
4455 intarray->maxusedidx - intarray->minusedidx + 1);
4456 for( i = intarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
4461 for( i = 0; i < newvalssize; ++i )
4467 intarray->vals = newvals;
4468 intarray->valssize = newvalssize;
4469 intarray->firstidx = newfirstidx;
4471 else if( intarray->firstidx == -1 )
4474 nfree = intarray->valssize - nused;
4476 intarray->firstidx = minidx - nfree/2;
4477 assert(intarray->firstidx <= minidx);
4478 assert(maxidx < intarray->firstidx + intarray->valssize);
4480 for( i = 0; i < intarray->valssize; ++i )
4481 assert(intarray->vals[i] == 0);
4484 else if( minidx < intarray->firstidx )
4487 nfree = intarray->valssize - nused;
4489 newfirstidx = minidx - nfree/2;
4490 newfirstidx =
MAX(newfirstidx, 0);
4491 assert(newfirstidx <= minidx);
4492 assert(maxidx < newfirstidx + intarray->valssize);
4494 if( intarray->minusedidx <= intarray->maxusedidx )
4498 assert(intarray->firstidx <= intarray->minusedidx);
4499 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4502 shift = intarray->firstidx - newfirstidx;
4504 for( i = intarray->maxusedidx - intarray->firstidx; i >= intarray->minusedidx - intarray->firstidx; --i )
4506 assert(0 <= i + shift && i + shift < intarray->valssize);
4507 intarray->vals[i + shift] = intarray->vals[i];
4510 for( i = 0; i < shift; ++i )
4511 intarray->vals[intarray->minusedidx - intarray->firstidx + i] = 0;
4513 intarray->firstidx = newfirstidx;
4515 else if( maxidx >= intarray->firstidx + intarray->valssize )
4518 nfree = intarray->valssize - nused;
4520 newfirstidx = minidx - nfree/2;
4521 newfirstidx =
MAX(newfirstidx, 0);
4522 assert(newfirstidx <= minidx);
4523 assert(maxidx < newfirstidx + intarray->valssize);
4525 if( intarray->minusedidx <= intarray->maxusedidx )
4529 assert(intarray->firstidx <= intarray->minusedidx);
4530 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4533 shift = newfirstidx - intarray->firstidx;
4535 for( i = intarray->minusedidx - intarray->firstidx; i <= intarray->maxusedidx - intarray->firstidx; ++i )
4537 assert(0 <= i - shift && i - shift < intarray->valssize);
4538 intarray->vals[i - shift] = intarray->vals[i];
4541 for( i = 0; i < shift; ++i )
4542 intarray->vals[intarray->maxusedidx - intarray->firstidx - i] = 0;
4544 intarray->firstidx = newfirstidx;
4547 assert(minidx >= intarray->firstidx);
4548 assert(maxidx < intarray->firstidx + intarray->valssize);
4558 assert(intarray !=
NULL);
4560 SCIPdebugMessage(
"clearing intarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
4561 (
void*)intarray, intarray->
firstidx, intarray->valssize, intarray->minusedidx, intarray->maxusedidx);
4563 if( intarray->minusedidx <= intarray->maxusedidx )
4565 assert(intarray->firstidx <= intarray->minusedidx);
4566 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4567 assert(intarray->firstidx != -1);
4568 assert(intarray->valssize > 0);
4572 intarray->maxusedidx - intarray->minusedidx + 1);
4575 intarray->minusedidx = INT_MAX;
4576 intarray->maxusedidx = INT_MIN;
4578 assert(intarray->minusedidx == INT_MAX);
4579 assert(intarray->maxusedidx == INT_MIN);
4590 assert(intarray !=
NULL);
4593 if( idx < intarray->minusedidx || idx > intarray->
maxusedidx )
4598 assert(idx - intarray->
firstidx >= 0);
4614 assert(intarray !=
NULL);
4617 SCIPdebugMessage(
"setting intarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %d\n",
4618 (
void*)intarray, intarray->
firstidx, intarray->valssize, intarray->minusedidx, intarray->maxusedidx, idx, val);
4624 assert(idx >= intarray->firstidx);
4625 assert(idx < intarray->firstidx + intarray->valssize);
4628 intarray->vals[idx - intarray->firstidx] = val;
4631 intarray->minusedidx = MIN(intarray->minusedidx, idx);
4632 intarray->maxusedidx =
MAX(intarray->maxusedidx, idx);
4634 else if( idx >= intarray->firstidx && idx < intarray->firstidx + intarray->valssize )
4637 intarray->vals[idx - intarray->firstidx] = 0;
4640 if( idx == intarray->minusedidx )
4642 assert(intarray->maxusedidx >= 0);
4643 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4646 intarray->minusedidx++;
4648 while( intarray->minusedidx <= intarray->maxusedidx
4649 && intarray->vals[intarray->minusedidx - intarray->firstidx] == 0 );
4650 if( intarray->minusedidx > intarray->maxusedidx )
4652 intarray->minusedidx = INT_MAX;
4653 intarray->maxusedidx = INT_MIN;
4656 else if( idx == intarray->maxusedidx )
4658 assert(intarray->minusedidx >= 0);
4659 assert(intarray->minusedidx < intarray->maxusedidx);
4660 assert(intarray->maxusedidx < intarray->firstidx + intarray->valssize);
4663 intarray->maxusedidx--;
4664 assert(intarray->minusedidx <= intarray->maxusedidx);
4666 while( intarray->vals[intarray->maxusedidx - intarray->firstidx] == 0 );
4690 assert(intarray !=
NULL);
4700 assert(intarray !=
NULL);
4712 assert(boolarray !=
NULL);
4713 assert(blkmem !=
NULL);
4716 (*boolarray)->blkmem = blkmem;
4717 (*boolarray)->vals =
NULL;
4718 (*boolarray)->valssize = 0;
4719 (*boolarray)->firstidx = -1;
4720 (*boolarray)->minusedidx = INT_MAX;
4721 (*boolarray)->maxusedidx = INT_MIN;
4733 assert(boolarray !=
NULL);
4734 assert(sourceboolarray !=
NULL);
4737 if( sourceboolarray->
valssize > 0 )
4742 (*boolarray)->valssize = sourceboolarray->
valssize;
4743 (*boolarray)->firstidx = sourceboolarray->
firstidx;
4744 (*boolarray)->minusedidx = sourceboolarray->
minusedidx;
4745 (*boolarray)->maxusedidx = sourceboolarray->
maxusedidx;
4755 assert(boolarray !=
NULL);
4756 assert(*boolarray !=
NULL);
4778 assert(boolarray !=
NULL);
4783 assert(0 <= minidx);
4784 assert(minidx <= maxidx);
4788 assert(0 <= minidx);
4789 assert(minidx <= maxidx);
4791 SCIPdebugMessage(
"extending boolarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
4792 (
void*)boolarray, boolarray->
firstidx, boolarray->valssize, boolarray->minusedidx, boolarray->maxusedidx, minidx, maxidx);
4795 nused = maxidx - minidx + 1;
4796 if( nused > boolarray->valssize )
4802 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
4804 nfree = newvalssize - nused;
4805 newfirstidx = minidx - nfree/2;
4806 newfirstidx =
MAX(newfirstidx, 0);
4807 assert(newfirstidx <= minidx);
4808 assert(maxidx < newfirstidx + newvalssize);
4811 if( boolarray->firstidx != -1 )
4813 for( i = 0; i < boolarray->minusedidx - newfirstidx; ++i )
4817 assert(boolarray->maxusedidx - boolarray->minusedidx + 1 > 0);
4820 &boolarray->vals[boolarray->minusedidx - boolarray->firstidx],
4821 boolarray->maxusedidx - boolarray->minusedidx + 1);
4822 for( i = boolarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
4827 for( i = 0; i < newvalssize; ++i )
4833 boolarray->vals = newvals;
4834 boolarray->valssize = newvalssize;
4835 boolarray->firstidx = newfirstidx;
4837 else if( boolarray->firstidx == -1 )
4840 nfree = boolarray->valssize - nused;
4842 boolarray->firstidx = minidx - nfree/2;
4843 assert(boolarray->firstidx <= minidx);
4844 assert(maxidx < boolarray->firstidx + boolarray->valssize);
4846 for( i = 0; i < boolarray->valssize; ++i )
4847 assert(boolarray->vals[i] ==
FALSE);
4850 else if( minidx < boolarray->firstidx )
4853 nfree = boolarray->valssize - nused;
4855 newfirstidx = minidx - nfree/2;
4856 newfirstidx =
MAX(newfirstidx, 0);
4857 assert(newfirstidx <= minidx);
4858 assert(maxidx < newfirstidx + boolarray->valssize);
4860 if( boolarray->minusedidx <= boolarray->maxusedidx )
4864 assert(boolarray->firstidx <= boolarray->minusedidx);
4865 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4868 shift = boolarray->firstidx - newfirstidx;
4870 for( i = boolarray->maxusedidx - boolarray->firstidx; i >= boolarray->minusedidx - boolarray->firstidx; --i )
4872 assert(0 <= i + shift && i + shift < boolarray->valssize);
4873 boolarray->vals[i + shift] = boolarray->vals[i];
4876 for( i = 0; i < shift; ++i )
4877 boolarray->vals[boolarray->minusedidx - boolarray->firstidx + i] =
FALSE;
4879 boolarray->firstidx = newfirstidx;
4881 else if( maxidx >= boolarray->firstidx + boolarray->valssize )
4884 nfree = boolarray->valssize - nused;
4886 newfirstidx = minidx - nfree/2;
4887 newfirstidx =
MAX(newfirstidx, 0);
4888 assert(newfirstidx <= minidx);
4889 assert(maxidx < newfirstidx + boolarray->valssize);
4891 if( boolarray->minusedidx <= boolarray->maxusedidx )
4895 assert(boolarray->firstidx <= boolarray->minusedidx);
4896 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4899 shift = newfirstidx - boolarray->firstidx;
4902 assert(0 <= boolarray->minusedidx - boolarray->firstidx - shift);
4903 assert(boolarray->maxusedidx - boolarray->firstidx - shift < boolarray->valssize);
4904 BMSmoveMemoryArray(&(boolarray->vals[boolarray->minusedidx - boolarray->firstidx - shift]),
4905 &(boolarray->vals[boolarray->minusedidx - boolarray->firstidx]),
4906 boolarray->maxusedidx - boolarray->minusedidx + 1);
4909 for( i = 0; i < shift; ++i )
4910 boolarray->vals[boolarray->maxusedidx - boolarray->firstidx - i] =
FALSE;
4912 boolarray->firstidx = newfirstidx;
4915 assert(minidx >= boolarray->firstidx);
4916 assert(maxidx < boolarray->firstidx + boolarray->valssize);
4926 assert(boolarray !=
NULL);
4928 SCIPdebugMessage(
"clearing boolarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
4929 (
void*)boolarray, boolarray->
firstidx, boolarray->valssize, boolarray->minusedidx, boolarray->maxusedidx);
4931 if( boolarray->minusedidx <= boolarray->maxusedidx )
4933 assert(boolarray->firstidx <= boolarray->minusedidx);
4934 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
4935 assert(boolarray->firstidx != -1);
4936 assert(boolarray->valssize > 0);
4940 boolarray->maxusedidx - boolarray->minusedidx + 1);
4943 boolarray->minusedidx = INT_MAX;
4944 boolarray->maxusedidx = INT_MIN;
4946 assert(boolarray->minusedidx == INT_MAX);
4947 assert(boolarray->maxusedidx == INT_MIN);
4958 assert(boolarray !=
NULL);
4961 if( idx < boolarray->minusedidx || idx > boolarray->
maxusedidx )
4966 assert(idx - boolarray->
firstidx >= 0);
4982 assert(boolarray !=
NULL);
4985 SCIPdebugMessage(
"setting boolarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %u\n",
4986 (
void*)boolarray, boolarray->
firstidx, boolarray->valssize, boolarray->minusedidx, boolarray->maxusedidx, idx, val);
4992 assert(idx >= boolarray->firstidx);
4993 assert(idx < boolarray->firstidx + boolarray->valssize);
4996 boolarray->vals[idx - boolarray->firstidx] = val;
4999 boolarray->minusedidx = MIN(boolarray->minusedidx, idx);
5000 boolarray->maxusedidx =
MAX(boolarray->maxusedidx, idx);
5002 else if( idx >= boolarray->firstidx && idx < boolarray->firstidx + boolarray->valssize )
5005 boolarray->vals[idx - boolarray->firstidx] =
FALSE;
5008 if( idx == boolarray->minusedidx )
5010 assert(boolarray->maxusedidx >= 0);
5011 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
5014 boolarray->minusedidx++;
5016 while( boolarray->minusedidx <= boolarray->maxusedidx
5017 && boolarray->vals[boolarray->minusedidx - boolarray->firstidx] ==
FALSE );
5018 if( boolarray->minusedidx > boolarray->maxusedidx )
5020 boolarray->minusedidx = INT_MAX;
5021 boolarray->maxusedidx = INT_MIN;
5024 else if( idx == boolarray->maxusedidx )
5026 assert(boolarray->minusedidx >= 0);
5027 assert(boolarray->minusedidx < boolarray->maxusedidx);
5028 assert(boolarray->maxusedidx < boolarray->firstidx + boolarray->valssize);
5031 boolarray->maxusedidx--;
5032 assert(boolarray->minusedidx <= boolarray->maxusedidx);
5034 while( boolarray->vals[boolarray->maxusedidx - boolarray->firstidx] ==
FALSE );
5046 assert(boolarray !=
NULL);
5056 assert(boolarray !=
NULL);
5068 assert(ptrarray !=
NULL);
5069 assert(blkmem !=
NULL);
5072 (*ptrarray)->blkmem = blkmem;
5073 (*ptrarray)->vals =
NULL;
5074 (*ptrarray)->valssize = 0;
5075 (*ptrarray)->firstidx = -1;
5076 (*ptrarray)->minusedidx = INT_MAX;
5077 (*ptrarray)->maxusedidx = INT_MIN;
5089 assert(ptrarray !=
NULL);
5090 assert(sourceptrarray !=
NULL);
5097 (*ptrarray)->valssize = sourceptrarray->
valssize;
5098 (*ptrarray)->firstidx = sourceptrarray->
firstidx;
5099 (*ptrarray)->minusedidx = sourceptrarray->
minusedidx;
5100 (*ptrarray)->maxusedidx = sourceptrarray->
maxusedidx;
5110 assert(ptrarray !=
NULL);
5111 assert(*ptrarray !=
NULL);
5133 assert(ptrarray !=
NULL);
5138 assert(0 <= minidx);
5139 assert(minidx <= maxidx);
5143 assert(0 <= minidx);
5144 assert(minidx <= maxidx);
5146 SCIPdebugMessage(
"extending ptrarray %p (firstidx=%d, size=%d, range=[%d,%d]) to range [%d,%d]\n",
5147 (
void*)ptrarray, ptrarray->
firstidx, ptrarray->valssize, ptrarray->minusedidx, ptrarray->maxusedidx, minidx, maxidx);
5150 nused = maxidx - minidx + 1;
5151 if( nused > ptrarray->valssize )
5157 newvalssize =
calcGrowSize(arraygrowinit, arraygrowfac, nused);
5159 nfree = newvalssize - nused;
5160 newfirstidx = minidx - nfree/2;
5161 newfirstidx =
MAX(newfirstidx, 0);
5162 assert(newfirstidx <= minidx);
5163 assert(maxidx < newfirstidx + newvalssize);
5166 if( ptrarray->firstidx != -1 )
5168 for( i = 0; i < ptrarray->minusedidx - newfirstidx; ++i )
5172 assert(ptrarray->maxusedidx - ptrarray->minusedidx + 1 > 0);
5175 &(ptrarray->vals[ptrarray->minusedidx - ptrarray->firstidx]),
5176 ptrarray->maxusedidx - ptrarray->minusedidx + 1);
5177 for( i = ptrarray->maxusedidx - newfirstidx + 1; i < newvalssize; ++i )
5182 for( i = 0; i < newvalssize; ++i )
5188 ptrarray->vals = newvals;
5189 ptrarray->valssize = newvalssize;
5190 ptrarray->firstidx = newfirstidx;
5192 else if( ptrarray->firstidx == -1 )
5195 nfree = ptrarray->valssize - nused;
5197 ptrarray->firstidx = minidx - nfree/2;
5198 assert(ptrarray->firstidx <= minidx);
5199 assert(maxidx < ptrarray->firstidx + ptrarray->valssize);
5201 for( i = 0; i < ptrarray->valssize; ++i )
5202 assert(ptrarray->vals[i] ==
NULL);
5205 else if( minidx < ptrarray->firstidx )
5208 nfree = ptrarray->valssize - nused;
5210 newfirstidx = minidx - nfree/2;
5211 newfirstidx =
MAX(newfirstidx, 0);
5212 assert(newfirstidx <= minidx);
5213 assert(maxidx < newfirstidx + ptrarray->valssize);
5215 if( ptrarray->minusedidx <= ptrarray->maxusedidx )
5219 assert(ptrarray->firstidx <= ptrarray->minusedidx);
5220 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5223 shift = ptrarray->firstidx - newfirstidx;
5225 for( i = ptrarray->maxusedidx - ptrarray->firstidx; i >= ptrarray->minusedidx - ptrarray->firstidx; --i )
5227 assert(0 <= i + shift && i + shift < ptrarray->valssize);
5228 ptrarray->vals[i + shift] = ptrarray->vals[i];
5231 for( i = 0; i < shift; ++i )
5232 ptrarray->vals[ptrarray->minusedidx - ptrarray->firstidx + i] =
NULL;
5234 ptrarray->firstidx = newfirstidx;
5236 else if( maxidx >= ptrarray->firstidx + ptrarray->valssize )
5239 nfree = ptrarray->valssize - nused;
5241 newfirstidx = minidx - nfree/2;
5242 newfirstidx =
MAX(newfirstidx, 0);
5243 assert(newfirstidx <= minidx);
5244 assert(maxidx < newfirstidx + ptrarray->valssize);
5246 if( ptrarray->minusedidx <= ptrarray->maxusedidx )
5250 assert(ptrarray->firstidx <= ptrarray->minusedidx);
5251 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5254 shift = newfirstidx - ptrarray->firstidx;
5256 for( i = ptrarray->minusedidx - ptrarray->firstidx; i <= ptrarray->maxusedidx - ptrarray->firstidx; ++i )
5258 assert(0 <= i - shift && i - shift < ptrarray->valssize);
5259 ptrarray->vals[i - shift] = ptrarray->vals[i];
5262 for( i = 0; i < shift; ++i )
5263 ptrarray->vals[ptrarray->maxusedidx - ptrarray->firstidx - i] =
NULL;
5265 ptrarray->firstidx = newfirstidx;
5268 assert(minidx >= ptrarray->firstidx);
5269 assert(maxidx < ptrarray->firstidx + ptrarray->valssize);
5279 assert(ptrarray !=
NULL);
5281 SCIPdebugMessage(
"clearing ptrarray %p (firstidx=%d, size=%d, range=[%d,%d])\n",
5282 (
void*)ptrarray, ptrarray->
firstidx, ptrarray->valssize, ptrarray->minusedidx, ptrarray->maxusedidx);
5284 if( ptrarray->minusedidx <= ptrarray->maxusedidx )
5286 assert(ptrarray->firstidx <= ptrarray->minusedidx);
5287 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5288 assert(ptrarray->firstidx != -1);
5289 assert(ptrarray->valssize > 0);
5293 ptrarray->maxusedidx - ptrarray->minusedidx + 1);
5296 ptrarray->minusedidx = INT_MAX;
5297 ptrarray->maxusedidx = INT_MIN;
5299 assert(ptrarray->minusedidx == INT_MAX);
5300 assert(ptrarray->maxusedidx == INT_MIN);
5311 assert(ptrarray !=
NULL);
5314 if( idx < ptrarray->minusedidx || idx > ptrarray->
maxusedidx )
5319 assert(idx - ptrarray->
firstidx >= 0);
5335 assert(ptrarray !=
NULL);
5338 SCIPdebugMessage(
"setting ptrarray %p (firstidx=%d, size=%d, range=[%d,%d]) index %d to %p\n",
5339 (
void*)ptrarray, ptrarray->
firstidx, ptrarray->valssize, ptrarray->minusedidx, ptrarray->maxusedidx, idx, val);
5345 assert(idx >= ptrarray->firstidx);
5346 assert(idx < ptrarray->firstidx + ptrarray->valssize);
5349 ptrarray->vals[idx - ptrarray->firstidx] = val;
5352 ptrarray->minusedidx = MIN(ptrarray->minusedidx, idx);
5353 ptrarray->maxusedidx =
MAX(ptrarray->maxusedidx, idx);
5355 else if( idx >= ptrarray->firstidx && idx < ptrarray->firstidx + ptrarray->valssize )
5358 ptrarray->vals[idx - ptrarray->firstidx] =
NULL;
5361 if( idx == ptrarray->minusedidx )
5363 assert(ptrarray->maxusedidx >= 0);
5364 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5367 ptrarray->minusedidx++;
5369 while( ptrarray->minusedidx <= ptrarray->maxusedidx
5370 && ptrarray->vals[ptrarray->minusedidx - ptrarray->firstidx] ==
NULL );
5371 if( ptrarray->minusedidx > ptrarray->maxusedidx )
5373 ptrarray->minusedidx = INT_MAX;
5374 ptrarray->maxusedidx = INT_MIN;
5377 else if( idx == ptrarray->maxusedidx )
5379 assert(ptrarray->minusedidx >= 0);
5380 assert(ptrarray->minusedidx < ptrarray->maxusedidx);
5381 assert(ptrarray->maxusedidx < ptrarray->firstidx + ptrarray->valssize);
5384 ptrarray->maxusedidx--;
5385 assert(ptrarray->minusedidx <= ptrarray->maxusedidx);
5387 while( ptrarray->vals[ptrarray->maxusedidx - ptrarray->firstidx] ==
NULL );
5399 assert(ptrarray !=
NULL);
5409 assert(ptrarray !=
NULL);
5425 value1 = (int)(
size_t)elem1;
5426 value2 = (int)(
size_t)elem2;
5428 if( value1 < value2 )
5431 if( value2 < value1 )
5449 assert(indcomp !=
NULL);
5450 assert(len == 0 || perm !=
NULL);
5453 for( pos = 0; pos < len; ++pos )
5460 #define SORTTPL_NAMEEXT Ind 5461 #define SORTTPL_KEYTYPE int 5462 #define SORTTPL_INDCOMP 5467 #define SORTTPL_NAMEEXT Ptr 5468 #define SORTTPL_KEYTYPE void* 5469 #define SORTTPL_PTRCOMP 5474 #define SORTTPL_NAMEEXT PtrPtr 5475 #define SORTTPL_KEYTYPE void* 5476 #define SORTTPL_FIELD1TYPE void* 5477 #define SORTTPL_PTRCOMP 5482 #define SORTTPL_NAMEEXT PtrReal 5483 #define SORTTPL_KEYTYPE void* 5484 #define SORTTPL_FIELD1TYPE SCIP_Real 5485 #define SORTTPL_PTRCOMP 5490 #define SORTTPL_NAMEEXT PtrInt 5491 #define SORTTPL_KEYTYPE void* 5492 #define SORTTPL_FIELD1TYPE int 5493 #define SORTTPL_PTRCOMP 5498 #define SORTTPL_NAMEEXT PtrBool 5499 #define SORTTPL_KEYTYPE void* 5500 #define SORTTPL_FIELD1TYPE SCIP_Bool 5501 #define SORTTPL_PTRCOMP 5506 #define SORTTPL_NAMEEXT PtrIntInt 5507 #define SORTTPL_KEYTYPE void* 5508 #define SORTTPL_FIELD1TYPE int 5509 #define SORTTPL_FIELD2TYPE int 5510 #define SORTTPL_PTRCOMP 5515 #define SORTTPL_NAMEEXT PtrRealInt 5516 #define SORTTPL_KEYTYPE void* 5517 #define SORTTPL_FIELD1TYPE SCIP_Real 5518 #define SORTTPL_FIELD2TYPE int 5519 #define SORTTPL_PTRCOMP 5523 #define SORTTPL_NAMEEXT PtrRealRealInt 5524 #define SORTTPL_KEYTYPE void* 5525 #define SORTTPL_FIELD1TYPE SCIP_Real 5526 #define SORTTPL_FIELD2TYPE SCIP_Real 5527 #define SORTTPL_FIELD3TYPE int 5528 #define SORTTPL_PTRCOMP 5532 #define SORTTPL_NAMEEXT PtrRealRealBoolBool 5533 #define SORTTPL_KEYTYPE void* 5534 #define SORTTPL_FIELD1TYPE SCIP_Real 5535 #define SORTTPL_FIELD2TYPE SCIP_Real 5536 #define SORTTPL_FIELD3TYPE SCIP_Bool 5537 #define SORTTPL_FIELD4TYPE SCIP_Bool 5538 #define SORTTPL_PTRCOMP 5542 #define SORTTPL_NAMEEXT PtrRealRealIntBool 5543 #define SORTTPL_KEYTYPE void* 5544 #define SORTTPL_FIELD1TYPE SCIP_Real 5545 #define SORTTPL_FIELD2TYPE SCIP_Real 5546 #define SORTTPL_FIELD3TYPE int 5547 #define SORTTPL_FIELD4TYPE SCIP_Bool 5548 #define SORTTPL_PTRCOMP 5552 #define SORTTPL_NAMEEXT PtrRealBool 5553 #define SORTTPL_KEYTYPE void* 5554 #define SORTTPL_FIELD1TYPE SCIP_Real 5555 #define SORTTPL_FIELD2TYPE SCIP_Bool 5556 #define SORTTPL_PTRCOMP 5561 #define SORTTPL_NAMEEXT PtrPtrInt 5562 #define SORTTPL_KEYTYPE void* 5563 #define SORTTPL_FIELD1TYPE void* 5564 #define SORTTPL_FIELD2TYPE int 5565 #define SORTTPL_PTRCOMP 5570 #define SORTTPL_NAMEEXT PtrPtrReal 5571 #define SORTTPL_KEYTYPE void* 5572 #define SORTTPL_FIELD1TYPE void* 5573 #define SORTTPL_FIELD2TYPE SCIP_Real 5574 #define SORTTPL_PTRCOMP 5579 #define SORTTPL_NAMEEXT PtrRealIntInt 5580 #define SORTTPL_KEYTYPE void* 5581 #define SORTTPL_FIELD1TYPE SCIP_Real 5582 #define SORTTPL_FIELD2TYPE int 5583 #define SORTTPL_FIELD3TYPE int 5584 #define SORTTPL_PTRCOMP 5589 #define SORTTPL_NAMEEXT PtrPtrIntInt 5590 #define SORTTPL_KEYTYPE void* 5591 #define SORTTPL_FIELD1TYPE void* 5592 #define SORTTPL_FIELD2TYPE int 5593 #define SORTTPL_FIELD3TYPE int 5594 #define SORTTPL_PTRCOMP 5599 #define SORTTPL_NAMEEXT PtrPtrRealInt 5600 #define SORTTPL_KEYTYPE void* 5601 #define SORTTPL_FIELD1TYPE void* 5602 #define SORTTPL_FIELD2TYPE SCIP_Real 5603 #define SORTTPL_FIELD3TYPE int 5604 #define SORTTPL_PTRCOMP 5609 #define SORTTPL_NAMEEXT PtrPtrRealBool 5610 #define SORTTPL_KEYTYPE void* 5611 #define SORTTPL_FIELD1TYPE void* 5612 #define SORTTPL_FIELD2TYPE SCIP_Real 5613 #define SORTTPL_FIELD3TYPE SCIP_Bool 5614 #define SORTTPL_PTRCOMP 5619 #define SORTTPL_NAMEEXT PtrPtrLongInt 5620 #define SORTTPL_KEYTYPE void* 5621 #define SORTTPL_FIELD1TYPE void* 5622 #define SORTTPL_FIELD2TYPE SCIP_Longint 5623 #define SORTTPL_FIELD3TYPE int 5624 #define SORTTPL_PTRCOMP 5629 #define SORTTPL_NAMEEXT PtrPtrLongIntInt 5630 #define SORTTPL_KEYTYPE void* 5631 #define SORTTPL_FIELD1TYPE void* 5632 #define SORTTPL_FIELD2TYPE SCIP_Longint 5633 #define SORTTPL_FIELD3TYPE int 5634 #define SORTTPL_FIELD4TYPE int 5635 #define SORTTPL_PTRCOMP 5640 #define SORTTPL_NAMEEXT Real 5641 #define SORTTPL_KEYTYPE SCIP_Real 5646 #define SORTTPL_NAMEEXT RealBoolPtr 5647 #define SORTTPL_KEYTYPE SCIP_Real 5648 #define SORTTPL_FIELD1TYPE SCIP_Bool 5649 #define SORTTPL_FIELD2TYPE void* 5654 #define SORTTPL_NAMEEXT RealPtr 5655 #define SORTTPL_KEYTYPE SCIP_Real 5656 #define SORTTPL_FIELD1TYPE void* 5661 #define SORTTPL_NAMEEXT RealInt 5662 #define SORTTPL_KEYTYPE SCIP_Real 5663 #define SORTTPL_FIELD1TYPE int 5668 #define SORTTPL_NAMEEXT RealIntInt 5669 #define SORTTPL_KEYTYPE SCIP_Real 5670 #define SORTTPL_FIELD1TYPE int 5671 #define SORTTPL_FIELD2TYPE int 5676 #define SORTTPL_NAMEEXT RealIntLong 5677 #define SORTTPL_KEYTYPE SCIP_Real 5678 #define SORTTPL_FIELD1TYPE int 5679 #define SORTTPL_FIELD2TYPE SCIP_Longint 5684 #define SORTTPL_NAMEEXT RealIntPtr 5685 #define SORTTPL_KEYTYPE SCIP_Real 5686 #define SORTTPL_FIELD1TYPE int 5687 #define SORTTPL_FIELD2TYPE void* 5692 #define SORTTPL_NAMEEXT RealRealPtr 5693 #define SORTTPL_KEYTYPE SCIP_Real 5694 #define SORTTPL_FIELD1TYPE SCIP_Real 5695 #define SORTTPL_FIELD2TYPE void* 5700 #define SORTTPL_NAMEEXT RealLongRealInt 5701 #define SORTTPL_KEYTYPE SCIP_Real 5702 #define SORTTPL_FIELD1TYPE SCIP_Longint 5703 #define SORTTPL_FIELD2TYPE SCIP_Real 5704 #define SORTTPL_FIELD3TYPE int 5708 #define SORTTPL_NAMEEXT RealRealIntInt 5709 #define SORTTPL_KEYTYPE SCIP_Real 5710 #define SORTTPL_FIELD1TYPE SCIP_Real 5711 #define SORTTPL_FIELD2TYPE int 5712 #define SORTTPL_FIELD3TYPE int 5717 #define SORTTPL_NAMEEXT RealRealRealInt 5718 #define SORTTPL_KEYTYPE SCIP_Real 5719 #define SORTTPL_FIELD1TYPE SCIP_Real 5720 #define SORTTPL_FIELD2TYPE SCIP_Real 5721 #define SORTTPL_FIELD3TYPE int 5726 #define SORTTPL_NAMEEXT RealRealRealPtr 5727 #define SORTTPL_KEYTYPE SCIP_Real 5728 #define SORTTPL_FIELD1TYPE SCIP_Real 5729 #define SORTTPL_FIELD2TYPE SCIP_Real 5730 #define SORTTPL_FIELD3TYPE void* 5735 #define SORTTPL_NAMEEXT RealPtrPtrInt 5736 #define SORTTPL_KEYTYPE SCIP_Real 5737 #define SORTTPL_FIELD1TYPE void* 5738 #define SORTTPL_FIELD2TYPE void* 5739 #define SORTTPL_FIELD3TYPE int 5744 #define SORTTPL_NAMEEXT RealPtrPtrIntInt 5745 #define SORTTPL_KEYTYPE SCIP_Real 5746 #define SORTTPL_FIELD1TYPE void* 5747 #define SORTTPL_FIELD2TYPE void* 5748 #define SORTTPL_FIELD3TYPE int 5749 #define SORTTPL_FIELD4TYPE int 5754 #define SORTTPL_NAMEEXT RealRealRealBoolPtr 5755 #define SORTTPL_KEYTYPE SCIP_Real 5756 #define SORTTPL_FIELD1TYPE SCIP_Real 5757 #define SORTTPL_FIELD2TYPE SCIP_Real 5758 #define SORTTPL_FIELD3TYPE SCIP_Bool 5759 #define SORTTPL_FIELD4TYPE void* 5764 #define SORTTPL_NAMEEXT RealRealRealBoolBoolPtr 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 SCIP_Bool 5770 #define SORTTPL_FIELD5TYPE void* 5775 #define SORTTPL_NAMEEXT Int 5776 #define SORTTPL_KEYTYPE int 5781 #define SORTTPL_NAMEEXT IntInt 5782 #define SORTTPL_KEYTYPE int 5783 #define SORTTPL_FIELD1TYPE int 5788 #define SORTTPL_NAMEEXT IntReal 5789 #define SORTTPL_KEYTYPE int 5790 #define SORTTPL_FIELD1TYPE SCIP_Real 5795 #define SORTTPL_NAMEEXT IntPtr 5796 #define SORTTPL_KEYTYPE int 5797 #define SORTTPL_FIELD1TYPE void* 5802 #define SORTTPL_NAMEEXT IntIntInt 5803 #define SORTTPL_KEYTYPE int 5804 #define SORTTPL_FIELD1TYPE int 5805 #define SORTTPL_FIELD2TYPE int 5810 #define SORTTPL_NAMEEXT IntIntLong 5811 #define SORTTPL_KEYTYPE int 5812 #define SORTTPL_FIELD1TYPE int 5813 #define SORTTPL_FIELD2TYPE SCIP_Longint 5817 #define SORTTPL_NAMEEXT IntRealLong 5818 #define SORTTPL_KEYTYPE int 5819 #define SORTTPL_FIELD1TYPE SCIP_Real 5820 #define SORTTPL_FIELD2TYPE SCIP_Longint 5825 #define SORTTPL_NAMEEXT IntIntPtr 5826 #define SORTTPL_KEYTYPE int 5827 #define SORTTPL_FIELD1TYPE int 5828 #define SORTTPL_FIELD2TYPE void* 5833 #define SORTTPL_NAMEEXT IntIntReal 5834 #define SORTTPL_KEYTYPE int 5835 #define SORTTPL_FIELD1TYPE int 5836 #define SORTTPL_FIELD2TYPE SCIP_Real 5841 #define SORTTPL_NAMEEXT IntPtrReal 5842 #define SORTTPL_KEYTYPE int 5843 #define SORTTPL_FIELD1TYPE void* 5844 #define SORTTPL_FIELD2TYPE SCIP_Real 5849 #define SORTTPL_NAMEEXT IntIntIntPtr 5850 #define SORTTPL_KEYTYPE int 5851 #define SORTTPL_FIELD1TYPE int 5852 #define SORTTPL_FIELD2TYPE int 5853 #define SORTTPL_FIELD3TYPE void* 5857 #define SORTTPL_NAMEEXT IntIntIntReal 5858 #define SORTTPL_KEYTYPE int 5859 #define SORTTPL_FIELD1TYPE int 5860 #define SORTTPL_FIELD2TYPE int 5861 #define SORTTPL_FIELD3TYPE SCIP_Real 5865 #define SORTTPL_NAMEEXT IntPtrIntReal 5866 #define SORTTPL_KEYTYPE int 5867 #define SORTTPL_FIELD1TYPE void* 5868 #define SORTTPL_FIELD2TYPE int 5869 #define SORTTPL_FIELD3TYPE SCIP_Real 5874 #define SORTTPL_NAMEEXT Long 5875 #define SORTTPL_KEYTYPE SCIP_Longint 5880 #define SORTTPL_NAMEEXT LongPtr 5881 #define SORTTPL_KEYTYPE SCIP_Longint 5882 #define SORTTPL_FIELD1TYPE void* 5887 #define SORTTPL_NAMEEXT LongPtrInt 5888 #define SORTTPL_KEYTYPE SCIP_Longint 5889 #define SORTTPL_FIELD1TYPE void* 5890 #define SORTTPL_FIELD2TYPE int 5895 #define SORTTPL_NAMEEXT LongPtrRealBool 5896 #define SORTTPL_KEYTYPE SCIP_Longint 5897 #define SORTTPL_FIELD1TYPE void* 5898 #define SORTTPL_FIELD2TYPE SCIP_Real 5899 #define SORTTPL_FIELD3TYPE SCIP_Bool 5904 #define SORTTPL_NAMEEXT LongPtrRealRealBool 5905 #define SORTTPL_KEYTYPE SCIP_Longint 5906 #define SORTTPL_FIELD1TYPE void* 5907 #define SORTTPL_FIELD2TYPE SCIP_Real 5908 #define SORTTPL_FIELD3TYPE SCIP_Real 5909 #define SORTTPL_FIELD4TYPE SCIP_Bool 5914 #define SORTTPL_NAMEEXT LongPtrRealRealIntBool 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 int 5920 #define SORTTPL_FIELD5TYPE SCIP_Bool 5925 #define SORTTPL_NAMEEXT LongPtrPtrInt 5926 #define SORTTPL_KEYTYPE SCIP_Longint 5927 #define SORTTPL_FIELD1TYPE void* 5928 #define SORTTPL_FIELD2TYPE void* 5929 #define SORTTPL_FIELD3TYPE int 5934 #define SORTTPL_NAMEEXT LongPtrPtrIntInt 5935 #define SORTTPL_KEYTYPE SCIP_Longint 5936 #define SORTTPL_FIELD1TYPE void* 5937 #define SORTTPL_FIELD2TYPE void* 5938 #define SORTTPL_FIELD3TYPE int 5939 #define SORTTPL_FIELD4TYPE int 5944 #define SORTTPL_NAMEEXT LongPtrPtrBoolInt 5945 #define SORTTPL_KEYTYPE SCIP_Longint 5946 #define SORTTPL_FIELD1TYPE void* 5947 #define SORTTPL_FIELD2TYPE void* 5948 #define SORTTPL_FIELD3TYPE SCIP_Bool 5949 #define SORTTPL_FIELD4TYPE int 5954 #define SORTTPL_NAMEEXT PtrIntIntBoolBool 5955 #define SORTTPL_KEYTYPE void* 5956 #define SORTTPL_FIELD1TYPE int 5957 #define SORTTPL_FIELD2TYPE int 5958 #define SORTTPL_FIELD3TYPE SCIP_Bool 5959 #define SORTTPL_FIELD4TYPE SCIP_Bool 5960 #define SORTTPL_PTRCOMP 5965 #define SORTTPL_NAMEEXT IntPtrIntIntBoolBool 5966 #define SORTTPL_KEYTYPE int 5967 #define SORTTPL_FIELD1TYPE void* 5968 #define SORTTPL_FIELD2TYPE int 5969 #define SORTTPL_FIELD3TYPE int 5970 #define SORTTPL_FIELD4TYPE SCIP_Bool 5971 #define SORTTPL_FIELD5TYPE SCIP_Bool 5988 assert(indcomp !=
NULL);
5989 assert(len == 0 || perm !=
NULL);
5992 for( pos = 0; pos < len; ++pos )
6000 #define SORTTPL_NAMEEXT DownInd 6001 #define SORTTPL_KEYTYPE int 6002 #define SORTTPL_INDCOMP 6003 #define SORTTPL_BACKWARDS 6008 #define SORTTPL_NAMEEXT DownPtr 6009 #define SORTTPL_KEYTYPE void* 6010 #define SORTTPL_PTRCOMP 6011 #define SORTTPL_BACKWARDS 6016 #define SORTTPL_NAMEEXT DownPtrPtr 6017 #define SORTTPL_KEYTYPE void* 6018 #define SORTTPL_FIELD1TYPE void* 6019 #define SORTTPL_PTRCOMP 6020 #define SORTTPL_BACKWARDS 6025 #define SORTTPL_NAMEEXT DownPtrReal 6026 #define SORTTPL_KEYTYPE void* 6027 #define SORTTPL_FIELD1TYPE SCIP_Real 6028 #define SORTTPL_PTRCOMP 6029 #define SORTTPL_BACKWARDS 6034 #define SORTTPL_NAMEEXT DownPtrInt 6035 #define SORTTPL_KEYTYPE void* 6036 #define SORTTPL_FIELD1TYPE int 6037 #define SORTTPL_PTRCOMP 6038 #define SORTTPL_BACKWARDS 6042 #define SORTTPL_NAMEEXT DownPtrBool 6043 #define SORTTPL_KEYTYPE void* 6044 #define SORTTPL_FIELD1TYPE SCIP_Bool 6045 #define SORTTPL_PTRCOMP 6046 #define SORTTPL_BACKWARDS 6050 #define SORTTPL_NAMEEXT DownPtrIntInt 6051 #define SORTTPL_KEYTYPE void* 6052 #define SORTTPL_FIELD1TYPE int 6053 #define SORTTPL_FIELD2TYPE int 6054 #define SORTTPL_PTRCOMP 6055 #define SORTTPL_BACKWARDS 6060 #define SORTTPL_NAMEEXT DownPtrRealInt 6061 #define SORTTPL_KEYTYPE void* 6062 #define SORTTPL_FIELD1TYPE SCIP_Real 6063 #define SORTTPL_FIELD2TYPE int 6064 #define SORTTPL_PTRCOMP 6065 #define SORTTPL_BACKWARDS 6070 #define SORTTPL_NAMEEXT DownPtrRealBool 6071 #define SORTTPL_KEYTYPE void* 6072 #define SORTTPL_FIELD1TYPE SCIP_Real 6073 #define SORTTPL_FIELD2TYPE SCIP_Bool 6074 #define SORTTPL_PTRCOMP 6075 #define SORTTPL_BACKWARDS 6080 #define SORTTPL_NAMEEXT DownPtrPtrInt 6081 #define SORTTPL_KEYTYPE void* 6082 #define SORTTPL_FIELD1TYPE void* 6083 #define SORTTPL_FIELD2TYPE int 6084 #define SORTTPL_PTRCOMP 6085 #define SORTTPL_BACKWARDS 6090 #define SORTTPL_NAMEEXT DownPtrPtrReal 6091 #define SORTTPL_KEYTYPE void* 6092 #define SORTTPL_FIELD1TYPE void* 6093 #define SORTTPL_FIELD2TYPE SCIP_Real 6094 #define SORTTPL_PTRCOMP 6095 #define SORTTPL_BACKWARDS 6100 #define SORTTPL_NAMEEXT DownPtrRealIntInt 6101 #define SORTTPL_KEYTYPE void* 6102 #define SORTTPL_FIELD1TYPE SCIP_Real 6103 #define SORTTPL_FIELD2TYPE int 6104 #define SORTTPL_FIELD3TYPE int 6105 #define SORTTPL_PTRCOMP 6106 #define SORTTPL_BACKWARDS 6111 #define SORTTPL_NAMEEXT DownPtrPtrIntInt 6112 #define SORTTPL_KEYTYPE void* 6113 #define SORTTPL_FIELD1TYPE void* 6114 #define SORTTPL_FIELD2TYPE int 6115 #define SORTTPL_FIELD3TYPE int 6116 #define SORTTPL_PTRCOMP 6117 #define SORTTPL_BACKWARDS 6122 #define SORTTPL_NAMEEXT DownPtrPtrRealInt 6123 #define SORTTPL_KEYTYPE void* 6124 #define SORTTPL_FIELD1TYPE void* 6125 #define SORTTPL_FIELD2TYPE SCIP_Real 6126 #define SORTTPL_FIELD3TYPE int 6127 #define SORTTPL_PTRCOMP 6128 #define SORTTPL_BACKWARDS 6133 #define SORTTPL_NAMEEXT DownPtrPtrRealBool 6134 #define SORTTPL_KEYTYPE void* 6135 #define SORTTPL_FIELD1TYPE void* 6136 #define SORTTPL_FIELD2TYPE SCIP_Real 6137 #define SORTTPL_FIELD3TYPE SCIP_Bool 6138 #define SORTTPL_PTRCOMP 6139 #define SORTTPL_BACKWARDS 6144 #define SORTTPL_NAMEEXT DownPtrPtrLongInt 6145 #define SORTTPL_KEYTYPE void* 6146 #define SORTTPL_FIELD1TYPE void* 6147 #define SORTTPL_FIELD2TYPE SCIP_Longint 6148 #define SORTTPL_FIELD3TYPE int 6149 #define SORTTPL_PTRCOMP 6150 #define SORTTPL_BACKWARDS 6155 #define SORTTPL_NAMEEXT DownPtrPtrLongIntInt 6156 #define SORTTPL_KEYTYPE void* 6157 #define SORTTPL_FIELD1TYPE void* 6158 #define SORTTPL_FIELD2TYPE SCIP_Longint 6159 #define SORTTPL_FIELD3TYPE int 6160 #define SORTTPL_FIELD4TYPE int 6161 #define SORTTPL_PTRCOMP 6162 #define SORTTPL_BACKWARDS 6167 #define SORTTPL_NAMEEXT DownReal 6168 #define SORTTPL_KEYTYPE SCIP_Real 6169 #define SORTTPL_BACKWARDS 6174 #define SORTTPL_NAMEEXT DownRealBoolPtr 6175 #define SORTTPL_KEYTYPE SCIP_Real 6176 #define SORTTPL_FIELD1TYPE SCIP_Bool 6177 #define SORTTPL_FIELD2TYPE void* 6178 #define SORTTPL_BACKWARDS 6183 #define SORTTPL_NAMEEXT DownRealPtr 6184 #define SORTTPL_KEYTYPE SCIP_Real 6185 #define SORTTPL_FIELD1TYPE void* 6186 #define SORTTPL_BACKWARDS 6191 #define SORTTPL_NAMEEXT DownRealInt 6192 #define SORTTPL_KEYTYPE SCIP_Real 6193 #define SORTTPL_FIELD1TYPE int 6194 #define SORTTPL_BACKWARDS