51 #define DEFAULT_MEM_VARAFTERDUAL 10 52 #define DEFAULT_MEM_VAR 10 53 #define DEFAULT_MEM_NODES 1000 54 #define DEFAULT_MEM_RUN 200 55 #define DEFAULT_MEM_DUALCONS 10 57 #define DEFAULT_RANDSEED 67 60 #define EVENTHDLR_NAME "Reopt" 61 #define EVENTHDLR_DESC "node event handler for reoptimization" 74 assert(eventhdlr !=
NULL);
82 assert( eventnode !=
NULL );
106 assert(eventhdlr !=
NULL);
132 assert(eventhdlr !=
NULL);
167 assert(runidx <= reopt->runsize);
176 assert(num <= reopt->soltree->solssize[runidx]);
201 for(s = reopt->
runsize; s < newsize; s++)
213 assert(num < reopt->runsize);
226 assert(reopttree !=
NULL);
227 assert(blkmem !=
NULL);
239 for(
id = reopttree->
reoptnodessize;
id < (
unsigned int)newsize;
id++ )
264 assert(reoptnode !=
NULL);
265 assert(blkmem !=
NULL);
266 assert(var_mem >= 0);
267 assert(child_mem >= 0);
268 assert(conss_mem >= 0);
280 else if( reoptnode->
varssize < var_mem )
316 else if( reoptnode->
consssize < conss_mem )
340 assert(solnode !=
NULL);
348 sibling = solnode->
child;
351 while( sibling !=
NULL )
376 assert(reopt !=
NULL);
377 assert(vars !=
NULL);
385 for( v = 0; v < nvars; v++ )
412 assert(transvar !=
NULL);
422 assert(0 <= probidx && probidx < reopt->nobjvars);
424 c1 = reopt->
objs[obj1_id][probidx];
425 c2 = reopt->
objs[obj2_id][probidx];
429 norm_obj1 += SQR(c1);
430 norm_obj2 += SQR(c2);
435 norm_obj1 = SQRT(norm_obj1);
436 norm_obj2 = SQRT(norm_obj2);
439 similarity /= (norm_obj1 * norm_obj2);
442 similarity =
MAX(similarity, -1.0);
443 similarity =
MIN(similarity, 1.0);
455 assert((*reoptnode) !=
NULL );
456 assert(blkmem !=
NULL );
459 if( (*reoptnode)->consssize > 0 )
463 assert((*reoptnode)->conss !=
NULL);
465 for( c = 0; c < (*reoptnode)->nconss; c++ )
467 assert((*reoptnode)->conss[c] !=
NULL);
468 assert((*reoptnode)->conss[c]->vals !=
NULL);
469 assert((*reoptnode)->conss[c]->vars !=
NULL);
477 (*reoptnode)->nconss = 0;
478 (*reoptnode)->consssize = 0;
479 (*reoptnode)->conss =
NULL;
483 if( (*reoptnode)->childids !=
NULL )
486 (*reoptnode)->nchilds = 0;
487 (*reoptnode)->allocchildmem = 0;
488 (*reoptnode)->childids =
NULL;
492 if( (*reoptnode)->dualredscur !=
NULL )
494 assert((*reoptnode)->dualredscur->varssize > 0);
499 (*reoptnode)->dualredscur =
NULL;
503 if( (*reoptnode)->dualredsnex !=
NULL )
505 assert((*reoptnode)->dualredsnex->varssize > 0);
510 (*reoptnode)->dualredsnex =
NULL;
514 if ((*reoptnode)->varboundtypes !=
NULL )
516 assert((*reoptnode)->varssize > 0);
518 (*reoptnode)->varboundtypes =
NULL;
522 if ((*reoptnode)->varbounds !=
NULL )
524 assert((*reoptnode)->varssize > 0);
526 (*reoptnode)->varbounds =
NULL;
530 if ((*reoptnode)->vars !=
NULL )
532 assert((*reoptnode)->varssize > 0);
534 (*reoptnode)->vars =
NULL;
537 (*reoptnode)->varssize = 0;
540 if ((*reoptnode)->afterdualvarboundtypes !=
NULL )
542 assert((*reoptnode)->afterdualvarssize > 0);
544 (*reoptnode)->afterdualvarboundtypes =
NULL;
548 if ((*reoptnode)->afterdualvarbounds !=
NULL )
550 assert((*reoptnode)->afterdualvarssize > 0);
552 (*reoptnode)->afterdualvarbounds =
NULL;
556 if ((*reoptnode)->afterdualvars !=
NULL )
558 assert((*reoptnode)->afterdualvarssize > 0);
560 (*reoptnode)->afterdualvars =
NULL;
563 (*reoptnode)->afterdualvarssize = 0;
579 assert(reoptnode !=
NULL);
581 assert(blkmem !=
NULL);
584 if( reoptnode->
nconss > 0 )
591 for( c = 0; c < reoptnode->
nconss; c++ )
593 if( !reoptnode->
conss[c]->linear )
595 assert(reoptnode->
conss[c]->boundtypes !=
NULL);
640 reoptnode->
nvars = 0;
659 assert(reopttree !=
NULL );
660 assert(id < reopttree->reoptnodessize);
690 assert(soltree !=
NULL);
698 soltree->
nsols[s] = 0;
728 assert(reopt !=
NULL);
731 assert(solnode !=
NULL);
732 assert(blkmem !=
NULL);
734 child = (*solnode)->
child;
737 while( child !=
NULL )
740 assert(child !=
NULL);
747 if( (*solnode)->sol !=
NULL )
766 assert(reopt !=
NULL);
770 assert(blkmem !=
NULL);
800 assert(blkmem !=
NULL);
801 assert(curnode !=
NULL);
802 assert(child !=
NULL && *child ==
NULL);
806 *child = curnode->
child;
816 solnode->
father = curnode;
819 solnode->
value = val;
828 curnode->
child = *child;
830 #ifdef SCIP_MORE_DEBUG 831 SCIPsetDebugMsg(
set,
"-> create new node %p: value=%g, sibling=%p\n", (
void*) solnode, solnode->
value,
832 (
void*) solnode->sibling);
838 while( *child !=
NULL )
840 #ifdef SCIP_MORE_DEBUG 841 SCIPsetDebugMsg(
set,
"-> check %p: father=%p, value=%g, sibling=%p\n", (
void*) *child, (
void*) (*child)->
father,
842 (*child)->
value, (
void*) (*child)->sibling);
849 if( (*child)->sibling ==
NULL )
855 solnode->
father = curnode;
857 solnode->
value = val;
869 (*child)->sibling = solnode;
871 #ifdef SCIP_MORE_DEBUG 872 SCIPsetDebugMsg(
set,
"-> create new node %p: value=%g, sibling=%p\n", (
void*) solnode, solnode->
value,
873 (
void*) solnode->sibling);
880 #ifdef SCIP_MORE_DEBUG 882 SCIPsetDebugMsg(
set,
" before switching: node %p witch child=%p, sibling=%p, sol=%p, value=%g\n",
883 (
void*) (*child), (
void*) (*child)->child, (
void*) (*child)->sibling, (
void*) (*child)->sol,
885 SCIPsetDebugMsg(
set,
" node %p witch child=%p, sibling=%p, sol=%p, value=%g\n",
886 (
void*) solnode, (
void*) solnode->child, (
void*) solnode->sibling, (
void*) solnode->sol,
890 solnode->child = (*child)->child;
891 (*child)->child =
NULL;
894 solnode->value = (*child)->value;
895 (*child)->value = val;
896 assert(
SCIPsetIsLT(
set, (*child)->value, solnode->value));
899 solnode->sol = (*child)->sol;
900 (*child)->sol =
NULL;
901 #ifdef SCIP_MORE_DEBUG 902 SCIPsetDebugMsg(
set,
" after switching: node %p witch child=%p, sibling=%p, sol=%p, value=%g\n",
903 (
void*) (*child), (
void*) (*child)->child, (
void*) (*child)->sibling, (
void*) (*child)->sol,
905 SCIPsetDebugMsg(
set,
" node %p witch child=%p, sibling=%p, sol=%p, value=%g\n",
906 (
void*) solnode, (
void*) solnode->child, (
void*) solnode->sibling, (
void*) solnode->sol,
920 if(
SCIPsetIsLT(
set, val, (*child)->sibling->value) )
926 solnode->
father = curnode;
929 solnode->
value = val;
937 (*child)->sibling = solnode;
940 #ifdef SCIP_MORE_DEBUG 941 SCIPsetDebugMsg(
set,
"-> create new node %p: value=%g, sibling=%p\n", (
void*) solnode, solnode->
value,
942 (
void*) solnode->sibling);
948 *child = (*child)->sibling;
953 solnode = curnode->
child;
954 assert(solnode !=
NULL);
986 assert(reopt !=
NULL);
988 assert(stat !=
NULL);
989 assert(origprimal !=
NULL);
990 assert(blkmem !=
NULL);
991 assert(vars !=
NULL);
993 assert(solnode !=
NULL);
999 if( set->reopt_savesols > 0 )
1006 for( varid = 0; varid < nvars; varid++ )
1016 assert(child !=
NULL);
1022 if( (*added || bestsol) && !purelp )
1031 cursolnode->
sol = copysol;
1042 assert(cursolnode->
sol !=
NULL);
1047 (*solnode) = cursolnode;
1060 assert(node !=
NULL);
1070 child = node->
child;
1073 while( child !=
NULL )
1097 assert(reopttree !=
NULL );
1098 assert(id < reopttree->reoptnodessize);
1155 assert(reopttree !=
NULL);
1156 assert(
set !=
NULL);
1157 assert(blkmem !=
NULL);
1202 assert(reopttree !=
NULL );
1237 assert(reopttree !=
NULL);
1238 assert(blkmem !=
NULL);
1262 assert(reopt !=
NULL);
1263 assert(blkmem !=
NULL);
1275 else if( reopt->
dualreds->varssize < size )
1281 reopt->
dualreds->varssize = newsize;
1298 assert(reopt !=
NULL);
1299 assert(blkmem !=
NULL);
1347 assert(reopt !=
NULL);
1348 assert(blkmem !=
NULL);
1349 assert(node !=
NULL);
1350 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
1357 if( nconsprops > 0 )
1369 assert(nvars + naddedbndchgs <= reopt->reopttree->reoptnodes[
id]->varssize);
1373 *transintoorig =
TRUE;
1401 assert(reopt !=
NULL);
1402 assert(blkmem !=
NULL);
1403 assert(node !=
NULL);
1404 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
1458 if( nbranchvars > 0 )
1459 *transintoorig =
TRUE;
1461 SCIPsetDebugMsg(
set,
" -> save %d bound changes after dual reductions\n", nbranchvars);
1463 assert(nbranchvars <= reopt->reopttree->reoptnodes[
id]->afterdualvarssize);
1484 assert(reopt !=
NULL);
1485 assert(
set !=
NULL);
1487 assert(blkmem !=
NULL);
1492 for( r = 0; r < nlprows; r++ )
1524 for( c = 0; c < ncutvars; c++ )
1530 assert(cutvars[c] !=
NULL);
1536 assert(cutvars[c] !=
NULL);
1545 cutvals[c] = cutvals[c]/scalar;
1568 assert(reopt !=
NULL );
1569 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
1611 unsigned int* parentid,
1615 assert(reopt !=
NULL);
1625 int nbranchings = 0;
1628 if( set->reopt_saveconsprop )
1633 (*nbndchgs) = (*nbndchgs) + nbranchings + nconsprop;
1671 unsigned int parentid,
1672 unsigned int childid
1677 assert(reopttree !=
NULL);
1678 assert(blkmem !=
NULL);
1693 SCIPsetDebugMsg(
set,
"add ID %u as a child of ID %u.\n", childid, parentid);
1704 unsigned int nodeid,
1705 unsigned int parentid
1708 unsigned int childid;
1712 assert(reopt !=
NULL);
1713 assert(blkmem !=
NULL);
1714 assert(0 < nodeid && nodeid < reopt->reopttree->reoptnodessize);
1715 assert(parentid < reopt->reopttree->reoptnodessize);
1728 assert(0 < childid && childid < reopt->reopttree->reoptnodessize);
1770 assert(reopttree !=
NULL );
1771 assert(blkmem !=
NULL);
1772 assert(id < reopttree->reoptnodessize);
1778 SCIPsetDebugMsg(
set,
"-> delete subtree induced by ID %u (hard remove = %u)\n",
id, exitsolve);
1783 unsigned int childid;
1787 assert(0 < childid && childid < reopttree->reoptnodessize);
1818 assert(reopt !=
NULL);
1819 assert(node !=
NULL);
1820 assert(id < reopt->reopttree->reoptnodessize);
1823 assert(reoptnodes !=
NULL);
1824 assert(reoptnodes[
id] !=
NULL);
1826 if( reoptnodes[
id]->childids !=
NULL && reoptnodes[
id]->nchilds > 0 )
1829 unsigned int parentid = 0;
1834 assert(parentid !=
id);
1835 assert(reoptnodes[parentid] !=
NULL );
1836 assert(reoptnodes[parentid]->childids !=
NULL && reoptnodes[parentid]->nchilds);
1846 if( ndomchgs <= set->reopt_maxdiffofnodes )
1851 id, reoptnodes[
id]->nchilds);
1858 while( reoptnodes[parentid]->childids[c] !=
id )
1861 assert(c < reoptnodes[parentid]->nchilds);
1864 assert(reoptnodes[parentid]->childids[c] ==
id);
1868 --reoptnodes[parentid]->
nchilds;
1891 assert(reopttree !=
NULL);
1892 assert(id < reopttree->reoptnodessize);
1897 unsigned int childid;
1903 while( seenids < nchildids )
1907 assert(childid < reopttree->reoptnodessize);
1936 assert(reoptnode !=
NULL);
1937 assert(blkmem !=
NULL);
1976 assert(reopt !=
NULL);
1978 assert(
set !=
NULL);
1979 assert(blkmem !=
NULL);
1980 assert(node !=
NULL);
1981 assert(transvars !=
NULL);
1984 assert(node !=
NULL);
1986 *localrestart =
FALSE;
1989 assert(id < reopt->reopttree->reoptnodessize);
1995 if( set->reopt_objsimdelay > -1 )
2009 for( v = 0; v < ntransvars; v++ )
2018 assert(0 <= idx && idx < ntransvars);
2023 sim += (oldcoef * newcoef);
2029 if(
SCIPsetIsLT(
set, sim, set->reopt_objsimdelay) )
2032 *localrestart =
TRUE;
2045 SCIPsetDebugMsg(
set,
" -> local similarity: %.4f%s\n", sim, *localrestart ?
" (solve subproblem from scratch)" :
"");
2060 unsigned int parentid
2065 assert(reopttree !=
NULL );
2066 assert(node !=
NULL );
2067 assert(parent !=
NULL );
2068 assert(1 <=
id && id < reopttree->reoptnodessize);
2070 assert(parentid < reopttree->reoptnodessize);
2071 assert(parentid == 0 || reopttree->
reoptnodes[parentid] !=
NULL );
2109 assert(nbranchvars <= reopttree->reoptnodes[
id]->varssize);
2113 assert(nbranchvars <= reopttree->reoptnodes[
id]->varssize);
2135 assert(reoptconsdata !=
NULL);
2136 assert(cons !=
NULL);
2139 allocbuffervals =
FALSE;
2140 reoptconsdata->linear =
TRUE;
2150 reoptconsdata->varssize = reoptconsdata->nvars;
2153 reoptconsdata->boundtypes =
NULL;
2156 assert(conshdlr !=
NULL);
2172 allocbuffervals =
TRUE;
2174 for( v = 0; v < reoptconsdata->nvars; v++ )
2177 reoptconsdata->lhs = 1.0;
2186 allocbuffervals =
TRUE;
2188 for( v = 0; v < reoptconsdata->nvars; v++ )
2193 reoptconsdata->lhs = 1.0;
2194 reoptconsdata->rhs = 1.0;
2198 reoptconsdata->rhs = 1.0;
2201 reoptconsdata->lhs = 1.0;
2217 assert(vars !=
NULL);
2218 assert(vals !=
NULL);
2221 for( v = 0; v < reoptconsdata->nvars; v++ )
2226 assert(vars[v] !=
NULL);
2228 reoptconsdata->vars[v] = vars[v];
2229 reoptconsdata->vals[v] = vals[v];
2235 reoptconsdata->vals[v] *= scalar;
2238 reoptconsdata->lhs -= constant;
2240 reoptconsdata->rhs -= constant;
2244 if( allocbuffervals )
2265 assert(reoptconsdata !=
NULL);
2266 assert(cons !=
NULL);
2269 reoptconsdata->linear =
FALSE;
2272 assert(conshdlr !=
NULL);
2277 SCIPerrorMessage(
"Cannot handle constraints of type <%s> in saveConsBounddisjuction.\n",
2292 reoptconsdata->varssize = reoptconsdata->nvars;
2297 for( v = 0; v < reoptconsdata->nvars; v++ )
2302 assert(reoptconsdata->vars[v] !=
NULL);
2308 reoptconsdata->vals[v] -= constant;
2309 reoptconsdata->vals[v] *= scalar;
2335 assert(node !=
NULL );
2336 assert(reopttree !=
NULL);
2337 assert(id < reopttree->reoptnodessize);
2344 SCIPsetDebugMsg(
set,
" -> save %d locally added constraints\n", addedconsssize);
2356 for( c = nconss; c < naddedconss; c++ )
2429 assert(reopt !=
NULL);
2431 assert(id < reopt->reopttree->reoptnodessize);
2433 assert(node !=
NULL);
2434 assert(blkmem !=
NULL);
2453 &nbndchgs, reopt->
dualreds->varssize);
2454 assert(nbndchgs <= reopt->dualreds->varssize);
2460 for( v = 0; v < nbndchgs; v++ )
2472 assert(nbndchgs > 0);
2484 cons_is_next =
FALSE;
2495 reopt->
dualreds->vars, nbndchgs) );
2497 reopt->
dualreds->vals, nbndchgs) );
2499 reopt->
dualreds->boundtypes, nbndchgs) );
2509 SCIPsetDebugMsg(
set,
" -> save dual information of type 1: node %lld, nvars %d, constype %d\n",
2521 reopt->
dualreds->vars, nbndchgs) );
2523 reopt->
dualreds->vals, nbndchgs) );
2525 reopt->
dualreds->boundtypes, nbndchgs) );
2533 SCIPsetDebugMsg(
set,
" -> save dual information of type 2: node %lld, nvars %d, constype %d\n",
2558 unsigned int parentid = 0;
2560 assert(reopt !=
NULL);
2561 assert(
set !=
NULL);
2562 assert(blkmem !=
NULL);
2563 assert(node !=
NULL);
2565 if( set->reopt_maxsavednodes == 0 )
2586 assert(!isrootnode);
2589 assert(id < reopt->reopttree->reoptnodessize);
2599 assert(parent !=
NULL);
2611 assert(parent !=
NULL);
2620 assert(parentid == 0
2638 transintoorig =
FALSE;
2641 if( set->reopt_usecuts )
2654 if( set->reopt_saveconsprop )
2670 #ifdef SCIP_MORE_DEBUG 2704 if( set->reopt_shrinkinner )
2724 if( set->reopt_reducetofrontier )
2738 if( set->reopt_reducetofrontier )
2788 if( set->reopt_usecuts )
2822 SCIPsetDebugMsg(
set,
" -> nvars: 0, ncons: 0, parentID: -, reopttype: %u, lowerbound: %g\n", reopttype,
2836 if( set->reopt_reducetofrontier )
2855 SCIPsetDebugMsg(
set,
" -> nvars: 0, ncons: 0, parentID: -, reopttype: %u, lowerbound: %g\n", reopttype,
2869 if( set->reopt_reducetofrontier )
2888 SCIPsetDebugMsg(
set,
" -> nvars: 0, ncons: 0, parentID: -, reopttype: %u, lowerbound:%g \n", reopttype,
2949 assert(
id >= 1 && id < reopt->reopttree->reoptnodessize);
2950 assert(!isrootnode);
2957 assert(parent !=
NULL );
2982 SCIPsetDebugMsg(
set,
" -> skip saving bound changes after dual reductions.\n");
3000 if( set->reopt_usecuts )
3016 SCIPsetDebugMsg(
set,
" -> nvars: %d, ncons: %d, parentID: %u, reopttype: %d, lowerbound: %g\n",
3020 #ifdef SCIP_MORE_DEBUG 3119 assert(reopt !=
NULL);
3137 assert(reoptnode !=
NULL);
3138 assert(blkmem !=
NULL);
3199 assert(reopt !=
NULL);
3200 assert(blkmem !=
NULL);
3201 assert(
set !=
NULL);
3202 assert(vars !=
NULL);
3203 assert(vals !=
NULL);
3204 assert(nbinvars + nintvars == nvars);
3211 reoptconsdata =
NULL;
3216 reoptconsdata = reopt->
glbconss[nglbconss];
3221 reoptconsdata->varssize = (int)(nbinvars+2*nintvars);
3222 reoptconsdata->nvars = 0;
3226 assert(reopt->
glbconss[nglbconss]->nvars == 0);
3227 assert(reopt->
glbconss[nglbconss]->varssize > 0);
3229 reoptconsdata = reopt->
glbconss[nglbconss];
3231 if( reoptconsdata->varssize < nbinvars+2*nintvars )
3234 (
int)(nbinvars+2*nintvars)) );
3236 (
int)(nbinvars+2*nintvars)) );
3238 (
int)(nbinvars+2*nintvars)) );
3239 reoptconsdata->varssize = (int)(nbinvars+2*nintvars);
3242 assert(reoptconsdata !=
NULL);
3244 reoptconsdata->lhs = 1.0;
3246 reoptconsdata->linear =
FALSE;
3249 for( v = 0; v < nvars; v++ )
3251 assert(nvarsadded < reoptconsdata->varssize);
3252 assert(vars[v] !=
NULL);
3266 reoptconsdata->vars[nvarsadded] = vars[v];
3271 reoptconsdata->vals[nvarsadded] = 0.0;
3278 reoptconsdata->vals[nvarsadded] = 1.0;
3285 assert(boundtypes !=
NULL);
3287 reoptconsdata->vals[nvarsadded] = vals[v];
3299 reoptconsdata->vars[nvarsadded] = vars[v];
3315 reoptconsdata->vals[nvarsadded] = ubglb - 1.0;
3323 reoptconsdata->vals[nvarsadded] = lbglb + 1.0;
3327 else if( boundtypes !=
NULL )
3336 reoptconsdata->vals[nvarsadded] = roundedval + 1.0;
3344 reoptconsdata->vals[nvarsadded] = roundedval - 1.0;
3357 reoptconsdata->vals[nvarsadded] = roundedval - 1.0;
3362 reoptconsdata->vars[nvarsadded] = vars[v];
3363 reoptconsdata->vals[nvarsadded] = roundedval + 1.0;
3369 assert(nvars <= nvarsadded);
3370 assert(nvarsadded == nbinvars + 2 * nintvars);
3372 reoptconsdata->nvars = nvarsadded;
3388 assert(reopt !=
NULL);
3389 assert(node !=
NULL);
3411 if( allocmem < nbranchvars )
3416 allocmem = nbranchvars;
3424 for( v = 0; v < nbranchvars; v++ )
3431 assert(nbinvars + nintvars == nbranchvars);
3433 SCIP_CALL(
addGlobalCut(reopt, blkmem,
set, vars, vals, boundtypes, nbranchvars, nbinvars, nintvars) );
3460 assert(reopttree !=
NULL);
3461 assert(blkmem !=
NULL);
3462 assert(id1 < reopttree->reoptnodessize);
3463 assert(id2 < reopttree->reoptnodessize);
3474 SCIPsetDebugMsg(
set,
"move %d IDs: %u -> %u\n", nchilds_id1, id1, id2);
3477 for( c = 0; c < nchilds_id1; c++ )
3483 for( k = 0; k < nchilds_id2; k++ )
3523 assert(reopt !=
NULL);
3524 assert(
set !=
NULL);
3525 assert(stat !=
NULL);
3526 assert(transprob !=
NULL);
3527 assert(tree !=
NULL);
3529 assert(branchcand !=
NULL);
3530 assert(eventqueue !=
NULL);
3531 assert(cliquetable !=
NULL);
3532 assert(node !=
NULL);
3533 assert(blkmem !=
NULL);
3536 assert(reopttree !=
NULL);
3537 assert(id < reopttree->reoptnodessize);
3540 assert(reoptnode !=
NULL);
3547 for( v = 0; v < reoptnode->
nvars; v++ )
3556 var = reoptnode->
vars[v];
3585 #ifdef SCIP_MORE_DEBUG 3641 #ifdef SCIP_MORE_DEBUG 3648 nvars = reoptnode->
nvars;
3696 assert(reopt !=
NULL);
3698 assert(id < reopt->reopttree->reoptnodessize);
3702 assert(scip !=
NULL);
3703 assert(
set !=
NULL);
3704 assert(stat !=
NULL);
3705 assert(blkmem !=
NULL);
3706 assert(transprob !=
NULL);
3707 assert(origprob !=
NULL);
3708 assert(tree !=
NULL);
3710 assert(branchcand !=
NULL);
3711 assert(eventqueue !=
NULL);
3712 assert(node !=
NULL);
3736 assert(!reoptconsdata->linear);
3737 assert(reoptconsdata->vars !=
NULL);
3738 assert(reoptconsdata->vals !=
NULL);
3739 assert(reoptconsdata->boundtypes !=
NULL);
3741 var = reoptconsdata->vars[0];
3742 newbound = reoptconsdata->vals[0];
3743 boundtype = reoptconsdata->boundtypes[0];
3754 newbound = reoptconsdata->vals[0] - 1.0;
3755 assert(
SCIPisLE(scip, newbound, oldub));
3759 newbound = reoptconsdata->vals[0] + 1.0;
3760 assert(
SCIPisGE(scip, newbound, oldlb));
3792 assert(!reoptconsdata->linear);
3793 assert(reoptconsdata->vars !=
NULL);
3794 assert(reoptconsdata->vals !=
NULL);
3795 assert(reoptconsdata->boundtypes !=
NULL);
3801 for( v = 0; v < reoptconsdata->nvars; v++ )
3819 SCIPerrorMessage(
"Variable <%s> has to be either binary, (implied) integer, or continuous.\n",
3834 if( reoptconsdata->nvars == nbinvars )
3836 for( v = 0; v < reoptconsdata->nvars; v++ )
3838 consvars[v] = reoptconsdata->vars[v];
3839 consval = reoptconsdata->vals[v];
3863 assert(nintvars > 0 || ncontvars > 0);
3870 for( v = 0; v < reoptconsdata->nvars; v++ )
3872 consvars[v] = reoptconsdata->vars[v];
3873 consvals[v] = reoptconsdata->vals[v];
3874 consboundtypes[v] = reoptconsdata->boundtypes[v];
3908 consvals,
FALSE,
FALSE,
TRUE,
FALSE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE) );
3916 #ifdef SCIP_DEBUG_CONSS 3953 assert(reopt !=
NULL);
3954 assert(
set !=
NULL);
3955 assert(stat !=
NULL);
3956 assert(transprob !=
NULL);
3957 assert(origprob !=
NULL);
3958 assert(tree !=
NULL);
3960 assert(branchcand !=
NULL);
3961 assert(eventqueue !=
NULL);
3962 assert(cliquetable !=
NULL);
3963 assert(node !=
NULL);
3964 assert(blkmem !=
NULL);
3967 assert(reopttree !=
NULL);
3968 assert(0 <
id && id < reopttree->reoptnodessize);
3971 assert(reoptnode !=
NULL);
3978 for( v = 0; v < reoptnode->
dualredscur->nvars; v++ )
3987 boundtype = reoptnode->
dualredscur->boundtypes[v];
4017 #ifdef SCIP_MORE_DEBUG 4027 pos = reoptnode->
nvars;
4029 reoptnode->
vars[pos] = var;
4041 if( updatedualconss )
4082 assert(reopt !=
NULL);
4083 assert(
set !=
NULL);
4084 assert(stat !=
NULL);
4085 assert(transprob !=
NULL);
4086 assert(origprob !=
NULL);
4087 assert(tree !=
NULL);
4089 assert(branchcand !=
NULL);
4090 assert(eventqueue !=
NULL);
4091 assert(cliquetable !=
NULL);
4092 assert(node !=
NULL);
4093 assert(perm !=
NULL);
4094 assert(vars !=
NULL);
4095 assert(vals !=
NULL);
4096 assert(boundtypes !=
NULL);
4098 assert(blkmem !=
NULL);
4099 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
4107 assert(reopttree !=
NULL);
4110 assert(reoptnode !=
NULL);
4115 nbndchgs =
MIN(negbndchg, nvars);
4118 for( v = 0; v < nbndchgs; v++ )
4120 var = vars[perm[v]];
4121 val = vals[perm[v]];
4122 boundtype = boundtypes[perm[v]];
4128 if( v == nbndchgs-1 )
4156 #ifdef SCIP_MORE_DEBUG 4179 assert(scip !=
NULL);
4180 assert(reopt !=
NULL);
4182 assert(
set !=
NULL);
4183 assert(stat !=
NULL);
4184 assert(blkmem !=
NULL);
4185 assert(node !=
NULL);
4186 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
4200 assert(reoptconsdata !=
NULL);
4201 assert(reoptconsdata->nvars > 0);
4202 assert(reoptconsdata->varssize >= reoptconsdata->nvars);
4214 if( reoptconsdata->linear )
4217 reoptconsdata->lhs, reoptconsdata->rhs,
FALSE,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE) );
4221 assert(reoptconsdata->boundtypes !=
NULL);
4223 reoptconsdata->vals,
FALSE,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
TRUE) );
4225 #ifdef SCIP_DEBUG_CONSS 4241 assert(reopt !=
NULL);
4268 unsigned int* cutoffchilds;
4269 int ncutoffchilds = 0;
4270 unsigned int* redchilds;
4274 assert(reopt !=
NULL);
4276 assert(id < reopt->reopttree->reoptnodessize);
4292 for( c = 0; c < reoptnode->
nchilds; c++ )
4300 unsigned int childid;
4307 assert(childid < reopt->reopttree->reoptnodessize);
4309 assert(child !=
NULL);
4310 #ifdef SCIP_MORE_DEBUG 4313 if( child->
nvars > 0 )
4318 for( v = 0; v < child->
nvars && !cutoff; v++ )
4326 transvar = child->
vars[v];
4339 SCIPsetDebugMsg(
set,
" -> <%s> is fixed to %g, can not change bound to %g -> cutoff\n",
4349 SCIPsetDebugMsg(
set,
" -> <%s> is already fixed to %g -> redundant bound change\n",
4352 redundantvars[nredundantvars] = v;
4357 if( !cutoff && nredundantvars > 0 )
4359 for( v = 0; v < nredundantvars; v++ )
4362 child->
vars[redundantvars[v]] = child->
vars[child->
nvars-1];
4372 else if( child->
nconss == 0 )
4380 cutoffchilds[ncutoffchilds] = childid;
4383 else if( redundant )
4385 redchilds[nredchilds] = childid;
4390 SCIPsetDebugMsg(
set,
"-> found %d redundant and %d infeasible nodes\n", nredchilds, ncutoffchilds);
4393 while( ncutoffchilds > 0 )
4400 while( reoptnode->
childids[c] != cutoffchilds[ncutoffchilds-1] && c < reoptnode->nchilds )
4402 assert(reoptnode->
childids[c] == cutoffchilds[ncutoffchilds-1]);
4413 while( nredchilds > 0 )
4417 while( reoptnode->
childids[c] != redchilds[nredchilds-1] && c < reoptnode->nchilds )
4419 assert(reoptnode->
childids[c] == redchilds[nredchilds-1]);
4449 for( cc = 0; cc < ncc; cc++ )
4484 assert(reopttree !=
NULL);
4485 assert(id < reopttree->reoptnodessize);
4503 assert(reopt !=
NULL);
4504 assert(id < reopt->reopttree->reoptnodessize);
4510 unsigned int childid;
4513 assert(childid < reopt->reopttree->reoptnodessize);
4529 unsigned int* leaves,
4537 assert(reopt !=
NULL);
4538 assert(leavessize > 0 && leaves !=
NULL);
4539 assert((*nleaves) >= 0);
4540 assert(id < reopt->reopttree->reoptnodessize);
4545 unsigned int childid;
4547 assert(*nleaves <= leavessize);
4550 assert(childid < reopt->reopttree->reoptnodessize);
4564 (*nleaves) += nleaves2;
4580 assert(reopt !=
NULL);
4581 assert(
set !=
NULL);
4582 assert(blkmem !=
NULL);
4605 assert(reopt !=
NULL);
4607 assert(
set !=
NULL);
4608 assert(blkmem !=
NULL);
4640 assert(reopt !=
NULL);
4641 assert(
set !=
NULL);
4642 assert(blkmem !=
NULL);
4643 assert(origvars !=
NULL);
4644 assert(norigvars >= 0);
4653 for( i = 0; i < reopt->
run-1; i++ )
4656 for( v = reopt->
nobjvars-1; v < norigvars; v++ )
4657 reopt->
objs[i][v] = 0.0;
4664 for( v = 0; v < norigvars; v++ )
4678 for( i = 0; i < reopt->
run; i++ )
4681 for( j = reopt->
nobjvars; j < newsize; j++ )
4682 reopt->
objs[i][j] = 0.0;
4686 assert(0 <= probidx && probidx < reopt->nobjvars);
4696 if( reopt->
firstobj == -1 && reopt->
objs[reopt->
run-1][probidx] != 0 )
4701 if( reopt->
run-1 >= 1 )
4733 assert(
set !=
NULL);
4734 assert(perm !=
NULL);
4735 assert(vars !=
NULL);
4736 assert(bounds !=
NULL);
4737 assert(boundtypes !=
NULL);
4743 for( v = 0; v < nvars; v++ )
4785 assert(reopt !=
NULL);
4786 assert(sol !=
NULL);
4787 assert(blkmem !=
NULL);
4788 assert(
set !=
NULL);
4789 assert(stat !=
NULL);
4790 assert(vars !=
NULL);
4802 for( v = 0, w = 0; v < nvars; v++ )
4805 assert(nbinvars + nintvars == w);
4816 origvars[v] = vars[v];
4817 assert(origvars[v] !=
NULL);
4845 #undef SCIPreoptGetNRestartsGlobal 4846 #undef SCIPreoptGetNRestartsLocal 4847 #undef SCIPreoptGetNTotalRestartsLocal 4848 #undef SCIPreoptGetFirstRestarts 4849 #undef SCIPreoptGetLastRestarts 4850 #undef SCIPreoptGetNFeasNodes 4851 #undef SCIPreoptGetNTotalFeasNodes 4852 #undef SCIPreoptGetNPrunedNodes 4853 #undef SCIPreoptGetNTotalPrunedNodes 4854 #undef SCIPreoptGetNCutoffReoptnodes 4855 #undef SCIPreoptGetNTotalCutoffReoptnodes 4856 #undef SCIPreoptGetNInfNodes 4857 #undef SCIPreoptGetNTotalInfNodes 4858 #undef SCIPreoptGetNInfSubtrees 4866 assert(reopt !=
NULL);
4876 assert(reopt !=
NULL);
4886 assert(reopt !=
NULL);
4896 assert(reopt !=
NULL);
4906 assert(reopt !=
NULL);
4916 assert(reopt !=
NULL);
4926 assert(reopt !=
NULL);
4936 assert(reopt !=
NULL);
4946 assert(reopt !=
NULL);
4956 assert(reopt !=
NULL);
4966 assert(reopt !=
NULL);
4976 assert(reopt !=
NULL);
4986 assert(reopt !=
NULL);
5001 assert(reopt !=
NULL);
5006 (*reopt)->simtolastobj = -2.0;
5007 (*reopt)->simtofirstobj = -2.0;
5008 (*reopt)->firstobj = -1;
5009 (*reopt)->currentnode = -1;
5010 (*reopt)->lastbranched = -1;
5011 (*reopt)->dualreds =
NULL;
5012 (*reopt)->glbconss =
NULL;
5013 (*reopt)->nglbconss = 0;
5014 (*reopt)->allocmemglbconss = 0;
5015 (*reopt)->ncheckedsols = 0;
5016 (*reopt)->nimprovingsols = 0;
5017 (*reopt)->noptsolsbyreoptsol = 0;
5018 (*reopt)->nglbrestarts = 0;
5019 (*reopt)->nlocrestarts = 0;
5020 (*reopt)->ntotallocrestarts = 0;
5021 (*reopt)->firstrestart = -1;
5022 (*reopt)->lastrestart = 0;
5023 (*reopt)->nobjvars = 0;
5024 (*reopt)->objhaschanged =
FALSE;
5025 (*reopt)->consadded =
FALSE;
5026 (*reopt)->addedconss =
NULL;
5027 (*reopt)->naddedconss = 0;
5028 (*reopt)->addedconsssize = 0;
5029 (*reopt)->glblb =
NULL;
5030 (*reopt)->glbub =
NULL;
5031 (*reopt)->activeconss =
NULL;
5037 for( i = 0; i < (*reopt)->runsize; i++ )
5039 (*reopt)->objs[i] =
NULL;
5040 (*reopt)->prevbestsols[i] =
NULL;
5041 (*reopt)->varhistory[i] =
NULL;
5063 eventExitsolReopt,
NULL, eventExecReopt,
NULL) );
5065 assert(eventhdlr !=
NULL);
5078 assert(reopt !=
NULL);
5079 assert(*reopt !=
NULL);
5080 assert(
set !=
NULL);
5082 assert(blkmem !=
NULL);
5094 for( p = (*reopt)->run-1; p >= 0; p-- )
5096 if( (*reopt)->soltree->sols[p] !=
NULL )
5099 (*reopt)->soltree->sols[p] =
NULL;
5105 if( set->reopt_sepabestsol && (*reopt)->prevbestsols[p] !=
NULL )
5110 if( (*reopt)->objs[p] !=
NULL )
5120 if( (*reopt)->dualreds !=
NULL )
5122 if( (*reopt)->dualreds->varssize > 0 )
5124 assert(!(*reopt)->dualreds->linear);
5130 (*reopt)->dualreds =
NULL;
5134 if( (*reopt)->glbconss !=
NULL && (*reopt)->allocmemglbconss > 0 )
5139 for( c = 0; c < (*reopt)->allocmemglbconss; c++ )
5141 if( (*reopt)->glbconss[c] !=
NULL )
5143 if( (*reopt)->glbconss[c]->varssize > 0 )
5148 (*reopt)->glbconss[c]->varssize = 0;
5151 --(*reopt)->nglbconss;
5155 assert((*reopt)->nglbconss == 0);
5158 (*reopt)->allocmemglbconss = 0;
5165 if( (*reopt)->addedconss !=
NULL )
5168 for( c = 0; c < (*reopt)->naddedconss; c++)
5170 assert((*reopt)->addedconss[c] !=
NULL);
5198 assert(reopt !=
NULL);
5199 assert(node !=
NULL);
5202 assert(id < reopt->reopttree->reoptnodessize);
5233 assert(reopt !=
NULL);
5234 assert(
set !=
NULL);
5235 assert(sol !=
NULL);
5251 SCIP_CALL(
soltreeAddSol(reopt,
set, stat, origprimal, blkmem, vars, sol, &solnode, nvars, bestsol, added) );
5255 assert(solnode !=
NULL);
5261 assert(reopt->
soltree->
nsols[run-1] <= set->reopt_savesols);
5281 assert(reopt !=
NULL);
5282 assert(reopt->
run-1 >= 0);
5283 assert(sol !=
NULL);
5284 assert(blkmem !=
NULL);
5285 assert(
set !=
NULL);
5286 assert(stat !=
NULL);
5287 assert(origprimal !=
NULL);
5293 if( set->reopt_sepabestsol )
5311 assert(reopt !=
NULL);
5312 assert(
set !=
NULL);
5313 assert(blkmem !=
NULL);
5314 assert(origvars !=
NULL);
5342 assert(reopt !=
NULL);
5353 assert(reopt !=
NULL);
5363 assert(reopt !=
NULL);
5374 assert(reopt !=
NULL);
5385 assert(reopt !=
NULL);
5386 assert(0 < run && run <= reopt->runsize);
5402 assert(reopt !=
NULL);
5404 for( r = 0; r < reopt->
run; r++)
5421 assert(reopt !=
NULL);
5422 assert(run > 0 && run <= reopt->run);
5423 assert(sols !=
NULL);
5425 assert(solssize > 0);
5426 assert(nsols !=
NULL);
5435 if( solssize < (*nsols) )
5459 assert(reopt !=
NULL);
5492 assert(reopt !=
NULL);
5493 assert(
set !=
NULL);
5494 assert(blkmem !=
NULL);
5495 assert(transvars !=
NULL);
5496 assert(ntransvars >= 0);
5497 assert(restart !=
NULL);
5505 if( reopt->
run > 1 && set->reopt_objsimdelay > -1.0 )
5516 SCIPsetDebugMsg(
set,
"-> restart reoptimization (objective functions are not similar enough)\n");
5522 SCIPsetDebugMsg(
set,
"-> restart reoptimization (node limit reached)\n");
5528 SCIPsetDebugMsg(
set,
"-> restart reoptimization (found last %d optimal solutions by <reoptsols>)\n",
5553 assert(reopt !=
NULL);
5562 assert(reopt !=
NULL);
5576 assert(reopt !=
NULL);
5577 assert(run1 > 0 && run1 <= reopt->run);
5578 assert(run2 > 0 && run2 <= reopt->run);
5579 assert(origvars !=
NULL);
5580 assert(norigvars >= 0);
5582 return reoptSimilarity(reopt,
set, run1-1, run2-1, origvars, norigvars);
5590 assert(reopt !=
NULL);
5593 if( reopt->
run-2 < 0 )
5605 assert(reopt !=
NULL);
5607 assert(id < reopt->reopttree->reoptnodessize);
5620 assert(reopt !=
NULL);
5621 assert(0 < run && run <= reopt->runsize);
5623 return reopt->
objs[run-1][idx];
5635 assert(reopt !=
NULL);
5636 assert(0 < run && run <= reopt->run);
5650 assert(reopt !=
NULL);
5651 assert(
set !=
NULL);
5652 assert(blkmem !=
NULL);
5660 assert(cons !=
NULL);
5680 assert(reopt !=
NULL);
5687 while( child !=
NULL )
5702 assert(reopt !=
NULL);
5708 assert(id < reopt->reopttree->reoptnodessize);
5714 assert(0 <
id && id < reopt->reopttree->reoptnodessize);
5727 #undef SCIPreoptnodeGetNVars 5728 #undef SCIPreoptnodeGetNConss 5729 #undef SCIPreoptnodeGetNDualBoundChgs 5730 #undef SCIPreoptnodeGetNChildren 5731 #undef SCIPreoptnodeGetLowerbound 5732 #undef SCIPreoptnodeGetType 5739 assert(reoptnode !=
NULL);
5749 assert(reoptnode !=
NULL);
5751 return reoptnode->
nconss;
5759 assert(reoptnode !=
NULL);
5772 assert(reoptnode !=
NULL);
5782 assert(reoptnode !=
NULL);
5792 assert(reoptnode !=
NULL);
5810 assert(reoptnode !=
NULL);
5811 assert(vars !=
NULL);
5812 assert(bounds !=
NULL);
5813 assert(boundtypes !=
NULL);
5814 assert(nvars !=
NULL);
5815 assert(nconss !=
NULL);
5817 (*nconss) = reoptnode->
nconss;
5822 for( c = 0; c < *nconss; c++ )
5824 assert(vars[c] !=
NULL);
5825 assert(bounds[c] !=
NULL);
5827 vars[c] = reoptnode->
conss[c]->vars;
5828 bounds[c] = reoptnode->
conss[c]->vals;
5829 boundtypes[c] = reoptnode->
conss[c]->boundtypes;
5830 nvars[c] = reoptnode->
conss[c]->nvars;
5837 unsigned int parentid
5840 assert(reoptnode !=
NULL);
5841 assert(parentid <= 536870911);
5856 assert(reopt !=
NULL);
5859 assert(id < reopt->reopttree->reoptnodessize);
5867 unsigned int childid;
5870 assert(childid < reopt->reopttree->reoptnodessize);
5889 assert(reopt !=
NULL);
5890 assert(
set !=
NULL);
5891 assert(blkmem !=
NULL);
5892 assert(node !=
NULL);
5894 if( set->reopt_sepaglbinfsubtrees )
5917 int effectiverootdepth
5922 assert(reopt !=
NULL);
5923 assert(
set !=
NULL);
5924 assert(blkmem !=
NULL);
5926 assert(node !=
NULL);
5974 lowerbound =
MIN(lowerbound, cutoffbound);
5979 isrootnode, lowerbound) );
5996 SCIPsetDebugMsg(
set,
" -> focusnode : %s\n", isfocusnode ?
"yes" :
"no");
5998 SCIPsetDebugMsg(
set,
" -> strong branched : %s\n", strongbranched ?
"yes" :
"no");
6005 assert(isfocusnode);
6034 if( strongbranched )
6106 assert(isfocusnode);
6118 if( strongbranched )
6144 if( strongbranched )
6188 assert(reopt !=
NULL);
6189 assert(node !=
NULL);
6212 allocmem = reopt->
dualreds->nvars + resizelength;
6217 assert(reopt->
dualreds->varssize > 0);
6218 assert(reopt->
dualreds->nvars >= 0);
6227 newval = (newval - constant) / scalar;
6228 oldval = (oldval - constant) / scalar;
6234 SCIPerrorMessage(
"cannot store equal bounds: old = %g, new = %g\n", oldval, newval);
6270 int ndualbndchgs = 0;
6272 assert(reopt !=
NULL);
6273 assert(node !=
NULL);
6278 ndualbndchgs = reopt->
dualreds->nvars;
6281 return ndualbndchgs;
6290 unsigned int* childs,
6298 assert(reopt !=
NULL);
6299 assert(childssize > 0 && childs !=
NULL);
6300 assert(nchilds !=
NULL);
6310 assert(id < reopt->reopttree->reoptnodessize);
6327 if( childssize < *nchilds )
6330 for( c = 0; c < *nchilds; c++ )
6341 unsigned int* leaves,
6349 assert(reopt !=
NULL);
6350 assert(leavessize > 0 && leaves !=
NULL);
6351 assert((*nleaves) >= 0);
6360 if(
id == 0 && node !=
NULL )
6366 assert(id < reopt->reopttree->reoptnodessize);
6369 for( i = 0; i < leavessize; i++ )
6375 unsigned int childid;
6377 assert(*nleaves + 1 <= leavessize);
6380 assert(childid < reopt->reopttree->reoptnodessize);
6394 (*nleaves) += nleaves2;
6417 assert(reopt !=
NULL);
6418 assert(
set !=
NULL);
6419 assert(blkmem !=
NULL);
6420 assert(nleaves >= 0);
6421 assert(nleaves == 0 || leaves !=
NULL);
6422 assert(nchilds >= 0);
6423 assert(nchilds == 0 || childs !=
NULL);
6424 assert(nsiblings >= 0);
6425 assert(nsiblings == 0 || siblings !=
NULL);
6427 SCIPsetDebugMsg(
set,
"save unprocessed nodes (%d leaves, %d children, %d siblings)\n", nleaves, nchilds, nsiblings);
6430 for( n = 0; n < nleaves; n++ )
6437 for( n = 0; n < nchilds; n++ )
6444 for( n = 0; n < nsiblings; n++ )
6472 assert(reopt !=
NULL);
6473 assert(stat !=
NULL);
6476 if( !set->reopt_storevarhistory )
6481 bestrun = reopt->
run-2;
6485 for( r = reopt->
run-3; r >= 0 && reopt->
objhaschanged && set->reopt_usepscost; r-- )
6502 for( v = 0; v < nvars; v++ )
6507 assert(transvar !=
NULL);
6514 assert(0 <= idx && idx <= nvars);
6517 for( d = 0; d <= 1; d++ )
6541 (d == 0 ?
"down" :
"up"), avginference[d], avgcutoff[d]);
6560 assert(reopt !=
NULL);
6561 assert(stat !=
NULL);
6562 assert(blkmem !=
NULL);
6565 if( !set->reopt_storevarhistory )
6575 for( v = 0; v < nvars; v++ )
6582 for( v = 0; v < nvars; v++ )
6589 assert(idx >= 0 && idx < nvars);
6592 assert(transvar !=
NULL);
6611 int nrepresentatives,
6619 assert(reopt !=
NULL);
6620 assert(
set !=
NULL);
6621 assert(blkmem !=
NULL);
6622 assert(representatives !=
NULL);
6623 assert(nrepresentatives > 0);
6639 for( r = 0; r < nrepresentatives; r++ )
6643 assert(1 <=
id && id < reopttree->reoptnodessize);
6654 if( representatives[r]->nvars > 0 )
6658 assert(representatives[r]->nvars <= representatives[r]->varssize);
6660 for( v = 0; v < representatives[r]->
nvars; v++ )
6667 if( representatives[r]->nconss > 0 )
6671 assert(representatives[r]->nconss <= representatives[r]->consssize);
6673 for( c = 0; c < representatives[r]->
nconss; c++ )
6676 representatives[r]->
conss[c]->vals, representatives[r]->
conss[c]->boundtypes,
6677 representatives[r]->
conss[c]->lhs, representatives[r]->
conss[c]->rhs,
6678 representatives[r]->
conss[c]->nvars, representatives[r]->
conss[c]->constype,
6679 representatives[r]->
conss[c]->linear) );
6700 SCIPsetDebugMsg(
set,
"-> new tree consists of %d nodes, the root has %d child nodes.\n",
6722 assert(reopt !=
NULL);
6723 assert(
set !=
NULL);
6724 assert(blkmem !=
NULL);
6725 assert(consdata !=
NULL);
6726 assert(dualreds !=
NULL);
6731 consdata->boundtypes =
NULL;
6733 consdata->varssize = dualreds->nvars;
6734 consdata->nvars = dualreds->nvars;
6736 consdata->linear =
TRUE;
6739 consdata->lhs = 1.0;
6742 for( v = 0; v < consdata->nvars; v++ )
6744 assert(consdata->vars[v] !=
NULL);
6750 consdata->vals[v] = 1.0;
6762 consdata->vals[v] = -1.0;
6763 consdata->lhs -= 1.0;
6785 assert(reopt !=
NULL);
6786 assert(
set !=
NULL);
6787 assert(blkmem !=
NULL);
6788 assert(consdata !=
NULL);
6789 assert(dualreds !=
NULL);
6796 consdata->varssize = dualreds->nvars;
6797 consdata->nvars = dualreds->nvars;
6799 consdata->linear =
FALSE;
6805 for( v = 0; v < consdata->nvars; v++ )
6809 assert(consdata->vars[v] !=
NULL);
6818 consdata->vals[v] =
MIN(consdata->vals[v]+1.0, glbbd);
6824 consdata->vals[v] =
MAX(glbbd, consdata->vals[v]-1.0);
6839 int* ncreatedchilds,
6856 assert(reopt !=
NULL);
6857 assert(
set !=
NULL);
6858 assert(stat !=
NULL);
6859 assert(blkmem !=
NULL);
6862 assert(reopttree !=
NULL);
6865 assert(reoptnodes !=
NULL);
6866 assert(reoptnodes[0] !=
NULL);
6867 assert(reoptnodes[0]->dualreds);
6870 nchilds = reoptnodes[0]->
nchilds;
6872 assert(reoptnodes[0]->dualredscur !=
NULL);
6875 (*ncreatedchilds) = 0;
6885 assert(reoptnodes[
id] ==
NULL || reoptnodes[
id]->nvars == 0);
6898 assert(reoptnodes[
id]->varssize >= nbndchgs);
6899 assert(reoptnodes[
id]->nvars == 0);
6900 assert(reoptnodes[
id]->vars !=
NULL);
6901 assert(reoptnodes[
id]->varbounds !=
NULL);
6902 assert(reoptnodes[
id]->varboundtypes !=
NULL);
6905 if( !set->reopt_usesplitcons )
6907 assert(perm ==
NULL);
6912 for( v = 0; v < nbndchgs; v++ )
6917 ++reoptnodes[id]->
nvars;
6920 if( !set->reopt_usesplitcons )
6923 assert(reoptnodes[
id]->nvars == reoptnodes[0]->dualredscur->
nvars);
6927 assert(reoptnodes[0]->nchilds == 0);
6932 ++(*ncreatedchilds);
6934 if( set->reopt_usesplitcons )
6940 assert(*ncreatedchilds == 1);
6961 consdata = reoptnodes[id]->
conss[0];
6964 for( v = 0; v < nbndchgs; v++ )
6984 if( nbinvars == nbndchgs )
6991 assert(nintvars > 0 || ncontvars > 0);
6997 ++(*ncreatedchilds);
7005 assert(*ncreatedchilds == 1);
7006 assert(perm !=
NULL);
7010 boundtypes = reoptnodes[0]->
dualredscur->boundtypes;
7012 assert(perm[0] == 0 && perm[nvars-1] == nvars-1);
7015 switch (set->reopt_varorderinterdiction)
7036 for( c = 0; c < nvars; c++ )
7043 assert(reoptnodes[
id] ==
NULL || reoptnodes[
id]->nvars == 0);
7055 assert(reoptnodes[
id]->varssize >= perm[c]+1);
7056 assert(reoptnodes[
id]->nvars == 0);
7057 assert(reoptnodes[
id]->vars !=
NULL);
7058 assert(reoptnodes[
id]->varbounds !=
NULL);
7059 assert(reoptnodes[
id]->varboundtypes !=
NULL);
7062 if( set->reopt_varorderinterdiction ==
'd' )
7065 for( v = 0; v < c; v++ )
7067 reoptnodes[id]->
vars[v] = vars[v];
7068 reoptnodes[id]->
varbounds[v] = bounds[v];
7075 for( v = 0; v < c; v++ )
7077 reoptnodes[id]->
vars[v] = vars[perm[v]];
7078 reoptnodes[id]->
varbounds[v] = bounds[perm[v]];
7082 reoptnodes[id]->
nvars += c;
7086 reoptnodes[id]->
vars[c] = vars[perm[c]];
7087 reoptnodes[id]->
varbounds[c] = bounds[perm[c]];
7096 ++reoptnodes[id]->
nvars;
7101 ++(*ncreatedchilds);
7104 assert(*ncreatedchilds == nvars+1);
7109 assert(perm ==
NULL);
7112 assert(reoptnodes[0]->dualredscur->
vars !=
NULL);
7113 assert(reoptnodes[0]->dualredscur->vals !=
NULL);
7114 assert(reoptnodes[0]->dualredscur->boundtypes !=
NULL);
7134 assert(reopt !=
NULL);
7135 assert(node !=
NULL);
7138 assert(id < reopt->reopttree->reoptnodessize);
7159 int* nbndchgsafterdual
7165 int nafterdualvars2;
7167 assert(reopt !=
NULL);
7168 assert(reoptnode !=
NULL);
7169 assert(vars !=
NULL);
7170 assert(vals !=
NULL);
7171 assert(boundtypes !=
NULL);
7173 (*nbndchgs) = reoptnode->
nvars;
7177 if( varssize == 0 || varssize < *nbndchgs + *nbndchgsafterdual )
7181 for( v = 0; v < *nbndchgs; v++ )
7183 vars[v] = reoptnode->
vars[v];
7189 for( ; v < *nbndchgs + *nbndchgsafterdual; v++ )
7202 SCIPreoptnodeGetPath(reopt, parent, &vars[v], &vals[v], &boundtypes[v], varssize, &nvars2, &nafterdualvars2);
7204 (*nbndchgs) += nvars2;
7205 (*nbndchgsafterdual) += nafterdualvars2;
7217 assert(reopt !=
NULL);
7219 assert(id < reopt->reopttree->reoptnodessize);
7221 assert(blkmem !=
NULL);
7247 int* ncreatedchilds,
7253 assert(reopt !=
NULL);
7254 assert(scip !=
NULL);
7255 assert(
set !=
NULL);
7256 assert(stat !=
NULL);
7257 assert(transprob !=
NULL);
7258 assert(origprob !=
NULL);
7259 assert(tree !=
NULL);
7261 assert(branchcand !=
NULL);
7262 assert(eventqueue !=
NULL);
7263 assert(cliquetable !=
NULL);
7264 assert(blkmem !=
NULL);
7265 assert(reoptnode !=
NULL);
7266 assert(childnodes !=
NULL);
7268 assert(id < reopt->reopttree->reoptnodessize);
7269 assert(success !=
NULL);
7284 if( set->reopt_usesplitcons )
7286 if( reoptnode->
reopttype == (
unsigned int)SCIP_REOPTTYPE_INFSUBTREE )
7290 (*ncreatedchilds) = 1;
7296 (*ncreatedchilds) = 2;
7302 if( childnodessize < *ncreatedchilds )
7306 for( c = 0; c < *ncreatedchilds; c++ )
7316 cliquetable, blkmem, childnodes[c],
id, c == 1) );
7332 SCIP_CALL(
addSplitcons(reopt, scip,
set, stat, blkmem, transprob, origprob, tree, lp, branchcand,
7333 eventqueue, cliquetable, childnodes[c],
id) );
7357 if( reoptnode->
nconss == 0 )
7364 SCIP_CALL(
fixBounds(reopt,
set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, cliquetable,
7365 blkmem, childnodes[c],
id,
TRUE) );
7396 *ncreatedchilds = nvars+1;
7400 if( childnodessize < *ncreatedchilds )
7405 for( c = 0; c < nvars; c++ )
7409 switch (set->reopt_varorderinterdiction)
7439 for( c = nvars; c >= 0; c-- )
7444 #ifdef SCIP_MORE_DEBUG 7450 cliquetable, blkmem, childnodes[c],
id,
FALSE) );
7456 SCIP_CALL(
fixBounds(reopt,
set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, cliquetable,
7457 blkmem, childnodes[c],
id,
TRUE) );
7468 SCIP_CALL(
fixInterdiction(reopt,
set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, cliquetable,
7469 blkmem, childnodes[c],
id, perm, vars, bounds, boundtypes, nvars, c) );
7498 (*ncreatedchilds) = 1;
7501 if( childnodessize < *ncreatedchilds )
7510 cliquetable, blkmem, childnodes[0],
id,
FALSE) );
7520 assert(reoptnode->
reopttype != (
unsigned int)SCIP_REOPTTYPE_INFSUBTREE
7538 assert(reopt !=
NULL);
7555 assert(scip !=
NULL);
7556 assert(reopt !=
NULL);
7557 assert(
set !=
NULL);
7558 assert(stat !=
NULL);
7559 assert(blkmem !=
NULL);
7564 for( c = reopt->
nglbconss-1; c >= 0; c-- )
7572 assert(reopt->
glbconss[c]->nvars > 0);
7580 for( v = 0; v < reopt->
glbconss[c]->nvars; v++ )
7589 SCIPerrorMessage(
"Expected variable type binary or (impl.) integer for variable <%s> in global constraint at pos. %d.\n",
7600 if( nbinvars == reopt->
glbconss[c]->nvars )
7602 SCIPsetDebugMsg(
set,
"-> add logic-or constraints with %d binvars\n", nbinvars);
7607 for( v = 0; v < reopt->
glbconss[c]->nvars; v++ )
7609 consvars[v] = reopt->
glbconss[c]->vars[v];
7622 consvars,
FALSE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
FALSE) );
7630 assert(reopt->
glbconss[c]->nvars == nbinvars + 2*nintvars);
7632 SCIPsetDebugMsg(
set,
"-> add bounddisjuction constraints with %d binvars, %d intvars\n", nbinvars, (
int) (2*nintvars));
7639 #ifdef SCIP_DEBUG_CONSS 7684 assert(reopt !=
NULL);
7685 assert(node !=
NULL);
7686 assert(sepastore !=
NULL);
7687 assert(blkmem !=
NULL);
7688 assert(
set !=
NULL);
7689 assert(stat !=
NULL);
7690 assert(eventqueue !=
NULL);
7691 assert(eventfilter !=
NULL);
7695 assert(id < reopt->reopttree->reoptnodessize);
7702 assert(reoptnode !=
NULL);
7705 for( c = reoptnode->
nconss-1; c >= 0; c-- )
7709 cons = reoptnode->
conss[c];
7710 assert(cons !=
NULL);
7725 for( v = 0; v < cons->nvars; v++ )
7732 assert(transvar !=
NULL);
7735 vals[ncols] = cons->vals[v];
7737 assert(cols[ncols] !=
NULL);
7741 assert(ncols == cons->nvars);
7748 SCIP_CALL(
SCIProwCreate(&cut, blkmem,
set, stat, lp, cutname, ncols, cols, vals, cons->lhs, cons->rhs,
7752 SCIPsetDebugMsg(
set,
"add cut <%s> of size %d to cutpool, [lhs, rhs] = [%g,%g] to node %lld\n", cutname,
7757 SCIP_CALL(
SCIProwCreate(&cut, blkmem,
set, stat, lp, cutname, ncols, cols, vals, cons->lhs, cons->rhs,
7759 SCIP_CALL(
SCIPsepastoreAddCut(sepastore, blkmem,
set, stat, eventqueue, eventfilter, lp,
NULL, cut,
FALSE, root,
7762 SCIPsetDebugMsg(
set,
"add cut <%s> of size %d to sepastore, [lhs, rhs] = [%g,%g] to node %lld\n", cutname,
7786 for( i = c-1; i >= 0; i-- )
7805 assert(reopt !=
NULL);
7806 assert(node !=
NULL);
7810 assert(id < reopt->reopttree->reoptnodessize);
7817 if(
SCIPsetIsGE(
set, set->reopt_objsimrootlp, 1.0) )
7849 assert(reoptnode !=
NULL);
7850 assert(
set !=
NULL);
7858 reoptnode->
nvars = 0;
7884 assert(reopt !=
NULL);
7885 assert(
set !=
NULL);
7886 assert(blkmem !=
NULL);
7887 assert(reoptnode !=
NULL);
7900 assert(reoptnode !=
NULL);
7901 assert(blkmem !=
NULL);
7920 assert(reoptnode !=
NULL);
7921 assert(var !=
NULL);
7922 assert(blkmem !=
NULL);
7924 nvars = reoptnode->
nvars;
7928 reoptnode->
vars[nvars] = var;
7953 assert(reoptnode !=
NULL);
7954 assert(
set !=
NULL);
7955 assert(vars !=
NULL);
7956 assert(bounds !=
NULL);
7959 assert(blkmem !=
NULL);
7966 SCIPsetDebugMsg(
set,
"-> constraint has size 1 -> save as normal bound change.\n");
7982 newbound = bounds[0] + 1.0;
7989 newbound = bounds[0] - 1.0;
8000 nconss = reoptnode->
nconss;
8008 if( boundtypes !=
NULL )
8014 reoptnode->
conss[nconss]->boundtypes =
NULL;
8016 reoptnode->
conss[nconss]->varssize = nvars;
8017 reoptnode->
conss[nconss]->nvars = nvars;
8018 reoptnode->
conss[nconss]->lhs = lhs;
8019 reoptnode->
conss[nconss]->rhs = rhs;
8020 reoptnode->
conss[nconss]->constype = constype;
8021 reoptnode->
conss[nconss]->linear = linear;
8035 assert(reopt !=
NULL);
8036 assert(
set !=
NULL);
8037 assert(blkmem !=
NULL);
8038 assert(cons !=
NULL);
8085 assert(reopt !=
NULL);
8086 assert(transprob !=
NULL);
8097 for( i = 0; i < nvars; i++ )
8123 assert(reopt !=
NULL);
8124 assert(transprob !=
NULL);
8127 conss = transprob->
conss;
8128 nconss = transprob->
nconss;
8133 for( i = 0; i < nconss; i++ )
8161 assert(reopt !=
NULL);
8162 assert(transprob !=
NULL);
8170 for( i = 0; i < nvars; i++ )
8204 assert(reopt !=
NULL);
8210 for( i = 0; i < nentries; i++ )
8219 assert(cons !=
NULL);
8241 assert(reopt !=
NULL);
8242 assert(cons !=
NULL);
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
static int soltreeNInducedSols(SCIP_SOLNODE *solnode)
SCIP_RETCODE SCIPreoptSplitRoot(SCIP_REOPT *reopt, SCIP_TREE *tree, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, int *ncreatedchilds, int *naddedconss)
enum SCIP_BoundType SCIP_BOUNDTYPE
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
void SCIPnodeGetDualBoundchgs(SCIP_NODE *node, SCIP_VAR **vars, SCIP_Real *bounds, SCIP_BOUNDTYPE *boundtypes, int *nvars, int varssize)
SCIP_RETCODE SCIPreoptApplyGlbConss(SCIP *scip, SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem)
#define DEFAULT_MEM_NODES
SCIP_RETCODE SCIPsetIncludeEventhdlr(SCIP_SET *set, SCIP_EVENTHDLR *eventhdlr)
void * SCIPhashmapEntryGetImage(SCIP_HASHMAPENTRY *entry)
SCIP_Real SCIPreoptGetSimToPrevious(SCIP_REOPT *reopt)
SCIP_Bool SCIPsetIsInfinity(SCIP_SET *set, SCIP_Real val)
SCIP_RETCODE SCIPreoptAddDualBndchg(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newval, SCIP_Real oldval)
#define BMSfreeBlockMemoryArrayNull(mem, ptr, num)
internal methods for managing events
int SCIPreoptGetNLeaves(SCIP_REOPT *reopt, SCIP_NODE *node)
SCIP_RETCODE SCIPreoptApply(SCIP_REOPT *reopt, SCIP *scip, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_REOPTNODE *reoptnode, unsigned int id, SCIP_Real estimate, SCIP_NODE **childnodes, int *ncreatedchilds, int *naddedconss, int childnodessize, SCIP_Bool *success)
SCIP_RETCODE SCIPnodeCreateChild(SCIP_NODE **node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_Real nodeselprio, SCIP_Real estimate)
void SCIPhistoryIncNBranchings(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, int depth)
SCIP_Bool SCIPsetIsLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
internal methods for storing primal CIP solutions
static void resetStats(SCIP_REOPT *reopt)
SCIP_RETCODE SCIPeventhdlrCreate(SCIP_EVENTHDLR **eventhdlr, const char *name, const char *desc, SCIP_DECL_EVENTCOPY((*eventcopy)), SCIP_DECL_EVENTFREE((*eventfree)), SCIP_DECL_EVENTINIT((*eventinit)), SCIP_DECL_EVENTEXIT((*eventexit)), SCIP_DECL_EVENTINITSOL((*eventinitsol)), SCIP_DECL_EVENTEXITSOL((*eventexitsol)), SCIP_DECL_EVENTDELETE((*eventdelete)), SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
struct SCIP_ReoptConsData SCIP_REOPTCONSDATA
SCIP_RETCODE SCIPconsActivate(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat, int depth, SCIP_Bool focusnode)
SCIP_RETCODE SCIPreoptApplyCuts(SCIP_REOPT *reopt, SCIP_NODE *node, SCIP_SEPASTORE *sepastore, SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_Bool root)
SCIP_REOPTCONSDATA ** conss
static SCIP_DECL_EVENTEXEC(eventExecReopt)
internal methods for branch and bound tree
void SCIPhistoryIncCutoffSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real weight)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIProwGetAge(SCIP_ROW *row)
static SCIP_RETCODE soltreeAddSol(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem, SCIP_VAR **vars, SCIP_SOL *sol, SCIP_SOLNODE **solnode, int nvars, SCIP_Bool bestsol, SCIP_Bool *added)
SCIP_Real pscostvariance[2]
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_Bool SCIPsetIsFeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPvarChgLbGlobal(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Real newbound)
SCIP_REOPTNODE * SCIPreoptGetReoptnode(SCIP_REOPT *reopt, unsigned int id)
int SCIPreoptGetNImprovingSols(SCIP_REOPT *reopt)
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
static SCIP_RETCODE reoptResetTree(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_Bool softreset)
internal methods for clocks and timing issues
static SCIP_RETCODE reoptMoveIDs(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int id1, unsigned int id2)
void SCIPhistoryIncInferenceSum(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real weight)
int SCIPreoptGetNInfNodes(SCIP_REOPT *reopt)
SCIP_Real * SCIPgetBoundsBounddisjunction(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPreoptGetLeaves(SCIP_REOPT *reopt, SCIP_NODE *node, unsigned int *leaves, int leavessize, int *nleaves)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPqueueInsert(SCIP_QUEUE *queue, void *elem)
int SCIPreoptGetNCutoffReoptnodes(SCIP_REOPT *reopt)
SCIP_NODE * SCIPnodeGetParent(SCIP_NODE *node)
void SCIPnodeGetAddedConss(SCIP_NODE *node, SCIP_CONS **addedconss, int *naddedconss, int addedconsssize)
SCIP_RETCODE SCIPreoptAddSol(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem, SCIP_SOL *sol, SCIP_Bool bestsol, SCIP_Bool *added, SCIP_VAR **vars, int nvars, int run)
void SCIPnodeSetReoptID(SCIP_NODE *node, unsigned int id)
SCIP_RETCODE SCIPreoptAddOptSol(SCIP_REOPT *reopt, SCIP_SOL *sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *origprimal, SCIP_VAR **vars, int nvars)
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
SCIP_RETCODE SCIPreoptAddCons(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_CONS *cons)
SCIP_BOUNDTYPE * afterdualvarboundtypes
int SCIPprobGetNVars(SCIP_PROB *prob)
int SCIProwGetNLPNonz(SCIP_ROW *row)
int SCIPreoptGetNFeasNodes(SCIP_REOPT *reopt)
static SCIP_RETCODE saveConsLinear(SCIP_REOPTCONSDATA *reoptconsdata, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_RETCODE SCIPreoptnodeDelete(SCIP_REOPTNODE **reoptnode, BMS_BLKMEM *blkmem)
static SCIP_RETCODE separateSolution(SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol, SCIP_VAR **vars, int nvars)
SCIP_RETCODE SCIPhistoryCreate(SCIP_HISTORY **history, BMS_BLKMEM *blkmem)
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
int SCIPreoptnodeGetNVars(SCIP_REOPTNODE *reoptnode)
SCIP_Longint lastseennode
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
static SCIP_DECL_EVENTEXITSOL(eventExitsolReopt)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
SCIP_HASHMAP * activeconss
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
SCIP_RETCODE SCIPreoptApplyCompression(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE **representatives, int nrepresentatives, SCIP_Bool *success)
SCIP_Bool SCIPreoptGetSolveLP(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_NODE *node)
void SCIPhistoryReset(SCIP_HISTORY *history)
SCIP_RETCODE SCIPsolCopy(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_SOL *sourcesol)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool SCIPsetIsZero(SCIP_SET *set, SCIP_Real val)
enum SCIP_Retcode SCIP_RETCODE
#define SCIPsetAllocBufferArray(set, ptr, num)
#define BMSfreeBlockMemoryNull(mem, ptr)
int SCIPvarGetProbindex(SCIP_VAR *var)
SCIP_RETCODE SCIPreoptFree(SCIP_REOPT **reopt, SCIP_SET *set, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPreoptnodeAddCons(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **vars, SCIP_Real *bounds, SCIP_BOUNDTYPE *boundtypes, SCIP_Real lhs, SCIP_Real rhs, int nvars, REOPT_CONSTYPE constype, SCIP_Bool linear)
int SCIPsetCalcMemGrowSize(SCIP_SET *set, int num)
SCIP_Real SCIPsetRound(SCIP_SET *set, SCIP_Real val)
void SCIPreoptResetSolMarks(SCIP_REOPT *reopt)
SCIP_RETCODE SCIPvarChgUbGlobal(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Real newbound)
#define BMSallocMemoryArray(ptr, num)
SCIP_REOPTNODE ** reoptnodes
SCIP_Real SCIPvarGetAvgInferences(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
SCIP_Real SCIPreoptGetOldObjCoef(SCIP_REOPT *reopt, int run, int idx)
SCIP_ROW ** SCIPlpGetRows(SCIP_LP *lp)
int SCIPreoptGetNDualBndchgs(SCIP_REOPT *reopt, SCIP_NODE *node)
static SCIP_RETCODE dryBranch(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_Bool *runagain, unsigned int id)
#define DEFAULT_MEM_DUALCONS
static SCIP_RETCODE checkMemDualCons(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, int size)
static SCIP_RETCODE soltreefreeNode(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SOLNODE **solnode)
SCIP_Real SCIPlpGetCutoffbound(SCIP_LP *lp)
SCIP_Bool SCIPreoptConsCanBeDeleted(SCIP_REOPT *reopt, SCIP_CONS *cons)
SCIP_RETCODE SCIProwCreate(SCIP_ROW **row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_ROWORIGINTYPE origintype, void *origin, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
static void soltreeResetMarks(SCIP_SOLNODE *node)
static SCIP_RETCODE reopttreeCheckMemory(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem)
void SCIPsortDownRealInt(SCIP_Real *realarray, int *intarray, int len)
static SCIP_RETCODE reoptGetLeaves(SCIP_REOPT *reopt, unsigned int id, unsigned int *leaves, int leavessize, int *nleaves)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsNegative(SCIP_SET *set, SCIP_Real val)
int SCIPnodeGetDepth(SCIP_NODE *node)
SCIP_ROWORIGINTYPE SCIProwGetOrigintype(SCIP_ROW *row)
static void deleteLastDualBndchgs(SCIP_REOPT *reopt)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPsetFreeBufferArray(set, ptr)
SCIP_Bool SCIPqueueIsEmpty(SCIP_QUEUE *queue)
enum SCIP_LPSolStat SCIP_LPSOLSTAT
#define BMSfreeMemory(ptr)
Constraint handler for the set partitioning / packing / covering constraints .
void SCIPvarAdjustLb(SCIP_VAR *var, SCIP_SET *set, SCIP_Real *lb)
#define SCIPdebugPrintCons(x, y, z)
SCIP_Real SCIPhistoryGetAvgCutoffs(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
int SCIPreoptGetLastRestarts(SCIP_REOPT *reopt)
SCIP_LPSOLSTAT SCIPlpGetSolstat(SCIP_LP *lp)
SCIP_Real SCIPhashmapGetImageReal(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
internal methods for LP management
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
SCIP_Real pscostweightedmean[2]
static SCIP_RETCODE updateConstraintPropagation(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_Bool *transintoorig)
void SCIPnodeGetAncestorBranchings(SCIP_NODE *node, SCIP_VAR **branchvars, SCIP_Real *branchbounds, SCIP_BOUNDTYPE *boundtypes, int *nbranchvars, int branchvarssize)
internal methods for branching and inference history
internal methods for collecting primal CIP solutions and primal informations
SCIP_Real SCIPsolGetVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var)
static SCIP_RETCODE storeCuts(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_LP *lp, unsigned int id)
static SCIP_RETCODE reoptnodeDelete(SCIP_REOPTNODE **reoptnode, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPreoptResetActiveConss(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat)
static SCIP_RETCODE freeReoptTree(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem)
void SCIPreoptnodeGetConss(SCIP_REOPTNODE *reoptnode, SCIP_VAR ***vars, SCIP_Real **bounds, SCIP_BOUNDTYPE **boundtypes, int mem, int *nconss, int *nvars)
SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
int SCIPreoptGetNNodes(SCIP_REOPT *reopt, SCIP_NODE *node)
#define SCIP_EVENTTYPE_NODEFEASIBLE
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
static SCIP_RETCODE tranformDualredsToLinear(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTCONSDATA *consdata, SCIP_REOPTCONSDATA *dualreds)
#define SCIP_EVENTTYPE_NODEBRANCHED
void SCIPqueueClear(SCIP_QUEUE *queue)
SCIP_RETCODE SCIPcreateConsBasicBounddisjunction(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds)
SCIP_Real SCIPreoptGetSimilarity(SCIP_REOPT *reopt, SCIP_SET *set, int run1, int run2, SCIP_VAR **origvars, int norigvars)
static SCIP_RETCODE ensureSolsSize(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, int num, int runidx)
enum SCIP_BranchDir SCIP_BRANCHDIR
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
SCIP_BOUNDTYPE * varboundtypes
SCIP_RETCODE SCIPvarChgLbLocal(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_Real newbound)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
static SCIP_RETCODE freeSolTree(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem)
SCIP_Bool SCIPsetIsLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_REOPTTYPE SCIPnodeGetReopttype(SCIP_NODE *node)
SCIP_RETCODE SCIPreoptGetSolsRun(SCIP_REOPT *reopt, int run, SCIP_SOL **sols, int solssize, int *nsols)
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen)
SCIP_RETCODE SCIPaddReoptDualBndchg(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound, SCIP_Real oldbound)
int SCIPreoptGetNRestartsGlobal(SCIP_REOPT *reopt)
SCIP_Real SCIPeventGetNewbound(SCIP_EVENT *event)
int SCIPreoptGetFirstRestarts(SCIP_REOPT *reopt)
#define BMSduplicateBlockMemoryArray(mem, ptr, source, num)
const char * SCIPheurGetName(SCIP_HEUR *heur)
int SCIPqueueNElems(SCIP_QUEUE *queue)
int SCIPreoptGetNTotalCutoffReoptnodes(SCIP_REOPT *reopt)
int SCIPreoptnodeGetNChildren(SCIP_REOPTNODE *reoptnode)
#define BMSfreeMemoryArray(ptr)
SCIP_VAR ** SCIPgetVarsBounddisjunction(SCIP *scip, SCIP_CONS *cons)
internal methods for storing and manipulating the main problem
static SCIP_RETCODE reoptRestart(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
int SCIPreoptGetNSols(SCIP_REOPT *reopt)
int SCIPhashmapGetNEntries(SCIP_HASHMAP *hashmap)
static SCIP_RETCODE addNode(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_REOPTTYPE reopttype, SCIP_Bool saveafterdual, SCIP_Bool isrootnode, SCIP_Real lowerbound)
SCIP_HASHMAPENTRY * SCIPhashmapGetEntry(SCIP_HASHMAP *hashmap, int entryidx)
static SCIP_RETCODE clearReoptnodes(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_Bool softreset)
void SCIPnodeGetNDomchg(SCIP_NODE *node, int *nbranchings, int *nconsprop, int *nprop)
methods for block memory pools and memory buffers
static SCIP_RETCODE saveAncestorBranchings(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_NODE *parent, unsigned int id, unsigned int parentid)
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
static SCIP_RETCODE deleteChildrenBelow(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int id, SCIP_Bool delnodeitself, SCIP_Bool exitsolve)
static SCIP_RETCODE createReoptnode(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int id)
SCIP_Bool SCIPvarIsTransformedOrigvar(SCIP_VAR *var)
static SCIP_RETCODE transformDualredsToBounddisjunction(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTCONSDATA *consdata, SCIP_REOPTCONSDATA *dualreds)
SCIP_Bool SCIPisReoptEnabled(SCIP *scip)
static int reoptGetNLeaves(SCIP_REOPT *reopt, unsigned int id)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPreoptCreate(SCIP_REOPT **reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
int SCIPreoptGetNTotalInfNodes(SCIP_REOPT *reopt)
void SCIPnodeGetAncestorBranchingsPart(SCIP_NODE *node, SCIP_NODE *parent, SCIP_VAR **branchvars, SCIP_Real *branchbounds, SCIP_BOUNDTYPE *boundtypes, int *nbranchvars, int branchvarssize)
void SCIPhistoryUnite(SCIP_HISTORY *history, SCIP_HISTORY *addhistory, SCIP_Bool switcheddirs)
#define SCIPsetReallocBufferArray(set, ptr, num)
#define BMSallocClearBlockMemoryArray(mem, ptr, num)
internal miscellaneous methods
enum SCIP_ReoptType SCIP_REOPTTYPE
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
static SCIP_RETCODE saveAfterDualBranchings(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_Bool *transintoorig)
SCIP_REOPTCONSDATA * dualreds
static SCIP_RETCODE fixBounds(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_Bool updatedualconss)
static SCIP_RETCODE changeAncestorBranchings(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_Bool afterdualintobranching)
int SCIPgetEffectiveRootDepth(SCIP *scip)
void SCIPreoptnodeInit(SCIP_REOPTNODE *reoptnode, SCIP_SET *set)
static SCIP_RETCODE changeReopttypeOfSubtree(SCIP_REOPTTREE *reopttree, unsigned int id, SCIP_REOPTTYPE reopttype)
internal methods for global SCIP settings
static SCIP_RETCODE transformIntoOrig(SCIP_REOPT *reopt, unsigned int id)
SCIP_Bool SCIPsetIsFeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPlpGetNRows(SCIP_LP *lp)
SCIP_RETCODE SCIPreoptResetDualBndchgs(SCIP_REOPT *reopt, SCIP_NODE *node, BMS_BLKMEM *blkmem)
static SCIP_RETCODE reoptnodeReset(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem)
void SCIPreoptnodeGetPath(SCIP_REOPT *reopt, SCIP_REOPTNODE *reoptnode, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, int varssize, int *nbndchgs, int *nbndchgsafterdual)
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
static SCIP_RETCODE saveLocalConssData(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id)
SCIP_Bool SCIPsetIsEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
void SCIPqueueFree(SCIP_QUEUE **queue)
SCIP_RETCODE SCIPvarChgUbLocal(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_Real newbound)
internal methods for storing separated cuts
#define DEFAULT_MEM_VARAFTERDUAL
SCIP_BOUNDTYPE * SCIPgetBoundtypesBounddisjunction(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPsetIsFeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
SCIP_RETCODE SCIPhashmapInsertReal(SCIP_HASHMAP *hashmap, void *origin, SCIP_Real image)
SCIP_RETCODE SCIProwRelease(SCIP_ROW **row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
SCIP_RETCODE SCIPcutpoolAddRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_ROW *row)
SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
#define BMSfreeBlockMemory(mem, ptr)
int SCIPreoptGetNAddedConss(SCIP_REOPT *reopt, SCIP_NODE *node)
data structures and methods for collecting reoptimization information
internal methods for problem variables
SCIP_Bool SCIPvarIsOriginal(SCIP_VAR *var)
void SCIPnodeSetEstimate(SCIP_NODE *node, SCIP_SET *set, SCIP_Real newestimate)
int SCIPnodeGetNDualBndchgs(SCIP_NODE *node)
SCIP_RETCODE SCIPreoptInstallBounds(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPreoptSaveOpenNodes(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_NODE **leaves, int nleaves, SCIP_NODE **childs, int nchilds, SCIP_NODE **siblings, int nsiblings)
#define SCIPallocBufferArray(scip, ptr, num)
SCIP_Bool SCIPsetIsIntegral(SCIP_SET *set, SCIP_Real val)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
SCIP_REOPTCONSDATA * dualredscur
static SCIP_RETCODE reoptCheckLocalRestart(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR **transvars, int ntransvars, SCIP_Bool *localrestart)
SCIP_RETCODE SCIPconsGetNVars(SCIP_CONS *cons, SCIP_SET *set, int *nvars, SCIP_Bool *success)
static SCIP_RETCODE fixInterdiction(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, int *perm, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, int nvars, int negbndchg)
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
SCIP_REOPTTREE * reopttree
SCIP_RETCODE SCIPsepastoreAddCut(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool root, SCIP_Bool *infeasible)
SCIP_SOL * SCIPreoptGetLastBestSol(SCIP_REOPT *reopt)
SCIP_RETCODE SCIPreoptGetChildIDs(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int *childs, int childssize, int *nchilds)
void SCIPreoptAddNImprovingSols(SCIP_REOPT *reopt, int nimprovingsols)
SCIP_RETCODE SCIPreoptCheckCutoff(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_EVENTTYPE eventtype, SCIP_LP *lp, SCIP_LPSOLSTAT lpsolstat, SCIP_Bool isrootnode, SCIP_Bool isfocusnode, SCIP_Real lowerbound, int effectiverootdepth)
#define BMSallocBlockMemoryArray(mem, ptr, num)
static SCIP_RETCODE getLastSavedNode(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_NODE *node, SCIP_NODE **parent, unsigned int *parentid, int *nbndchgs)
SCIP_RETCODE SCIPreoptCheckRestart(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, SCIP_VAR **transvars, int ntransvars, SCIP_Bool *restart)
static SCIP_RETCODE addLocalConss(SCIP *scip, SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id)
SCIP_VAR ** afterdualvars
SCIP_RETCODE SCIPconsRelease(SCIP_CONS **cons, BMS_BLKMEM *blkmem, SCIP_SET *set)
SCIP_SETPPCTYPE SCIPgetTypeSetppc(SCIP *scip, SCIP_CONS *cons)
void SCIPclockFree(SCIP_CLOCK **clck)
static SCIP_RETCODE solnodeAddChild(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_SOLNODE *curnode, SCIP_SOLNODE **child, SCIP_VAR *var, SCIP_Real val, SCIP_Bool *added)
static SCIP_RETCODE getInferenceOrder(SCIP_SET *set, SCIP_STAT *stat, int *perm, SCIP_VAR **vars, SCIP_Real *bounds, SCIP_BOUNDTYPE *boundtypes, int nvars)
SCIP_RETCODE SCIPsetGetIntParam(SCIP_SET *set, const char *name, int *value)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
void SCIPreoptnodeSetParentID(SCIP_REOPTNODE *reoptnode, unsigned int parentid)
void SCIPrandomPermuteIntArray(SCIP_RANDNUMGEN *randnumgen, int *array, int begin, int end)
static SCIP_RETCODE createReopttree(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem)
static SCIP_RETCODE createSolTree(SCIP_SOLTREE *soltree, BMS_BLKMEM *blkmem)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
#define SCIP_EVENTTYPE_NODEINFEASIBLE
static SCIP_RETCODE reoptnodeCheckMemory(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem, int var_mem, int child_mem, int conss_mem)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
static SCIP_RETCODE ensureRunSize(SCIP_REOPT *reopt, SCIP_SET *set, int num, BMS_BLKMEM *blkmem)
static SCIP_RETCODE addSplitcons(SCIP_REOPT *reopt, SCIP *scip, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_NODE *node, unsigned int id)
int SCIPreoptGetNSolsRun(SCIP_REOPT *reopt, int run)
unsigned int reoptnodessize
SCIP_REOPTTYPE SCIPreoptnodeGetType(SCIP_REOPTNODE *reoptnode)
SCIP_COL * SCIPvarGetCol(SCIP_VAR *var)
void SCIPnodeGetBdChgsAfterDual(SCIP_NODE *node, SCIP_VAR **vars, SCIP_Real *varbounds, SCIP_BOUNDTYPE *varboundtypes, int start, int *nbranchvars, int branchvarssize)
SCIP_RETCODE SCIPreoptnodeAddBndchg(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE boundtype)
reoptsols primal heuristic
internal methods for storing cuts in a cut pool
Constraint handler for linear constraints in their most general form, .
SCIP_RETCODE SCIPcreateConsLogicor(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
#define SCIP_EVENTTYPE_GBDCHANGED
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_Bool SCIPsetIsFeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_RANDNUMGEN * randnumgen
int ntotalcutoffreoptnodes
SCIP_REOPTCONSDATA ** glbconss
SCIP_Bool SCIPprobIsTransformed(SCIP_PROB *prob)
SCIP_RETCODE SCIPreoptDeleteNode(SCIP_REOPT *reopt, SCIP_SET *set, unsigned int id, BMS_BLKMEM *blkmem)
#define BMSallocClearMemoryArray(ptr, num)
SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPvarGetProbvarBound(SCIP_VAR **var, SCIP_Real *bound, SCIP_BOUNDTYPE *boundtype)
static SCIP_RETCODE moveChildrenUp(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int nodeid, unsigned int parentid)
int SCIPgetNVars(SCIP *scip)
int SCIPreoptGetNRestartsLocal(SCIP_REOPT *reopt)
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
static SCIP_RETCODE saveGlobalCons(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, REOPT_CONSTYPE consttype)
static int reopttreeGetNNodes(SCIP_REOPTTREE *reopttree, unsigned int id)
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
int SCIPnodeGetNAddedConss(SCIP_NODE *node)
static SCIP_RETCODE saveConsBounddisjuction(SCIP_REOPTCONSDATA *reoptconsdata, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_Real SCIPreoptnodeGetLowerbound(SCIP_REOPTNODE *reoptnode)
static SCIP_RETCODE reoptAddChild(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int parentid, unsigned int childid)
void SCIPconsCapture(SCIP_CONS *cons)
SCIP_RETCODE SCIPqueueCreate(SCIP_QUEUE **queue, int initsize, SCIP_Real sizefac)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
void SCIPreoptAddNCheckedSols(SCIP_REOPT *reopt, int ncheckedsols)
static SCIP_RETCODE reoptnodeResetDualConss(SCIP_REOPTNODE *reoptnode, BMS_BLKMEM *blkmem)
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_NODE * SCIPtreeGetRootNode(SCIP_TREE *tree)
SCIP_RETCODE SCIPreoptAddInfNode(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node)
unsigned int SCIPnodeGetReoptID(SCIP_NODE *node)
SCIP_RETCODE SCIPnodeAddBoundchg(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_Real newbound, SCIP_BOUNDTYPE boundtype, SCIP_Bool probingchange)
static SCIP_Real reoptSimilarity(SCIP_REOPT *reopt, SCIP_SET *set, int obj1_id, int obj2_id, SCIP_VAR **vars, int nvars)
static SCIP_RETCODE reopttreeDeleteNode(SCIP_REOPTTREE *reopttree, SCIP_SET *set, BMS_BLKMEM *blkmem, unsigned int id, SCIP_Bool softreset)
#define SCIP_EVENTTYPE_FORMAT
SCIP_RETCODE SCIPreoptUpdateVarHistory(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_VAR **vars, int nvars)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
static SCIP_RETCODE reoptSaveNewObj(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **origvars, int norigvars)
SCIP_RETCODE SCIPreoptnodeReset(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE *reoptnode)
SCIP_Real SCIPeventGetOldbound(SCIP_EVENT *event)
static SCIP_DECL_EVENTINITSOL(eventInitsolReopt)
SCIP_Bool SCIPsetIsGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
int SCIProwGetLPPos(SCIP_ROW *row)
static SCIP_RETCODE addGlobalCut(SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_VAR **vars, SCIP_Real *vals, SCIP_BOUNDTYPE *boundtypes, int nvars, int nbinvars, int nintvars)
SCIP_NODETYPE SCIPnodeGetType(SCIP_NODE *node)
static SCIP_RETCODE collectDualInformation(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_NODE *node, unsigned int id, SCIP_REOPTTYPE reopttype)
SCIP_BRANCHRULE * SCIPsetFindBranchrule(SCIP_SET *set, const char *name)
int SCIPreoptnodeGetNDualBoundChgs(SCIP_REOPTNODE *reoptnode)
SCIP_VAR ** SCIPprobGetVars(SCIP_PROB *prob)
#define BMSallocMemory(ptr)
SCIP_Real * afterdualvarbounds
#define BMSreallocMemoryArray(ptr, num)
internal methods for constraints and constraint handlers
int SCIPreoptGetNTotalPrunedNodes(SCIP_REOPT *reopt)
int SCIPreoptGetNTotalFeasNodes(SCIP_REOPT *reopt)
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_RETCODE SCIPreoptSaveActiveConss(SCIP_REOPT *reopt, SCIP_PROB *transprob, BMS_BLKMEM *blkmem)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
void * SCIPqueueRemove(SCIP_QUEUE *queue)
void SCIPnodeSetReopttype(SCIP_NODE *node, SCIP_REOPTTYPE reopttype)
int SCIPsetInitializeRandomSeed(SCIP_SET *set, int initialseedvalue)
SCIP_Real SCIPreoptGetSimToFirst(SCIP_REOPT *reopt)
SCIP_RETCODE SCIPcreateConsBounddisjunction(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_Real SCIPhistoryGetAvgInferences(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPreoptGetNPrunedNodes(SCIP_REOPT *reopt)
enum Reopt_ConsType REOPT_CONSTYPE
int SCIPreoptGetNSavedSols(SCIP_REOPT *reopt)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
void SCIPvarAdjustUb(SCIP_VAR *var, SCIP_SET *set, SCIP_Real *ub)
SCIP_HISTORY *** varhistory
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
SCIP_RETCODE SCIPreoptReset(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
#define BMSallocBlockMemory(mem, ptr)
SCIP_RETCODE SCIPconsDeactivate(SCIP_CONS *cons, SCIP_SET *set, SCIP_STAT *stat)
SCIP_REOPTCONSDATA * dualredsnex
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
#define BMSclearMemoryArray(ptr, num)
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPreoptSaveGlobalBounds(SCIP_REOPT *reopt, SCIP_PROB *transprob, BMS_BLKMEM *blkmem)
int SCIPreoptGetNTotalRestartsLocal(SCIP_REOPT *reopt)
struct BMS_BlkMem BMS_BLKMEM
static SCIP_RETCODE shrinkNode(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_NODE *node, unsigned int id, SCIP_Bool *shrank, BMS_BLKMEM *blkmem)
constraint handler for bound disjunction constraints
SCIP_VAR * SCIPvarGetTransVar(SCIP_VAR *var)
SCIP_Real SCIPreoptGetSavingtime(SCIP_REOPT *reopt)
SCIP_Longint lastbranched
static SCIP_RETCODE reoptnodeUpdateDualConss(SCIP_REOPTNODE *reoptnode, BMS_BLKMEM *blkmem)
SCIP_SOL * SCIPreoptGetBestSolRun(SCIP_REOPT *reopt, int run)
void SCIPnodeGetConsProps(SCIP_NODE *node, SCIP_VAR **vars, SCIP_Real *varbounds, SCIP_BOUNDTYPE *varboundtypes, int *nconspropvars, int conspropvarssize)
#define BMSreallocBlockMemoryArray(mem, ptr, oldnum, newnum)
SCIP_RETCODE SCIPreoptMergeVarHistory(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **vars, int nvars)
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPvarNegate(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **negvar)
int SCIPreoptGetNCheckedSols(SCIP_REOPT *reopt)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
static SCIP_RETCODE checkMemGlbCons(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, int mem)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
SCIP_RETCODE SCIPsolFree(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_PRIMAL *primal)
int SCIPreoptnodeGetNConss(SCIP_REOPTNODE *reoptnode)
SCIP_RETCODE SCIPreoptAddRun(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **origvars, int norigvars, int size)
memory allocation routines