( i = 0; i < cutnnz; ++i )
100 if( cutcoefs[i] > 0.0 )
123#define NONZERO(x) (COPYSIGN(1e-100, (x)) + (x)) 139assert(inds !=
NULL);
140assert(vals !=
NULL);
141assert(nnz !=
NULL);
142assert(row !=
NULL);
145 for( i = 0 ; i < row->
len; ++i )
151val = vals[probindex];
154inds[(*nnz)++] = probindex;
156val += row->
vals[i] * scale;
162vals[probindex] = val;
184assert(inds !=
NULL);
185assert(vals !=
NULL);
186assert(nnz !=
NULL);
187assert(row !=
NULL);
190 for( i = 0 ; i < row->
len; ++i )
200inds[(*nnz)++] = probindex;
231assert(inds !=
NULL);
232assert(vals !=
NULL);
233assert(nnz !=
NULL);
234assert(row !=
NULL);
237 for( i = 0 ; i < row->
len; ++i )
248inds[(*nnz)++] = probindex;
284assert(cutcoefs !=
NULL);
285assert(cutinds !=
NULL);
289 switch(
scip->set->sepa_efficacynorm )
292 for( i = 0; i < cutnnz; ++i )
295norm +=
SQR(cutcoefs[i]);
300 for( i = 0; i < cutnnz; ++i )
305absval =
REALABS(cutcoefs[i]);
306norm =
MAX(norm, absval);
310 for( i = 0; i < cutnnz; ++i )
317 for( i = 0; i < cutnnz; ++i )
329 return(activity - cutrhs) /
MAX(1e-6, norm);
348 switch(
scip->set->sepa_efficacynorm )
351 for( i = 0; i < nnz; ++i )
359 for( i = 0; i < nnz; ++i )
365norm =
MAX(norm, absval);
369 for( i = 0; i < nnz; ++i )
376 for( i = 0; i < nnz; ++i )
412assert(cutcoefs !=
NULL);
413assert(cutinds !=
NULL);
418 switch(
scip->set->sepa_efficacynorm )
421 for( i = 0; i < cutnnz; ++i )
430 for( i = 0; i < cutnnz; ++i )
437norm =
MAX(norm, absval);
441 for( i = 0; i < cutnnz; ++i )
449 for( i = 0; i < cutnnz; ++i )
462 return(activity - cutrhs) /
MAX(1e-6, norm);
486 for( i = 0; i < *cutnnz; )
545cutinds[i] = cutinds[*cutnnz];
582 for( i = 0; i < *cutnnz; )
610 if(
EPSZ(val, minval) || isfixed )
641cutinds[i] = cutinds[*cutnnz];
670 if( abscoef1 < abscoef2 )
672 if( abscoef2 < abscoef1 )
686abscoef1 =
REALABS(coefs[ind1]);
687abscoef2 =
REALABS(coefs[ind2]);
689 if( abscoef1 < abscoef2 )
691 if( abscoef2 < abscoef1 )
817assert(redundant !=
NULL);
821 for( i = 0; i < *cutnnz; ++i )
825assert(cutinds[i] >= 0);
826assert(vars[cutinds[i]] !=
NULL);
837 if( cutinds[i] < nintegralvars )
855 if( cutinds[i] < nintegralvars )
887equiscale = 1.0 /
MIN((maxact -
QUAD_TO_DBL(*cutrhs)), maxabsintval);
889 for( i = 0; i < *cutnnz; ++i )
900(
SCIP_Longint)
scip->set->sepa_maxcoefratio,
scip->set->sepa_maxcoefratio, &intscalar, &success) );
907intscalar *= equiscale;
910 for( i = 0; i < *cutnnz; )
939cutinds[i] = cutinds[*cutnnz];
949 for( i = 0; i < *cutnnz; ++i )
953assert(cutinds[i] >= 0);
954assert(vars[cutinds[i]] !=
NULL);
992maxabsintval *= equiscale;
994 for( i = 0; i < *cutnnz; ++i )
1011maxabsval =
MIN(maxabsval, maxabsintval);
1012maxabsval =
MAX(maxabsval, maxabscontval);
1014scale = 1.0 / maxabsval;
1019maxabsintval *= scale;
1021 for( i = 0; i < *cutnnz; ++i )
1044 SCIPsortDownInd(cutinds, compareAbsCoefsQuad, (
void*) cutcoefs, *cutnnz);
1047 for( i = 0; i < *cutnnz; )
1051 if( cutinds[i] >= nintegralvars )
1084 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
1103cutinds[i] = cutinds[*cutnnz];
1131 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
1150cutinds[i] = cutinds[*cutnnz];
1192assert(redundant !=
NULL);
1193*redundant =
FALSE;
1196 for( i = 0; i < *cutnnz; ++i )
1201assert(cutinds[i] >= 0);
1202assert(vars[cutinds[i]] !=
NULL);
1204val = cutcoefs[cutinds[i]];
1213 if( cutinds[i] < nintegralvars )
1214maxabsintval =
MAX(maxabsintval, -val);
1217maxabscontval =
MAX(maxabscontval, -val);
1218isintegral =
FALSE;
1231 if( cutinds[i] < nintegralvars )
1232maxabsintval =
MAX(maxabsintval, val);
1235maxabscontval =
MAX(maxabscontval, val);
1236isintegral =
FALSE;
1263equiscale = 1.0 /
MIN((maxact -
QUAD_TO_DBL(*cutrhs)), maxabsintval);
1265 for( i = 0; i < *cutnnz; ++i )
1269val = equiscale * cutcoefs[cutinds[i]];
1275(
SCIP_Longint)
scip->set->sepa_maxcoefratio,
scip->set->sepa_maxcoefratio, &intscalar, &success) );
1282intscalar *= equiscale;
1285 for( i = 0; i < *cutnnz; )
1290val = cutcoefs[cutinds[i]];
1302 if( intval != 0.0 )
1304cutcoefs[cutinds[i]] = intval;
1310cutcoefs[cutinds[i]] = 0.0;
1312cutinds[i] = cutinds[*cutnnz];
1322 for( i = 0; i < *cutnnz; ++i )
1327assert(cutinds[i] >= 0);
1328assert(vars[cutinds[i]] !=
NULL);
1330val = cutcoefs[cutinds[i]];
1336maxabsintval =
MAX(maxabsintval, -val);
1345maxabsintval =
MAX(maxabsintval, val);
1359isintegral =
FALSE;
1364maxabsintval *= equiscale;
1366 for( i = 0; i < *cutnnz; ++i )
1367cutcoefs[cutinds[i]] *= equiscale;
1377maxabsval =
MIN(maxabsval, maxabsintval);
1378maxabsval =
MAX(maxabsval, maxabscontval);
1380scale = 1.0 / maxabsval;
1385maxabsintval *= scale;
1387 for( i = 0; i < *cutnnz; ++i )
1388cutcoefs[cutinds[i]] *= scale;
1404 SCIPsortDownInd(cutinds, compareAbsCoefs, (
void*) cutcoefs, *cutnnz);
1407 for( i = 0; i < *cutnnz; )
1411 if( cutinds[i] >= nintegralvars )
1417val = cutcoefs[cutinds[i]];
1444 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
1460cutcoefs[cutinds[i]] = 0.0;
1462cutinds[i] = cutinds[*cutnnz];
1490 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
1506cutcoefs[cutinds[i]] = 0.0;
1508cutinds[i] = cutinds[*cutnnz];
1546assert(nchgcoefs !=
NULL);
1554assert(nchgcoefs !=
NULL);
1557 for( i = 0; i < *cutnnz; ++i )
1561assert(cutinds[i] >= 0);
1562assert(vars[cutinds[i]] !=
NULL);
1564 if( cutcoefs[i] < 0.0 )
1571 if( cutinds[i] < nintegralvars )
1573maxabsval =
MAX(maxabsval, -cutcoefs[i]);
1574absvals[i] = -cutcoefs[i];
1589 if( cutinds[i] < nintegralvars )
1591maxabsval =
MAX(maxabsval, cutcoefs[i]);
1592absvals[i] = cutcoefs[i];
1619 for( i = 0; i < *cutnnz; ++i )
1622 if( cutinds[i] >= nintegralvars )
1627 if( cutcoefs[i] < 0.0 &&
SCIPisLE(
scip, maxact + cutcoefs[i], *cutrhs) )
1634 if( coef > cutcoefs[i] )
1643 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
1644cutcoefs[i], coef, (*cutrhs),
QUAD_TO_DBL(tmp), lb,
1662cutinds[i] = cutinds[*cutnnz];
1663cutcoefs[i] = cutcoefs[*cutnnz];
1668 else if( cutcoefs[i] > 0.0 &&
SCIPisLE(
scip, maxact - cutcoefs[i], *cutrhs) )
1675 if( coef < cutcoefs[i] )
1684 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
1703cutinds[i] = cutinds[*cutnnz];
1704cutcoefs[i] = cutcoefs[*cutnnz];
1730assert(aggrrow !=
NULL);
1741(*aggrrow)->local =
FALSE;
1742(*aggrrow)->nnz = 0;
1743(*aggrrow)->rank = 0;
1745(*aggrrow)->rowsinds =
NULL;
1746(*aggrrow)->slacksign =
NULL;
1747(*aggrrow)->rowweights =
NULL;
1748(*aggrrow)->nrows = 0;
1749(*aggrrow)->rowssize = 0;
1763assert(aggrrow !=
NULL);
1787assert(aggrrow !=
NULL);
1790assert(vars !=
NULL);
1793assert(messagehdlr);
1796 if( aggrrow->
nnz== 0 )
1799 for( i = 0; i < aggrrow->
nnz; ++i )
1822assert(aggrrow !=
NULL);
1823assert(source !=
NULL);
1830(*aggrrow)->nnz = source->
nnz;
1833 if( source->
nrows> 0 )
1845(*aggrrow)->rowsinds =
NULL;
1846(*aggrrow)->slacksign =
NULL;
1847(*aggrrow)->rowweights =
NULL;
1850(*aggrrow)->nrows = source->
nrows;
1851(*aggrrow)->rowssize = source->
nrows;
1852(*aggrrow)->rank = source->
rank;
1853(*aggrrow)->local = source->
local;
1872assert(row->
lppos>= 0);
1880i = aggrrow->
nrows++;
1893 if( sidetype == -1 )
1898 else if( sidetype == 1 )
1956assert(valid !=
NULL);
1959v = aggrrow->
inds[pos];
1997aggrrow->
inds[pos] = aggrrow->
inds[aggrrow->
nnz];
2016assert(aggrrow !=
NULL);
2022 if( aggrrow->
nnz== 0 )
2025 for( i = 0; i < nvars; ++i )
2035aggrrow->
inds[aggrrow->
nnz++] = i;
2046 for( i = 0 ; i < nvars; ++i )
2058aggrrow->
inds[aggrrow->
nnz++] = i;
2066assert(
QUAD_HI(val) != 0.0);
2095assert(weight >= 0.0);
2109 for( i = 0 ; i < len; ++i )
2112 intprobindex = inds[i];
2117aggrrow->
inds[aggrrow->
nnz++] = probindex;
2124assert(
QUAD_HI(val) != 0.0);
2142 for( i = 0; i < aggrrow->
nnz; ++i )
2148aggrrow->
nrows= 0;
2187assert( rowtoolong !=
NULL);
2188*rowtoolong =
FALSE;
2223 if( weight > 0.0 && ((negslack == 0) || (negslack == 1 && !row->
integral)) )
2235 if( weight < 0.0 && ((negslack == 0) || (negslack == 1 && !row->
integral)) )
2251i = aggrrow->
nrows++;
2264aggrrow->
slacksign[i] = uselhs ? -1 : 1;
2270 if( aggrrow->
nnz> maxaggrlen )
2271*rowtoolong =
TRUE;
2300assert( aggrrow !=
NULL);
2301assert( valid !=
NULL);
2309 if( rowinds !=
NULL&& nrowinds > -1 )
2311 for( k = 0; k < nrowinds; ++k )
2313 SCIP_CALL(
addOneRow(
scip, aggrrow, rows[rowinds[k]], weights[rowinds[k]], sidetypebasis, allowlocal, negslack, maxaggrlen, &rowtoolong) );
2321 for( k = 0; k < nrows; ++k )
2323 if( weights[k] != 0.0 )
2325 SCIP_CALL(
addOneRow(
scip, aggrrow, rows[k], weights[k], sidetypebasis, allowlocal, negslack, maxaggrlen, &rowtoolong) );
2360assert(cutinds !=
NULL);
2361assert(cutcoefs !=
NULL);
2362assert(cutrhs !=
NULL);
2363assert(success !=
NULL);
2387 for( i = 0; i < *nnz; ++i )
2390maxcoef =
MAX(absval, maxcoef);
2393maxcoef /=
scip->set->sepa_maxcoefratio;
2395minallowedcoef =
MAX(minallowedcoef, maxcoef);
2397*success = !
removeZeros(
scip, minallowedcoef, cutislocal, cutcoefs,
QUAD(&rhs), cutinds, nnz);
2428assert(cutinds !=
NULL);
2429assert(cutcoefs !=
NULL);
2431assert(success !=
NULL);
2452 for( i = 0; i < *nnz; ++i )
2458maxcoef =
MAX(abscoef, maxcoef);
2461maxcoef /=
scip->set->sepa_maxcoefratio;
2463minallowedcoef =
MAX(minallowedcoef, maxcoef);
2478assert(aggrrow !=
NULL);
2479assert(valid !=
NULL);
2482 QUAD(&aggrrow->rhs), aggrrow->
inds, &aggrrow->
nnz);
2490assert(aggrrow !=
NULL);
2492 returnaggrrow->
nrows;
2500assert(aggrrow !=
NULL);
2511assert(aggrrow !=
NULL);
2526assert(aggrrow !=
NULL);
2527assert(row !=
NULL);
2531 for( i = 0; i < aggrrow->
nrows; ++i )
2533 if( aggrrow->
rowsinds[i] == rowind )
2545assert(aggrrow !=
NULL);
2547 returnaggrrow->
inds;
2555assert(aggrrow !=
NULL);
2557 returnaggrrow->
nnz;
2565assert(aggrrow !=
NULL);
2567 returnaggrrow->
rank;
2575assert(aggrrow !=
NULL);
2577 returnaggrrow->
local;
2585assert(aggrrow !=
NULL);
2592#define MAXCMIRSCALE 1e+6 2607assert(bestlb !=
NULL);
2608assert(bestlbtype !=
NULL);
2625*simplebound = *bestlb;
2633 if( bestvlbidx >= 0 && (bestvlb > *bestlb || (*bestlbtype < 0 &&
SCIPisGE(
scip, bestvlb, *bestlb))) )
2642assert(vlbvars !=
NULL);
2647*bestlbtype = bestvlbidx;
2668assert(bestub !=
NULL);
2669assert(bestubtype !=
NULL);
2686*simplebound = *bestub;
2694 if( bestvubidx >= 0 && (bestvub < *bestub || (*bestubtype < 0 &&
SCIPisLE(
scip, bestvub, *bestub))) )
2703assert(vubvars !=
NULL);
2708*bestubtype = bestvubidx;
2727 int* boundsfortrans,
2747 if( boundsfortrans !=
NULL&& boundsfortrans[v] > -3 )
2750assert(boundtypesfortrans !=
NULL);
2756*bestlbtype = boundsfortrans[v];
2757 if( *bestlbtype == -1 )
2759 else if( *bestlbtype == -2 )
2774k = boundsfortrans[v];
2776assert(vlbvars !=
NULL);
2777assert(vlbcoefs !=
NULL);
2778assert(vlbconsts !=
NULL);
2787 SCIP_CALL(
findBestUb(
scip, var, sol, fixintegralrhs ? usevbds : 0, allowlocal && fixintegralrhs, bestub, &simpleub, bestubtype) );
2794*bestubtype = boundsfortrans[v];
2795 if( *bestubtype == -1 )
2797 else if( *bestubtype == -2 )
2812k = boundsfortrans[v];
2814assert(vubvars !=
NULL);
2815assert(vubcoefs !=
NULL);
2816assert(vubconsts !=
NULL);
2826 SCIP_CALL(
findBestLb(
scip, var, sol, fixintegralrhs ? usevbds : 0, allowlocal && fixintegralrhs, bestlb, &simplelb, bestlbtype) );
2847*freevariable =
TRUE;
2860 else if(
SCIPisLT(
scip, varsol, (1.0 - boundswitch) * (*bestlb) + boundswitch * (*bestub)) )
2862 else if(
SCIPisGT(
scip, varsol, (1.0 - boundswitch) * (*bestlb) + boundswitch * (*bestub)) )
2864 else if( *bestlbtype == -1 )
2866 else if( *bestubtype == -1 )
2868 else if( ((*bestlbtype) >= 0 || (*bestubtype) >= 0) && !
SCIPisEQ(
scip, *bestlb - simplelb, simpleub - *bestub) )
2870 if( *bestlb - simplelb > simpleub - *bestub )
2875 else if( *bestlbtype >= 0 )
2877 else if( *bestubtype >= 0 )
2939 if( boundtype < 0 )
2943*localbdsused = *localbdsused || (boundtype == -2);
2954 if( varsign == +1 )
2969assert(vbdvars !=
NULL);
2970assert(vbdcoefs !=
NULL);
2971assert(vbdconsts !=
NULL);
2983cutinds[(*nnz)++] = zidx;
2989assert(
QUAD_HI(zcoef) != 0.0);
3016assert( boundtype < 0 );
3020*localbdsused = *localbdsused || (boundtype == -2);
3060 int* boundsfortrans,
3085 intaggrrowintstart;
3090assert(varsign !=
NULL);
3091assert(boundtype !=
NULL);
3092assert(freevariable !=
NULL);
3093assert(localbdsused !=
NULL);
3095*freevariable =
FALSE;
3096*localbdsused =
FALSE;
3116 for( i = 0; i < *nnz && cutinds[i] >= firstcontvar; ++i )
3119ignoresol, boundsfortrans, boundtypesfortrans,
3120bestlbs + i, bestubs + i, bestlbtypes + i, bestubtypes + i, selectedbounds + i, freevariable) );
3122 if( *freevariable )
3127aggrrowintstart = i;
3130 for( i = 0; i < aggrrowintstart; ++i )
3139boundtype[i] = bestlbtypes[i];
3149boundtype[i] = bestubtypes[i];
3163assert(cutinds[i] < firstcontvar);
3173cutinds[i] = cutinds[*nnz];
3180ignoresol, boundsfortrans, boundtypesfortrans,
3181bestlbs + i, bestubs + i, bestlbtypes + i, bestubtypes + i, selectedbounds + i, freevariable) );
3186 if( *freevariable )
3191 for( i = aggrrowintstart; i < *nnz; ++i )
3199assert(bestlbtypes[i] < 0);
3202boundtype[i] = bestlbtypes[i];
3210assert(bestubtypes[i] < 0);
3213boundtype[i] = bestubtypes[i];
3220 if( fixintegralrhs )
3226 if( f0 < minfrac || f0 > maxfrac )
3234bestviolgain = -1e+100;
3236 for( i = 0; i < *nnz; i++ )
3242assert(0 <= v && v < nvars);
3247 if( boundtype[i] < 0
3248&& ((varsign[i] == +1 && !
SCIPisInfinity(
scip, bestubs[i]) && bestubtypes[i] < 0)
3249|| (varsign[i] == -1 && !
SCIPisInfinity(
scip, -bestlbs[i]) && bestlbtypes[i] < 0)) )
3271 if( newf0 < minfrac || newf0 > maxfrac )
3273 if( v >= firstcontvar )
3287viol = f0 - fj * (varsign[i] == +1 ? solval - bestlbs[i] : bestubs[i] - solval);
3288newviol = newf0 - newfj * (varsign[i] == -1 ? solval - bestlbs[i] : bestubs[i] - solval);
3289violgain = newviol - viol;
3294 SCIPerrorMessage(
"Cannot handle closest bounds with ignoring the LP solution.\n");
3301 if(
SCIPisGT(
scip, violgain, bestviolgain) || (
SCIPisGE(
scip, violgain, bestviolgain) && newf0 < bestnewf0) )
3304bestviolgain = violgain;
3313assert(besti < *nnz);
3314assert(boundtype[besti] < 0);
3326 if( varsign[besti] == +1 )
3329assert(bestubtypes[besti] < 0);
3330boundtype[besti] = bestubtypes[besti];
3331varsign[besti] = -1;
3336assert(bestlbtypes[besti] < 0);
3337boundtype[besti] = bestlbtypes[besti];
3338varsign[besti] = +1;
3340*localbdsused = *localbdsused || (boundtype[besti] == -2);
3427assert(cutcoefs !=
NULL);
3428assert(cutinds !=
NULL);
3429assert(nnz !=
NULL);
3430assert(boundtype !=
NULL);
3431assert(varsign !=
NULL);
3447 while( i < *nnz && cutinds[i] >= firstcontvar )
3452assert(cutinds[i] < firstcontvar);
3458 for( i = *nnz - 1; i >= 0 && cutinds[i] < firstcontvar; --i )
3468assert(var !=
NULL);
3470assert(varsign[i] == +1 || varsign[i] == -1);
3504cutinds[i] = cutinds[*nnz];
3511assert(boundtype[i] < 0);
3514 if( varsign[i] == +1 )
3517 if( boundtype[i] == -1 )
3533 if( boundtype[i] == -1 )
3550 while( i >= ndelcontvars )
3561assert(var !=
NULL);
3563assert(varsign[i] == +1 || varsign[i] == -1);
3564assert( v >= firstcontvar );
3582cutinds[i] = cutinds[ndelcontvars];
3583varsign[i] = varsign[ndelcontvars];
3584boundtype[i] = boundtype[ndelcontvars];
3592 if( boundtype[i] < 0 )
3597 if( varsign[i] == +1 )
3600 if( boundtype[i] == -1 )
3616 if( boundtype[i] == -1 )
3640vbidx = boundtype[i];
3643 if( varsign[i] == +1 )
3661assert(0 <= zidx && zidx < firstcontvar);
3671cutinds[(*nnz)++] = zidx;
3676assert(
QUAD_HI(zcoef) != 0.0);
3684 if( ndelcontvars > 0 )
3686assert(ndelcontvars <= *nnz);
3687*nnz -= ndelcontvars;
3688 if( *nnz < ndelcontvars )
3738assert(weights !=
NULL|| nrowinds == 0);
3739assert(slacksign !=
NULL|| nrowinds == 0);
3740assert(rowinds !=
NULL|| nrowinds == 0);
3741assert(scale > 0.0);
3742assert(cutcoefs !=
NULL);
3744assert(cutinds !=
NULL);
3745assert(nnz !=
NULL);
3752 for( i = 0; i < nrowinds; i++ )
3765assert(slacksign[i] == -1 || slacksign[i] == +1);
3769assert(row !=
NULL);
3823 if( slacksign[i] == +1 )
3881 int* boundsfortrans,
3915assert(aggrrow !=
NULL);
3917assert(success !=
NULL);
3931tmpnnz = aggrrow->
nnz;
3932tmpislocal = aggrrow->
local;
3940 for( i = 0; i < tmpnnz; ++i )
3943 intk = aggrrow->
inds[i];
3951assert(
QUAD_HI(coef) != 0.0);
3970boundsfortrans, boundtypesfortrans, minfrac, maxfrac, tmpcoefs,
QUAD(&rhs), tmpinds, &tmpnnz, varsign, boundtype, &freevariable, &localbdsused) );
3971assert(allowlocal || !localbdsused);
3972tmpislocal = tmpislocal || localbdsused;
4049aggrrow->
nrows, scale, tmpcoefs,
QUAD(&rhs), tmpinds, &tmpnnz,
QUAD(f0)) );
4078*cutislocal = tmpislocal;
4081 for( i = 0; i < *cutnnz; ++i )
4093 if( cutefficacy !=
NULL)
4094*cutefficacy = mirefficacy;
4096 if( cutrank !=
NULL)
4097*cutrank = aggrrow->
rank+ 1;
4111 for( i = 0; i < tmpnnz; ++i )
4152scale = 1.0 / delta;
4157 if( f0 < minfrac || f0 > maxfrac )
4160onedivoneminusf0 = 1.0 / (1.0 - f0);
4162contscale = scale * onedivoneminusf0;
4171rhs -= contscale * contactivity;
4172norm =
SQR(contscale) * contsqrnorm;
4179 for( i = 0; i < nvars; ++i )
4182 SCIP_Realfi = (scale * coefs[i]) - floorai;
4184 if( fi > f0pluseps )
4185floorai += (fi - f0) * onedivoneminusf0;
4187rhs -= solvals[i] * floorai;
4188norm +=
SQR(floorai);
4193 return- rhs /
MAX(norm, 1e-6);
4220 int* boundsfortrans,
4266assert(aggrrow !=
NULL);
4267assert(aggrrow->
nrows+ aggrrow->
nnz>= 1);
4268assert(success !=
NULL);
4293mksetnnz = aggrrow->
nnz;
4298 for( i = 0; i < mksetnnz; ++i )
4300 intj = mksetinds[i];
4304assert(
QUAD_HI(coef) != 0.0);
4307*cutislocal = aggrrow->
local;
4325boundsfortrans, boundtypesfortrans, minfrac, maxfrac, mksetcoefs,
QUAD(&mksetrhs), mksetinds, &mksetnnz, varsign, boundtype, &freevariable, &localbdsused) );
4327assert(allowlocal || !localbdsused);
4336maxabsmksetcoef = -1.0;
4339 for( i = mksetnnz - 1; i >= 0 && mksetinds[i] < firstcontvar; --i )
4341 SCIP_VAR* var = vars[mksetinds[i]];
4352bounddist[nbounddist] =
MIN(ub - primsol, primsol - lb);
4353bounddistpos[nbounddist] = i;
4359 if( nbounddist == 0 )
4363ndeltacands = nbounddist;
4373 if( intscalesuccess )
4380delta = 1.0 / intscale;
4381intf0 = intscalerhs - floor(intscalerhs);
4385 if( intf0 < minfrac || intf0 > maxfrac )
4387intscale *=
SCIPceil(
scip,
MAX(minfrac, (1.0 - maxfrac)) /
MIN(intf0, (1.0 - intf0)));
4389delta = 1.0 / intscale;
4390intf0 = intscalerhs - floor(intscalerhs);
4393 if( intf0 >= minfrac && intf0 <= maxfrac )
4396deltacands[ndeltacands++] = delta;
4398 if( intf0 < maxfrac )
4402delta2 = 1.0 / (intscale *
SCIPfloor(
scip, maxfrac / intf0));
4405deltacands[ndeltacands++] = delta2;
4412 for( i = 0; i < nbounddist; ++i )
4416absmksetcoef =
REALABS(deltacands[i]);
4417maxabsmksetcoef =
MAX(absmksetcoef, maxabsmksetcoef);
4419deltacands[i] = absmksetcoef;
4423 if( maxabsmksetcoef != -1.0 )
4424deltacands[ndeltacands++] = maxabsmksetcoef + 1.0;
4426deltacands[ndeltacands++] = 1.0;
4428maxtestdelta =
MIN(ndeltacands, maxtestdelta);
4460 for( i = intstart; i < mksetnnz; ++i )
4466var = vars[mksetinds[i]];
4472 if( boundtype[i] == -1 )
4475 if( varsign[i] == -1 )
4482assert(boundtype[i] == -2);
4485 if( varsign[i] == -1 )
4491tmpvalues[ntmpcoefs] = solval;
4493tmpcoefs[ntmpcoefs] = varsign[i] *
QUAD_TO_DBL(coef);
4497assert(ntmpcoefs == mksetnnz - intstart);
4501 for( i = 0; i < intstart; ++i )
4508 if( varsign[i] *
QUAD_TO_DBL(mksetcoef) >= 0.0 )
4515 switch( boundtype[i] )
4519 if( varsign[i] == -1 )
4526 if( varsign[i] == -1 )
4533 if( varsign[i] == -1 )
4543solval = (coef * vbdsolval + constant) - solval;
4555solval = solval - (coef * vbdsolval + constant);
4559contactivity += solval * (
QUAD_TO_DBL(mksetcoef) * varsign[i]);
4568 for( i = 0; i < aggrrow->
nrows; ++i )
4573row = rows[aggrrow->
rowsinds[i]];
4586slackval = row->
rhs- slackval;
4594slackval = slackval - row->
lhs;
4600tmpvalues[ntmpcoefs] = slackval;
4609contactivity += slackval * slackcoeff;
4610contsqrnorm +=
SQR(slackcoeff);
4619 for( i = 0; i < maxtestdelta; ++i )
4626 for( j = 0; j < i; ++j )
4630deltaseenbefore =
TRUE;
4636 if( deltaseenbefore )
4638maxtestdelta =
MIN(maxtestdelta + 1, ndeltacands);
4644 if( efficacy > bestefficacy )
4646bestefficacy = efficacy;
4647bestdelta = deltacands[i];
4658 for( i = 2; i <= 8 ; i *= 2 )
4663delta = basedelta / i;
4667 if( efficacy > bestefficacy )
4669bestefficacy = efficacy;
4678 for( i = 0; i < nbounddist; ++i )
4691k = bounddistpos[i];
4715tmpcoefs[k - intstart] = -tmpcoefs[k - intstart];
4717oldsolval = tmpvalues[k - intstart];
4724 if( newefficacy > bestefficacy )
4727bestefficacy = newefficacy;
4730 if( varsign[k] == +1 )
4733assert(bestubtype < 0);
4734boundtype[k] = bestubtype;
4740assert(bestlbtype < 0);
4741boundtype[k] = bestlbtype;
4745localbdsused = localbdsused || (boundtype[k] == -2);
4750tmpcoefs[k - intstart] = -tmpcoefs[k - intstart];
4751tmpvalues[k - intstart] = oldsolval;
4755 if( bestefficacy > 0.0 )
4762scale = 1.0 / bestdelta;
4771 for( i = 0; i < mksetnnz; ++i )
4804aggrrow->
nrows, scale, mksetcoefs,
QUAD(&mksetrhs), mksetinds, &mksetnnz,
QUAD(f0)) );
4812 for( i = 0; i < mksetnnz; ++i )
4821 SCIPdebugMsg(
scip,
"efficacy of cmir cut is different than expected efficacy: %f != %f\n", efficacy, bestefficacy);
4826*cutislocal = *cutislocal || localbdsused;
4840 SCIPdebugMsg(
scip,
"post-processed cut (success = %s):\n", *success ?
"TRUE":
"FALSE");
4850 for( i = 0; i < mksetnnz; ++i )
4863*cutefficacy = mirefficacy;
4864 if( cutrank !=
NULL)
4865*cutrank = aggrrow->
rank+ 1;
4866*cutislocal = *cutislocal || localbdsused;
4880 for( i = 0; i < mksetnnz; ++i )
4902#define NO_EXACT_KNAPSACK 4904#ifndef NO_EXACT_KNAPSACK 4905#define MAXDNOM 1000LL 4906#define MINDELTA 1e-03 4907#define MAXDELTA 1e-09 4908#define MAXSCALE 1000.0 4909#define MAXDYNPROGSPACE 1000000 4912#define MAXABSVBCOEF 1e+5 4913#define MAXBOUND 1e+10 4979assert(var !=
NULL);
4983assert(rowcoefs !=
NULL);
4984assert(binvarused !=
NULL);
4985assert(closestvlb !=
NULL);
4986assert(closestvlbidx !=
NULL);
4991*closestvlbidx = -1;
5004 for( i = 0; i < nvlbs; i++ )
5013 if( bestsub > vlbconsts[i] )
5028 if( (
unsigned int)probidxbinvar >= (
unsigned int)nbinvars )
5049 if( binvarused[probidxbinvar] == 1 )
5058rowcoefsign =
COPYSIGN(1.0, rowcoef);
5060val2 = rowcoefsign * ((rowcoef * vlbcoefs[i]) + rowcoefbinvar);
5066val1 = rowcoefsign * ((rowcoef * (bestsub - vlbconsts[i])) + rowcoefbinvar);
5073 if( vlbsol > *closestvlb )
5075*closestvlb = vlbsol;
5078assert(*closestvlbidx >= 0);
5109assert(var !=
NULL);
5113assert(rowcoefs !=
NULL);
5114assert(binvarused !=
NULL);
5115assert(closestvub !=
NULL);
5116assert(closestvubidx !=
NULL);
5121*closestvubidx = -1;
5134 for( i = 0; i < nvubs; i++ )
5143 if( bestslb < vubconsts[i] )
5158 if( (
unsigned int)probidxbinvar >= (
unsigned int)nbinvars )
5179 if( binvarused[probidxbinvar] == 1 )
5188rowcoefsign =
COPYSIGN(1.0, rowcoef);
5190val2 = rowcoefsign * ((rowcoef * vubcoefs[i]) + rowcoefbinvar);
5196val1 = rowcoefsign * ((rowcoef * (bestslb - vubconsts[i])) + rowcoefbinvar);
5203 if( vubsol < *closestvub )
5205*closestvub = vubsol;
5208assert(*closestvubidx >= 0);
5253bestlbtype[varposinrow] = -3;
5254bestubtype[varposinrow] = -3;
5256probidx = rowinds[varposinrow];
5257var = vars[probidx];
5267 SCIP_CALL(
findBestLb(
scip, var, sol, 0, allowlocal, &bestslb[varposinrow], &simplebound, &bestslbtype[varposinrow]) );
5268 SCIP_CALL(
findBestUb(
scip, var, sol, 0, allowlocal, &bestsub[varposinrow], &simplebound, &bestsubtype[varposinrow]) );
5271 if( bestslb[varposinrow] <= -
MAXBOUND)
5274 if( bestsub[varposinrow] >=
MAXBOUND)
5279 SCIPdebugMsg(
scip,
" %d: %g <%s, idx=%d, lp=%g, [%g(%d),%g(%d)]>:\n", varposinrow, rowcoef,
SCIPvarGetName(var), probidx,
5280solval, bestslb[varposinrow], bestslbtype[varposinrow], bestsub[varposinrow], bestsubtype[varposinrow]);
5287*freevariable =
TRUE;
5296bestlb[varposinrow] = bestslb[varposinrow];
5297bestlbtype[varposinrow] = bestslbtype[varposinrow];
5307bestlb[varposinrow] = bestvlb;
5308bestlbtype[varposinrow] = bestvlbidx;
5318bestub[varposinrow] = bestsub[varposinrow];
5319bestubtype[varposinrow] = bestsubtype[varposinrow];
5329bestub[varposinrow] = bestvub;
5330bestubtype[varposinrow] = bestvubidx;
5334 SCIPdebugMsg(
scip,
" bestlb=%g(%d), bestub=%g(%d)\n", bestlb[varposinrow], bestlbtype[varposinrow], bestub[varposinrow], bestubtype[varposinrow]);
5341*freevariable =
TRUE;
5345*freevariable =
FALSE;
5351 if(
SCIPisEQ(
scip, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow]) && bestlbtype[varposinrow] >= 0 )
5355 else if(
SCIPisEQ(
scip, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow])
5356&& bestubtype[varposinrow] >= 0 )
5360 else if(
SCIPisLE(
scip, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow]) )
5366assert(
SCIPisGT(
scip, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow]));
5379binvarused[vlbvarprobidx] = 1;
5381 else if( selectedbounds[varposinrow] ==
SCIP_BOUNDTYPE_UPPER&& bestubtype[varposinrow] >= 0 )
5390binvarused[vubvarprobidx] = 1;
5434 SCIPdebugMsg(
scip,
"--------------------- construction of SNF relaxation ------------------------------------\n");
5455 for( i = nnz - 1; i >= 0 && rowinds[i] < nbinvars; --i )
5456binvarused[rowinds[i]] = -1;
5458nnonbinvarsrow = i + 1;
5460 for( i = 0; i < nnonbinvarsrow; ++i )
5464assert(rowinds[i] >= nbinvars);
5467bestlb, bestub, bestslb, bestsub, bestlbtype, bestubtype, bestslbtype, bestsubtype, selectedbounds, &freevariable) );
5474 for( j = nnz - 1; j >= nnonbinvarsrow; --j )
5475binvarused[rowinds[j]] = 0;
5478 for( j = 0; j < i; ++j )
5497*localbdsused =
FALSE;
5512 for( i = 0; i < nnonbinvarsrow; ++i )
5519probidx = rowinds[i];
5520var = vars[probidx];
5525assert(probidx >= nbinvars);
5533assert(bestsubtype[i] == -1 || bestsubtype[i] == -2);
5541 if( bestlbtype[i] < 0 )
5561 if( bestlbtype[i] == -2 || bestsubtype[i] == -2 )
5562*localbdsused =
TRUE;
5594 SCIPdebugMsg(
scip,
" --> bestlb used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=1), rhs=%g-(%g*%g)=%g\n",
5622assert(binvarused[vlbvarprobidx] == 1);
5623assert(vlbvarprobidx < nbinvars);
5642binvarused[vlbvarprobidx] = 0;
5673 SCIPdebugMsg(
scip,
" --> bestlb used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=%s), rhs=%g-(%g*%g)=%g\n",
5676vlbconsts[bestlbtype[i]], snf->
transrhs);
5685assert(bestslbtype[i] == -1 || bestslbtype[i] == -2);
5693 if( bestubtype[i] < 0 )
5713 if( bestubtype[i] == -2 || bestslbtype[i] == -2 )
5714*localbdsused =
TRUE;
5746 SCIPdebugMsg(
scip,
" --> bestub used for trans: ... %s y'_%d + ..., Y'_%d <= %g x_%d (=1), rhs=%g-(%g*%g)=%g\n",
5774assert(binvarused[vubvarprobidx] == 1);
5775assert(vubvarprobidx < nbinvars);
5781binvarused[vubvarprobidx] = 0;
5825 SCIPdebugMsg(
scip,
" --> bestub used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=%s), rhs=%g-(%g*%g)=%g\n",
5828vubconsts[bestubtype[i]],
QUAD_TO_DBL(transrhs));
5842 for( i = nnonbinvarsrow; i < nnz; ++i )
5851probidx = rowinds[i];
5853assert(probidx < nbinvars);
5856 if( binvarused[probidx] == 0 )
5860assert(binvarused[probidx] == -1);
5863binvarused[probidx] = 0;
5865var = vars[probidx];
5870 SCIPdebugMsg(
scip,
" %d: %g <%s, idx=%d, lp=%g, [%g, %g]>:\n", i,
QUAD_TO_DBL(rowcoef),
SCIPvarGetName(var), probidx, varsolval,
5927 SCIPdebugMsg(
scip,
"constraint in constructed 0-1 single node flow relaxation: ");
6015assert(weights !=
NULL);
6016assert(profits !=
NULL);
6019assert(items !=
NULL);
6020assert(nitems >= 0);
6022 if( solitems !=
NULL)
6027 if( solval !=
NULL)
6034 for( i = nitems - 1; i >= 0; --i )
6035tempsort[i] = profits[i] / weights[i];
6047solitemsweight = 0.0;
6048 for( j = 0; j < nitems &&
SCIPisFeasLT(
scip, solitemsweight + weights[j], capacity); j++ )
6050 if( solitems !=
NULL)
6052solitems[*nsolitems] = items[j];
6055 if( solval !=
NULL)
6056(*solval) += profits[j];
6057solitemsweight += weights[j];
6061 for( ; j < nitems; j++ )
6065 if( solitems !=
NULL)
6067solitems[*nsolitems] = items[j];
6070 if( solval !=
NULL)
6071(*solval) += profits[j];
6072solitemsweight += weights[j];
6074 else if( solitems !=
NULL)
6076nonsolitems[*nnonsolitems] = items[j];
6098 int* nflowcovervars,
6099 int* nnonflowcovervars,
6100 int* flowcoverstatus,
6109assert(coefs !=
NULL);
6110assert(vubcoefs !=
NULL);
6111assert(solitems !=
NULL);
6112assert(nonsolitems !=
NULL);
6113assert(nsolitems >= 0);
6114assert(nnonsolitems >= 0);
6115assert(nflowcovervars !=
NULL&& *nflowcovervars >= 0);
6116assert(nnonflowcovervars !=
NULL&& *nnonflowcovervars >= 0);
6117assert(flowcoverstatus !=
NULL);
6119assert(lambda !=
NULL);
6122 for( j = 0; j < nsolitems; j++ )
6125 if( coefs[solitems[j]] == 1 )
6127flowcoverstatus[solitems[j]] = -1;
6128(*nnonflowcovervars)++;
6133assert(coefs[solitems[j]] == -1);
6134flowcoverstatus[solitems[j]] = 1;
6135(*nflowcovervars)++;
6139 for( j = 0; j < nnonsolitems; j++ )
6142 if( coefs[nonsolitems[j]] == 1 )
6144flowcoverstatus[nonsolitems[j]] = 1;
6145(*nflowcovervars)++;
6146 SCIPquadprecSumQD(*flowcoverweight, *flowcoverweight, vubcoefs[nonsolitems[j]]);
6151assert(coefs[nonsolitems[j]] == -1);
6152flowcoverstatus[nonsolitems[j]] = -1;
6153(*nnonflowcovervars)++;
6162#ifndef NO_EXACT_KNAPSACK 6177assert(mindelta <= 0.0);
6178assert(maxdelta >= 0.0);
6180sval = val * scalar;
6181downval = floor(sval);
6202assert(mindelta <= 0.0);
6203assert(maxdelta >= 0.0);
6205sval = val * scalar;
6224 int* nflowcovervars,
6225 int* nnonflowcovervars,
6226 int* flowcoverstatus,
6245#if !defined(NDEBUG) || defined(SCIP_DEBUG) 6251 intnflowcovervarsafterfix;
6254 intnnonflowcovervarsafterfix;
6264assert(nflowcovervars !=
NULL);
6265assert(nnonflowcovervars !=
NULL);
6266assert(flowcoverstatus !=
NULL);
6267assert(lambda !=
NULL);
6268assert(found !=
NULL);
6270 SCIPdebugMsg(
scip,
"--------------------- get flow cover ----------------------------------------------------\n");
6284*nflowcovervars = 0;
6285*nnonflowcovervars = 0;
6288nflowcovervarsafterfix = 0;
6289nnonflowcovervarsafterfix = 0;
6291#if !defined(NDEBUG) || defined(SCIP_DEBUG) 6305n1itemsweight = 0.0;
6316flowcoverstatus[j] = -1;
6317(*nnonflowcovervars)++;
6337flowcoverstatus[j] = -1;
6338(*nnonflowcovervars)++;
6344flowcoverstatus[j] = 1;
6345(*nflowcovervars)++;
6352flowcoverstatus[j] = 1;
6353(*nflowcovervars)++;
6361flowcoverstatus[j] = -1;
6362(*nnonflowcovervars)++;
6366assert((*nflowcovervars) + (*nnonflowcovervars) + nitems == snf->
ntransvars);
6367assert(nn1items >= 0);
6400transweightsrealintegral =
TRUE;
6401 for( j = 0; j < nitems; j++ )
6406transweightsrealintegral =
FALSE;
6411 SCIPdebugMsg(
scip,
" <%d>: j in N1: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
6412items[j], transprofitsreal[j],
SCIPisIntegral(
scip, transweightsreal[j]) ?
"":
" ----> NOT integral");
6417 SCIPdebugMsg(
scip,
" <%d>: j in N2: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
6418items[j], transprofitsreal[j],
SCIPisIntegral(
scip, transweightsreal[j]) ?
"":
" ----> NOT integral");
6423 SCIPdebugMsg(
scip,
" transcapacity = -rhs(%g) + flowcoverweight(%g) + n1itemsweight(%g) = %g\n",
6436assert(nitems >= 0);
6452 if( transweightsrealintegral )
6456scalesuccess =
TRUE;
6460scalesuccess =
FALSE;
6476 for( j = 0; j < nitems; ++j )
6478transweightsint[j] = getIntegralVal(transweightsreal[j], scalar, -
MINDELTA,
MAXDELTA);
6479transprofitsint[j] = transprofitsreal[j];
6480itemsint[j] = items[j];
6484transcapacityint = getIntegralVal(transcapacityreal, scalar, -
MINDELTA,
MAXDELTA);
6485transcapacityint -= 1;
6488transcapacityint = (
SCIP_Longint) (transcapacityreal * scalar);
6489nflowcovervarsafterfix = *nflowcovervars;
6490nnonflowcovervarsafterfix = *nnonflowcovervars;
6494tmp2 = (
SCIP_Real) ((transcapacityint) + 1);
6495 if( transcapacityint * nitems <= MAXDYNPROGSPACE && tmp1 * tmp2 <= INT_MAX / 8.0)
6501itemsint, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL, &success));
6507transcapacityreal, items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL));
6509#if !defined(NDEBUG) || defined(SCIP_DEBUG) 6518items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL));
6526items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL));
6530assert(nsolitems != -1);
6531assert(nnonsolitems != -1);
6534assert(*nflowcovervars + *nnonflowcovervars + nsolitems + nnonsolitems == snf->
ntransvars);
6536nnonflowcovervars, flowcoverstatus,
QUAD(&flowcoverweight), lambda);
6537assert(*nflowcovervars + *nnonflowcovervars == snf->
ntransvars);
6546items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL));
6552*nflowcovervars = nflowcovervarsafterfix;
6553*nnonflowcovervars = nnonflowcovervarsafterfix;
6556assert(*nflowcovervars + *nnonflowcovervars + nsolitems + nnonsolitems == snf->
ntransvars);
6558nnonflowcovervars, flowcoverstatus,
QUAD(&flowcoverweight), lambda);
6559assert(*nflowcovervars + *nnonflowcovervars == snf->
ntransvars);
6568 SCIPdebugMsg(
scip,
"2. %s solution:\n", kpexact ?
"exact":
"approximate");
6571 if( snf->
transvarcoefs[j] == 1 && flowcoverstatus[j] == 1 )
6575 else if( snf->
transvarcoefs[j] == -1 && flowcoverstatus[j] == 1 )
6608 int* nflowcovervars,
6609 int* nnonflowcovervars,
6610 int* flowcoverstatus,
6639assert(nflowcovervars !=
NULL);
6640assert(nnonflowcovervars !=
NULL);
6641assert(flowcoverstatus !=
NULL);
6642assert(lambda !=
NULL);
6643assert(found !=
NULL);
6645 SCIPdebugMsg(
scip,
"--------------------- get flow cover ----------------------------------------------------\n");
6658*nflowcovervars = 0;
6659*nnonflowcovervars = 0;
6672n1itemsweight = 0.0;
6683flowcoverstatus[j] = -1;
6684(*nnonflowcovervars)++;
6706flowcoverstatus[j] = -1;
6707(*nnonflowcovervars)++;
6713flowcoverstatus[j] = 1;
6714(*nflowcovervars)++;
6721flowcoverstatus[j] = 1;
6722(*nflowcovervars)++;
6730flowcoverstatus[j] = -1;
6731(*nnonflowcovervars)++;
6735assert((*nflowcovervars) + (*nnonflowcovervars) + nitems == snf->
ntransvars);
6736assert(nn1items >= 0);
6769 for( j = 0; j < nitems; j++ )
6776 SCIPdebugMsg(
scip,
" <%d>: j in N1: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
6777items[j], transprofitsreal[j],
SCIPisIntegral(
scip, transweightsreal[j]) ?
"":
" ----> NOT integral");
6782 SCIPdebugMsg(
scip,
" <%d>: j in N2: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
6783items[j], transprofitsreal[j],
SCIPisIntegral(
scip, transweightsreal[j]) ?
"":
" ----> NOT integral");
6788 SCIPdebugMsg(
scip,
" transcapacity = -rhs(%g) + flowcoverweight(%g) + n1itemsweight(%g) = %g\n",
6801assert(nitems >= 0);
6820items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL));
6822assert(nsolitems != -1);
6823assert(nnonsolitems != -1);
6826assert(*nflowcovervars + *nnonflowcovervars + nsolitems + nnonsolitems == snf->
ntransvars);
6828nnonflowcovervars, flowcoverstatus,
QUAD(&flowcoverweight), lambda);
6829assert(*nflowcovervars + *nnonflowcovervars == snf->
ntransvars);
6841 if( snf->
transvarcoefs[j] == 1 && flowcoverstatus[j] == 1 )
6845 else if( snf->
transvarcoefs[j] == -1 && flowcoverstatus[j] == 1 )
6882assert( liftingdata !=
NULL);
6884xpluslambda =
x+ liftingdata->
lambda;
6887 while( i < liftingdata->
r&&
SCIPisGT(
scip, xpluslambda, liftingdata->
M[i+1]) )
6890 if( i < liftingdata->t )
6894assert(
SCIPisLE(
scip, xpluslambda, liftingdata->
M[i+1]));
6895 returni * liftingdata->
lambda;
6898assert(i > 0 &&
SCIPisLE(
scip, liftingdata->
M[i], xpluslambda) && x <= liftingdata->M[i]);
6907 if( i < liftingdata->
r)
6926 returni * liftingdata->
lambda;
6930 MAX(0.0, liftingdata->
m[i] - (liftingdata->
mp- liftingdata->
lambda) - liftingdata->
ml)));
6938assert(i == liftingdata->
r&&
SCIPisLE(
scip, liftingdata->
M[liftingdata->
r], xpluslambda));
6967vubcoefpluslambda = vubcoef + liftingdata->
lambda;
6970 while( i < liftingdata->
r&&
SCIPisGT(
scip, vubcoefpluslambda, liftingdata->
M[i+1]) )
6976assert(liftingdata->
M[i] < vubcoefpluslambda);
6985assert(i == liftingdata->
r||
SCIPisLE(
scip, vubcoefpluslambda, liftingdata->
M[i+1]));
6996 int* transvarflowcoverstatus,
7011liftingdata->
m=
NULL;
7012liftingdata->
M=
NULL;
7014liftingdata->
t= 0;
7020liftingdata->
r= 0;
7032 ints = (snf->
transvarcoefs[i] + 1) + (transvarflowcoverstatus[i] + 1)/2;
7038assert(snf->
transvarcoefs[i] == -1 && transvarflowcoverstatus[i] == -1);
7052assert(snf->
transvarcoefs[i] == -1 && transvarflowcoverstatus[i] == 1);
7057assert(snf->
transvarcoefs[i] == 1 && transvarflowcoverstatus[i] == 1);
7098 for( i = 0; i < liftingdata->
r; ++i)
7113 while( liftingdata->
t< liftingdata->
r&& liftingdata->
m[liftingdata->
t] == liftingdata->
mp)
7116liftingdata->
lambda= lambda;
7140 int* flowcoverstatus,
7156assert( liftingdata.
m!=
NULL);
7157assert( liftingdata.
M!=
NULL);
7159assert( liftingdata.
r>= 0 );
7160assert( liftingdata.
t>= 0 );
7169 ints = (snf->
transvarcoefs[i] + 1) + (flowcoverstatus[i] + 1)/2;
7214assert(snf->
transvarcoefs[i] == -1 && flowcoverstatus[i] == 1);
7220 if( liftedbincoef != 0.0 )
7235assert(snf->
transvarcoefs[i] == 1 && flowcoverstatus[i] == -1);
7238assert(alpha == 0 || alpha == 1);
7297 if( snf->
origbinvars[i] != -1 && bincoef != 0.0 )
7325 for( i = 0; i < aggrrow->
nrows; ++i )
7334assert(slackcoef != 0.0);
7337 if( slackcoef > 0.0 )
7340row = rows[aggrrow->
rowsinds[i]];
7355slackub = rowrhs - rowlhs;
7368slackub = -aggrrow->
rowweights[i] *
MIN(rhsslack, slackub);
7382slackub = aggrrow->
rowweights[i] *
MIN(lhsslack, slackub);
7440 int*transvarflowcoverstatus;
7442 intnnonflowcovervars;
7454 SCIP_CALL(
constructSNFRelaxation(
scip, sol, boundswitch, allowlocal, aggrrow->
vals,
QUAD(aggrrow->rhs), aggrrow->
inds, aggrrow->
nnz, &snf, success, &localbdsused) );
7461*cutislocal = aggrrow->
local|| localbdsused;
7465 SCIP_CALL(
getFlowCover(
scip, &snf, &nflowcovervars, &nnonflowcovervars, transvarflowcoverstatus, &lambda, success) );
7496 for( i = 0; i < *cutnnz; ++i )
7499assert(tmpcoefs[j] != 0.0);
7500cutcoefs[i] = tmpcoefs[j];
7504 if( cutefficacy !=
NULL)
7505*cutefficacy =
calcEfficacy(
scip, sol, cutcoefs, *cutrhs, cutinds, *cutnnz);
7507 if( cutrank !=
NULL)
7508*cutrank = aggrrow->
rank+ 1;
7513 for( i = 0; i < *cutnnz; ++i )
7516assert(tmpcoefs[j] != 0.0);
7560 intaggrrowbinstart;
7564assert(varsign !=
NULL);
7565assert(boundtype !=
NULL);
7566assert(success !=
NULL);
7567assert(localbdsused !=
NULL);
7585 for( i = 0; i < *nnz && cutinds[i] >= firstnonbinvar; ++i )
7623aggrrowbinstart = i;
7626 for( i = 0; i < aggrrowbinstart; ++i )
7638assert(i == aggrrowbinstart);
7641 if( aggrrowbinstart != 0 )
7643*nnz -= aggrrowbinstart;
7663assert(v < firstnonbinvar);
7683*localbdsused = *localbdsused || (boundtype[i] == -2);
7711assert(boundtype[i] == -1 || boundtype[i] == -2);
7720cutinds[i] = cutinds[*nnz];
7765 for( k = 0; k < cutnnz; ++k )
7773 if( varsign[k] == -1 )
7774solval = 1 - solval;
7779coverpos[*coversize] = k;
7800 SCIPsortDownRealInt(covervals + (*coversize), coverpos + (*coversize), cutnnz - (*coversize));
7805 while( *coversize < cutnnz &&
7810k = coverpos[*coversize];
7824assert(*coversize > 0);
7865 for( k = 1; k < coversize; ++k )
7911 for( k = 0; k < coversize; ++k )
7929coverstatus[coverpos[k]] = -1;
7934coverstatus[coverpos[k]] = -1;
8011 while(
h< coversize )
8026covervals[
h], cutcoef);
8083assert(aggrrow !=
NULL);
8084assert(cutcoefs !=
NULL);
8085assert(cutrhs !=
NULL);
8086assert(cutinds !=
NULL);
8087assert(cutnnz !=
NULL);
8088assert(cutefficacy !=
NULL);
8089assert(cutislocal !=
NULL);
8090assert(success !=
NULL);
8094 if( aggrrow->
nnz== 0 )
8097 for( k = 0; k < aggrrow->
nrows; ++k )
8115nnz = aggrrow->
nnz;
8120 for( k = 0; k < nnz; ++k )
8128assert(
QUAD_HI(coef) != 0.0);
8139local = aggrrow->
local;
8141tmpcoefs,
QUAD(&rhs), tmpinds, &nnz, varsign, boundtype, &local, &transformed) );
8143assert(allowlocal || !local);
8152coverpos, covervals, &coversize,
QUAD(&coverweight)) )
8156assert(coversize > 0);
8161 if( coversize == 1 )
8166 for( k = 0; k < nnz; ++k )
8168 if( coverstatus[k] == 0 )
8174tmpinds[0] = tmpinds[k];
8175varsign[0] = varsign[k];
8180 if( varsign[0] == -1 )
8210 QUAD(coverweight), covervals, coverstatus,
QUAD(&abar), &cplussize);
8214 for( k = 0; k < nnz; )
8217 if( coverstatus[k] == -1 )
8225 SCIPdebugMsg(
scip,
"load QUAD(coef) from tmpcoefs[tmpinds[k] = %d]\n",tmpinds[k]);
8234 if( cutcoef == 0.0 )
8239coverstatus[k] = coverstatus[nnz];
8240tmpinds[k] = tmpinds[nnz];
8241varsign[k] = varsign[nnz];
8247 if( varsign[k] == -1 )
8266*success = efficacy > *cutefficacy;
8274*cutislocal = local;
8279 for( k = 0; k < nnz; ++k )
8285assert(
QUAD_HI(coef) != 0.0);
8293assert( cutefficacy !=
NULL);
8296*cutefficacy =
calcEfficacy(
scip, sol, cutcoefs, *cutrhs, cutinds, nnz);
8298 if( cutrank !=
NULL)
8299*cutrank = aggrrow->
rank+ 1;
8310 for( k = 0; k < nnz; ++k )
8318 if(tmpcoefs[k] != 0.0)
8393 intaggrrowintstart;
8398assert(varsign !=
NULL);
8399assert(boundtype !=
NULL);
8400assert(freevariable !=
NULL);
8401assert(localbdsused !=
NULL);
8403*freevariable =
FALSE;
8404*localbdsused =
FALSE;
8420 for( i = 0; i < *nnz && cutinds[i] >= firstcontvar; ++i )
8432 SCIP_CALL(
findBestLb(
scip, vars[v], sol, usevbds ? 2 : 0, allowlocal, bestbds + i, &simplebound, boundtype + i) );
8437*freevariable =
TRUE;
8448 SCIP_CALL(
findBestUb(
scip, vars[v], sol, usevbds ? 2 : 0, allowlocal, bestbds + i, &simplebound, boundtype + i) );
8453*freevariable =
TRUE;
8462aggrrowintstart = i;
8465 for( i = 0; i < aggrrowintstart; ++i )
8470assert(i == aggrrowintstart);
8485assert(v < firstcontvar);
8494cutinds[i] = cutinds[*nnz];
8501 SCIP_CALL(
determineBestBounds(
scip, vars[v], sol, boundswitch, 0, allowlocal,
FALSE,
FALSE,
NULL,
NULL,
8502&bestlb, &bestub, &bestlbtype, &bestubtype, &selectedbound, freevariable) );
8505 if( *freevariable )
8513boundtype[i] = bestlbtype;
8521boundtype[i] = bestubtype;
8527assert(boundtype[i] == -1 || boundtype[i] == -2);
8614 intaggrrowintstart;
8617assert(cutcoefs !=
NULL);
8618assert(cutinds !=
NULL);
8619assert(nnz !=
NULL);
8620assert(boundtype !=
NULL);
8621assert(varsign !=
NULL);
8637 while( i < *nnz && cutinds[i] >= firstcontvar )
8644assert(cutinds[i] < firstcontvar);
8651 for( i = *nnz - 1; i >= 0 && cutinds[i] < firstcontvar; --i )
8666assert(var !=
NULL);
8668assert(boundtype[i] == -1 || boundtype[i] == -2);
8669assert(varsign[i] == +1 || varsign[i] == -1);
8702cutinds[i] = cutinds[*nnz];
8709assert(boundtype[i] < 0);
8712 if( varsign[i] == +1 )
8715 if( boundtype[i] == -1 )
8724 if( boundtype[i] == -1 )
8735aggrrowintstart = i + 1;
8739 for( i = 0; i < aggrrowintstart; ++i )
8749assert(var !=
NULL);
8752assert(varsign[i] == +1 || varsign[i] == -1);
8763 if( aggrrowintstart > 0 )
8766assert(aggrrowintstart <= *nnz);
8770 for( i = 0; i < aggrrowintstart; ++i )
8777*nnz -= aggrrowintstart;
8778 if( *nnz < aggrrowintstart )
8829assert(weights !=
NULL);
8830assert(slacksign !=
NULL);
8831assert(rowinds !=
NULL);
8833assert(cutcoefs !=
NULL);
8835assert(cutinds !=
NULL);
8836assert(nnz !=
NULL);
8843 for( i = 0; i < nrowinds; i++ )
8855assert(slacksign[i] == -1 || slacksign[i] == +1);
8859assert(row !=
NULL);
8912 if( slacksign[i] == +1 )
9002assert(aggrrow !=
NULL);
9004assert(cutcoefs !=
NULL);
9005assert(cutrhs !=
NULL);
9006assert(cutinds !=
NULL);
9007assert(success !=
NULL);
9008assert(cutislocal !=
NULL);
9018 for( i = 0; i < aggrrow->
nrows; ++i )
9030*cutnnz = aggrrow->
nnz;
9031*cutislocal = aggrrow->
local;
9040 for( i = 0; i < *cutnnz; ++i )
9049assert(
QUAD_HI(coef) != 0.0);
9070tmpcoefs,
QUAD(&rhs), cutinds, cutnnz, varsign, boundtype, &freevariable, &localbdsused) );
9072assert(allowlocal || !localbdsused);
9073*cutislocal = *cutislocal || localbdsused;
9081 for( i = *cutnnz - 1; i >= 0 && cutinds[i] < firstcontvar; --i )
9167aggrrow->
nrows, scale, tmpcoefs,
QUAD(&rhs), cutinds, cutnnz,
QUAD(f0), k) );
9188 for( i = 0; i < *cutnnz; ++i )
9194assert(
QUAD_HI(coef) != 0.0);
9201 if( cutefficacy !=
NULL)
9202*cutefficacy =
calcEfficacy(
scip, sol, cutcoefs, *cutrhs, cutinds, *cutnnz);
9204 if( cutrank !=
NULL)
9205*cutrank = aggrrow->
rank+ 1;
9215 for( i = 0; i < *cutnnz; ++i )
static SCIP_Real computeMIREfficacy(SCIP *scip, SCIP_Real *RESTRICT coefs, SCIP_Real *RESTRICT solvals, SCIP_Real rhs, SCIP_Real contactivity, SCIP_Real contsqrnorm, SCIP_Real delta, int nvars, SCIP_Real minfrac, SCIP_Real maxfrac)
static SCIP_RETCODE cutsTransformMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, SCIP_Bool ignoresol, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *nnz, int *varsign, int *boundtype, SCIP_Bool *freevariable, SCIP_Bool *localbdsused)
static void performBoundSubstitutionSimple(SCIP *scip, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int boundtype, SCIP_Real boundval, int probindex, SCIP_Bool *localbdsused)
static void prepareLiftingData(SCIP *scip, SCIP_Real *cutcoefs, int *cutinds, QUAD(SCIP_Real cutrhs), int *coverpos, int coversize, QUAD(SCIP_Real coverweight), SCIP_Real *covervals, int *coverstatus, QUAD(SCIP_Real *abar), int *cplussize)
static SCIP_RETCODE cutsTransformKnapsackCover(SCIP *scip, SCIP_SOL *sol, SCIP_Bool allowlocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *nnz, int *varsign, int *boundtype, SCIP_Bool *localbdsused, SCIP_Bool *success)
static SCIP_DECL_SORTINDCOMP(compareAbsCoefsQuad)
static SCIP_RETCODE findBestLb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, int usevbds, SCIP_Bool allowlocal, SCIP_Real *bestlb, SCIP_Real *simplebound, int *bestlbtype)
static SCIP_Real calcEfficacyDenseStorageQuad(SCIP *scip, SCIP_SOL *sol, SCIP_Real *cutcoefs, SCIP_Real cutrhs, int *cutinds, int cutnnz)
static SCIP_Bool removeZerosQuad(SCIP *scip, SCIP_Real minval, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *cutnnz)
static SCIP_RETCODE cutsSubstituteStrongCG(SCIP *scip, SCIP_Real *weights, int *slacksign, int *rowinds, int nrowinds, SCIP_Real scale, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *nnz, QUAD(SCIP_Real f0), SCIP_Real k)
static SCIP_RETCODE computeLiftingData(SCIP *scip, SNF_RELAXATION *snf, int *transvarflowcoverstatus, SCIP_Real lambda, LIFTINGDATA *liftingdata, SCIP_Bool *valid)
static SCIP_RETCODE getClosestVlb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *rowcoefs, int8_t *binvarused, SCIP_Real bestsub, SCIP_Real rowcoef, SCIP_Real *closestvlb, int *closestvlbidx)
static SCIP_RETCODE getFlowCover(SCIP *scip, SNF_RELAXATION *snf, int *nflowcovervars, int *nnonflowcovervars, int *flowcoverstatus, SCIP_Real *lambda, SCIP_Bool *found)
static SCIP_RETCODE determineBestBounds(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real boundswitch, int usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, SCIP_Bool ignoresol, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, SCIP_Real *bestlb, SCIP_Real *bestub, int *bestlbtype, int *bestubtype, SCIP_BOUNDTYPE *selectedbound, SCIP_Bool *freevariable)
static SCIP_RETCODE getClosestVub(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *rowcoefs, int8_t *binvarused, SCIP_Real bestslb, SCIP_Real rowcoef, SCIP_Real *closestvub, int *closestvubidx)
static SCIP_RETCODE cutsTransformStrongCG(SCIP *scip, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *nnz, int *varsign, int *boundtype, SCIP_Bool *freevariable, SCIP_Bool *localbdsused)
static SCIP_Real evaluateLiftingFunctionKnapsack(SCIP *scip, QUAD(SCIP_Real x), QUAD(SCIP_Real abar), SCIP_Real *covervals, int coversize, int cplussize, SCIP_Real *scale)
static SCIP_Bool chgCoeffWithBound(SCIP *scip, SCIP_VAR *var, SCIP_Real oldcoeff, SCIP_Real newcoeff, SCIP_Bool cutislocal, QUAD(SCIP_Real *cutrhs))
static SCIP_Bool chgQuadCoeffWithBound(SCIP *scip, SCIP_VAR *var, QUAD(SCIP_Real oldcoeff), SCIP_Real newcoeff, SCIP_Bool cutislocal, QUAD(SCIP_Real *cutrhs))
static SCIP_RETCODE constructSNFRelaxation(SCIP *scip, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool allowlocal, SCIP_Real *rowcoefs, QUAD(SCIP_Real rowrhs), int *rowinds, int nnz, SNF_RELAXATION *snf, SCIP_Bool *success, SCIP_Bool *localbdsused)
static SCIP_RETCODE postprocessCutQuad(SCIP *scip, SCIP_Bool cutislocal, int *cutinds, SCIP_Real *cutcoefs, int *nnz, QUAD(SCIP_Real *cutrhs), SCIP_Bool *success)
static SCIP_RETCODE cutsRoundMIR(SCIP *scip, SCIP_Real *RESTRICT cutcoefs, QUAD(SCIP_Real *RESTRICT cutrhs), int *RESTRICT cutinds, int *RESTRICT nnz, int *RESTRICT varsign, int *RESTRICT boundtype, QUAD(SCIP_Real f0))
static void performBoundSubstitution(SCIP *scip, int *cutinds, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *nnz, int varsign, int boundtype, SCIP_Real boundval, int probindex, SCIP_Bool *localbdsused)
static void destroyLiftingData(SCIP *scip, LIFTINGDATA *liftingdata)
static SCIP_RETCODE varVecAddScaledRowCoefsQuad(int *RESTRICT inds, SCIP_Real *RESTRICT vals, int *RESTRICT nnz, SCIP_ROW *row, SCIP_Real scale)
static SCIP_Real calcEfficacyNormQuad(SCIP *scip, SCIP_Real *vals, int *inds, int nnz)
static SCIP_RETCODE cutTightenCoefs(SCIP *scip, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *cutnnz, SCIP_Bool *redundant)
static SCIP_Bool removeZeros(SCIP *scip, SCIP_Real minval, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *cutnnz)
struct LiftingData LIFTINGDATA
static SCIP_RETCODE SCIPsolveKnapsackApproximatelyLT(SCIP *scip, int nitems, SCIP_Real *weights, SCIP_Real *profits, SCIP_Real capacity, int *items, int *solitems, int *nonsolitems, int *nsolitems, int *nnonsolitems, SCIP_Real *solval)
static SCIP_RETCODE determineBoundForSNF(SCIP *scip, SCIP_SOL *sol, SCIP_VAR **vars, SCIP_Real *rowcoefs, int *rowinds, int varposinrow, int8_t *binvarused, SCIP_Bool allowlocal, SCIP_Real boundswitch, SCIP_Real *bestlb, SCIP_Real *bestub, SCIP_Real *bestslb, SCIP_Real *bestsub, int *bestlbtype, int *bestubtype, int *bestslbtype, int *bestsubtype, SCIP_BOUNDTYPE *selectedbounds, SCIP_Bool *freevariable)
static SCIP_RETCODE postprocessCut(SCIP *scip, SCIP_Bool cutislocal, int *cutinds, SCIP_Real *cutcoefs, int *nnz, SCIP_Real *cutrhs, SCIP_Bool *success)
static void destroySNFRelaxation(SCIP *scip, SNF_RELAXATION *snf)
static SCIP_RETCODE allocSNFRelaxation(SCIP *scip, SNF_RELAXATION *snf, int nvars)
static SCIP_RETCODE cutsRoundStrongCG(SCIP *scip, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *nnz, int *varsign, int *boundtype, QUAD(SCIP_Real f0), SCIP_Real k)
static SCIP_Real calcEfficacy(SCIP *scip, SCIP_SOL *sol, SCIP_Real *cutcoefs, SCIP_Real cutrhs, int *cutinds, int cutnnz)
static void buildFlowCover(SCIP *scip, int *coefs, SCIP_Real *vubcoefs, SCIP_Real rhs, int *solitems, int *nonsolitems, int nsolitems, int nnonsolitems, int *nflowcovervars, int *nnonflowcovervars, int *flowcoverstatus, QUAD(SCIP_Real *flowcoverweight), SCIP_Real *lambda)
static SCIP_RETCODE generateLiftedFlowCoverCut(SCIP *scip, SNF_RELAXATION *snf, SCIP_AGGRROW *aggrrow, int *flowcoverstatus, SCIP_Real lambda, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *nnz, SCIP_Bool *success)
static void getAlphaAndBeta(SCIP *scip, LIFTINGDATA *liftingdata, SCIP_Real vubcoef, int *alpha, SCIP_Real *beta)
static SCIP_RETCODE cutsSubstituteMIR(SCIP *scip, SCIP_Real *weights, int *slacksign, int *rowinds, int nrowinds, SCIP_Real scale, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *nnz, QUAD(SCIP_Real f0))
static SCIP_RETCODE addOneRow(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_ROW *row, SCIP_Real weight, SCIP_Bool sidetypebasis, SCIP_Bool allowlocal, int negslack, int maxaggrlen, SCIP_Bool *rowtoolong)
static SCIP_RETCODE varVecAddScaledRowCoefsQuadScale(int *RESTRICT inds, SCIP_Real *RESTRICT vals, int *RESTRICT nnz, SCIP_ROW *row, QUAD(SCIP_Real scale))
struct SNF_Relaxation SNF_RELAXATION
static SCIP_RETCODE cutTightenCoefsQuad(SCIP *scip, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *cutnnz, SCIP_Bool *redundant)
static SCIP_Real evaluateLiftingFunction(SCIP *scip, LIFTINGDATA *liftingdata, SCIP_Real x)
static SCIP_RETCODE varVecAddScaledRowCoefs(int *RESTRICT inds, SCIP_Real *RESTRICT vals, int *RESTRICT nnz, SCIP_ROW *row, SCIP_Real scale)
static SCIP_RETCODE findBestUb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, int usevbds, SCIP_Bool allowlocal, SCIP_Real *bestub, SCIP_Real *simplebound, int *bestubtype)
static SCIP_Bool computeInitialKnapsackCover(SCIP *scip, SCIP_SOL *sol, SCIP_Real *cutcoefs, int *cutinds, SCIP_Real cutrhs, int cutnnz, int *varsign, int *coverstatus, int *coverpos, SCIP_Real *covervals, int *coversize, QUAD(SCIP_Real *coverweight))
methods for the aggregation rows
defines macros for basic operations in double-double arithmetic giving roughly twice the precision of...
#define QUAD_ARRAY_STORE(a, idx, x)
#define SCIPquadprecProdDD(r, a, b)
#define SCIPquadprecProdQD(r, a, b)
#define SCIPquadprecProdQQ(r, a, b)
#define SCIPquadprecSumQD(r, a, b)
#define QUAD_ARRAY_SIZE(size)
#define SCIPquadprecEpsFloorQ(r, a, eps)
#define QUAD_ASSIGN(a, constant)
#define SCIPquadprecFloorQ(r, a)
#define SCIPquadprecEpsCeilQ(r, a, eps)
#define SCIPquadprecSumDD(r, a, b)
#define SCIPquadprecSumQQ(r, a, b)
#define SCIPquadprecDivDQ(r, a, b)
#define QUAD_ASSIGN_Q(a, b)
#define QUAD_ARRAY_LOAD(r, a, idx)
#define SCIPquadprecDivDD(r, a, b)
#define SCIP_CALL_ABORT(x)
SCIP_RETCODE SCIPsolveKnapsackExactly(SCIP *scip, int nitems, SCIP_Longint *weights, SCIP_Real *profits, SCIP_Longint capacity, int *items, int *solitems, int *nonsolitems, int *nsolitems, int *nnonsolitems, SCIP_Real *solval, SCIP_Bool *success)
int SCIPgetNContVars(SCIP *scip)
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
int SCIPgetNVars(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
int SCIPgetNBinVars(SCIP *scip)
#define SCIPdebugMsgPrint
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
SCIP_RETCODE SCIPcalcIntegralScalar(SCIP_Real *vals, int nvals, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Real *intscalar, SCIP_Bool *success)
SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
void SCIPaggrRowCancelVarWithBound(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_VAR *var, int pos, SCIP_Bool *valid)
SCIP_Bool SCIPaggrRowHasRowBeenAdded(SCIP_AGGRROW *aggrrow, SCIP_ROW *row)
int SCIPaggrRowGetRank(SCIP_AGGRROW *aggrrow)
SCIP_RETCODE SCIPcutGenerationHeuristicCMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, int maxtestdelta, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)
SCIP_Bool SCIPcutsTightenCoefficients(SCIP *scip, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, int *nchgcoefs)
SCIP_RETCODE SCIPaggrRowCreate(SCIP *scip, SCIP_AGGRROW **aggrrow)
SCIP_RETCODE SCIPcalcStrongCG(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real scale, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)
SCIP_RETCODE SCIPcalcKnapsackCover(SCIP *scip, SCIP_SOL *sol, SCIP_Bool allowlocal, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)
void SCIPaggrRowClear(SCIP_AGGRROW *aggrrow)
SCIP_RETCODE SCIPaggrRowCopy(SCIP *scip, SCIP_AGGRROW **aggrrow, SCIP_AGGRROW *source)
SCIP_Bool SCIPaggrRowIsLocal(SCIP_AGGRROW *aggrrow)
SCIP_Real SCIPaggrRowGetRhs(SCIP_AGGRROW *aggrrow)
SCIP_Bool SCIPisEfficacious(SCIP *scip, SCIP_Real efficacy)
int SCIPaggrRowGetNRows(SCIP_AGGRROW *aggrrow)
SCIP_RETCODE SCIPaggrRowAddCustomCons(SCIP *scip, SCIP_AGGRROW *aggrrow, int *inds, SCIP_Real *vals, int len, SCIP_Real rhs, SCIP_Real weight, int rank, SCIP_Bool local)
void SCIPaggrRowFree(SCIP *scip, SCIP_AGGRROW **aggrrow)
int * SCIPaggrRowGetInds(SCIP_AGGRROW *aggrrow)
void SCIPaggrRowPrint(SCIP *scip, SCIP_AGGRROW *aggrrow, FILE *file)
void SCIPaggrRowRemoveZeros(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_Bool useglbbounds, SCIP_Bool *valid)
SCIP_Real * SCIPaggrRowGetRowWeights(SCIP_AGGRROW *aggrrow)
int SCIPaggrRowGetNNz(SCIP_AGGRROW *aggrrow)
SCIP_RETCODE SCIPaggrRowAddRow(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_ROW *row, SCIP_Real weight, int sidetype)
int * SCIPaggrRowGetRowInds(SCIP_AGGRROW *aggrrow)
SCIP_RETCODE SCIPaggrRowSumRows(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_Real *weights, int *rowinds, int nrowinds, SCIP_Bool sidetypebasis, SCIP_Bool allowlocal, int negslack, int maxaggrlen, SCIP_Bool *valid)
int SCIPgetNCuts(SCIP *scip)
SCIP_RETCODE SCIPaggrRowAddObjectiveFunction(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_Real rhs, SCIP_Real scale)
SCIP_RETCODE SCIPcalcFlowCover(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, SCIP_Bool allowlocal, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)
SCIP_Real SCIPaggrRowCalcEfficacyNorm(SCIP *scip, SCIP_AGGRROW *aggrrow)
SCIP_RETCODE SCIPcalcMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real scale, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
SCIP_ROW ** SCIPgetLPRows(SCIP *scip)
int SCIPgetNLPRows(SCIP *scip)
#define SCIPfreeCleanBufferArray(scip, ptr)
#define SCIPallocCleanBufferArray(scip, ptr, num)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
#define SCIPfreeBufferArrayNull(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
SCIP_Bool SCIProwIsModifiable(SCIP_ROW *row)
SCIP_Real SCIPgetRowMinActivity(SCIP *scip, SCIP_ROW *row)
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
SCIP_Real SCIPgetRowMaxActivity(SCIP *scip, SCIP_ROW *row)
int SCIProwGetLPPos(SCIP_ROW *row)
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
SCIP_BASESTAT SCIProwGetBasisStatus(SCIP_ROW *row)
SCIP_Real SCIPgetRowSolActivity(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_Longint SCIPgetNLPs(SCIP *scip)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_Real SCIPfrac(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPgetHugeValue(SCIP *scip)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisSumLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPvarGetNVlbs(SCIP_VAR *var)
SCIP_Real * SCIPvarGetVlbCoefs(SCIP_VAR *var)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPgetVarClosestVub(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvub, int *closestvubidx)
int SCIPvarGetProbindex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real * SCIPvarGetVlbConstants(SCIP_VAR *var)
int SCIPvarGetNVubs(SCIP_VAR *var)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIP_RETCODE SCIPgetVarClosestVlb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvlb, int *closestvlbidx)
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetVlbVars(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_Real * SCIPvarGetVubConstants(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetVubVars(SCIP_VAR *var)
SCIP_Real * SCIPvarGetVubCoefs(SCIP_VAR *var)
void SCIPselectWeightedDownRealRealInt(SCIP_Real *realarray1, SCIP_Real *realarray2, int *intarray, SCIP_Real *weights, SCIP_Real capacity, int len, int *medianpos)
void SCIPsortDownRealRealInt(SCIP_Real *realarray1, SCIP_Real *realarray2, int *intarray, int len)
SCIP_Bool SCIPsortedvecFindDownReal(SCIP_Real *realarray, SCIP_Real val, int len, int *pos)
void SCIPsortDownReal(SCIP_Real *realarray, int len)
void SCIPsortDownRealInt(SCIP_Real *realarray, int *intarray, int len)
void SCIPsortDownInd(int *indarray, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len)
void SCIPsortDownInt(int *intarray, int len)
static SCIP_Bool isIntegralScalar(SCIP_Real val, SCIP_Real scalar, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Real *intval)
internal methods for LP management
memory allocation routines
#define BMScopyMemoryArray(ptr, source, num)
#define BMSmoveMemoryArray(ptr, source, num)
#define BMSclearMemoryArray(ptr, num)
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
public methods for LP management
public methods for message output
public data structures and miscellaneous methods
methods for selecting (weighted) k-medians
methods for sorting joint arrays of various types
public methods for problem variables
public methods for cuts and aggregation rows
public methods for the LP relaxation, rows and columns
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for global and local (sub)problems
public methods for solutions
public methods for querying solving statistics
public methods for SCIP variables
SCIP_Real * transbinvarsolvals
SCIP_Real * transcontvarsolvals
SCIP_Real * aggrconstants
SCIP_Real * aggrcoefscont
SCIP_Real * transvarvubcoefs
data structures for LP management
SCIP main data structure.
datastructures for global SCIP settings
enum SCIP_BoundType SCIP_BOUNDTYPE
enum SCIP_BaseStat SCIP_BASESTAT
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_VARTYPE_CONTINUOUS
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4