70#define DEFAULT_CUTGEN_POSTPROCESS TRUE
71#define DEFAULT_CUTGEN_BOUNDSWITCH 0.5
72#define DEFAULT_CUTGEN_ALLOWLOCAL TRUE
73#define DEFAULT_CUTGEN_VARTYPEUSEVBDS 2
74#define DEFAULT_CUTGEN_MINFRAC 0.05
75#define DEFAULT_CUTGEN_MAXFRAC 0.999
76#define DEFAULT_CUTGEN_MAXTESTDELTA (-1)
102 for(
int i = 0;
i < cutnnz; ++
i )
121 if( cutcoefs[
i] > 0.0 )
158 for(
i = 0;
i < cutnnz; ++
i )
162 coef = cutcoefs[cutinds[
i]];
177 if( cutcoefs[
i] > 0.0 )
200#define NONZERO(x) (COPYSIGN(1e-100, (x)) + (x))
222 for(
i = 0 ;
i < row->
len; ++
i )
228 val = vals[probindex];
231 inds[(*nnz)++] = probindex;
233 val += row->
vals[
i] * scale;
239 vals[probindex] = val;
267 for(
i = 0 ;
i < row->
len; ++
i )
277 inds[(*nnz)++] = probindex;
314 for(
i = 0 ;
i < row->
len; ++
i )
325 inds[(*nnz)++] = probindex;
395 for(
i = 0 ;
i < row->
len; ++
i )
403 val = vals[probindex];
408 inds[(*nnz)++] = probindex;
426 val = valinterval.
inf;
428 val = valinterval.
sup;
431 val = valinterval.
inf;
437 val = valinterval.
sup;
453 vals[probindex] = val;
483 switch(
scip->set->sepa_efficacynorm )
486 for(
i = 0;
i < cutnnz; ++
i )
489 norm +=
SQR(cutcoefs[
i]);
494 for(
i = 0;
i < cutnnz; ++
i )
500 norm =
MAX(norm, absval);
504 for(
i = 0;
i < cutnnz; ++
i )
511 for(
i = 0;
i < cutnnz; ++
i )
523 return (activity - cutrhs) /
MAX(1e-6, norm);
542 switch(
scip->set->sepa_efficacynorm )
545 for(
i = 0;
i < nnz; ++
i )
553 for(
i = 0;
i < nnz; ++
i )
559 norm =
MAX(norm, absval);
563 for(
i = 0;
i < nnz; ++
i )
570 for(
i = 0;
i < nnz; ++
i )
612 switch(
scip->set->sepa_efficacynorm )
615 for(
i = 0;
i < cutnnz; ++
i )
617 coef = cutcoefs[cutinds[
i]];
624 for(
i = 0;
i < cutnnz; ++
i )
628 coef = cutcoefs[cutinds[
i]];
631 norm =
MAX(norm, absval);
635 for(
i = 0;
i < cutnnz; ++
i )
637 coef = cutcoefs[cutinds[
i]];
643 for(
i = 0;
i < cutnnz; ++
i )
645 coef = cutcoefs[cutinds[
i]];
656 return (activity - cutrhs) /
MAX(1e-6, norm);
683 switch(
scip->set->sepa_efficacynorm )
686 for(
i = 0;
i < cutnnz; ++
i )
695 for(
i = 0;
i < cutnnz; ++
i )
702 norm =
MAX(norm, absval);
706 for(
i = 0;
i < cutnnz; ++
i )
714 for(
i = 0;
i < cutnnz; ++
i )
727 return (activity - cutrhs) /
MAX(1e-6, norm);
758 for(
i = 0;
i < *cutnnz; )
781 if(
EPSZ(val, minval) || isfixed )
792 *cutrhs += (-val) * ub;
802 *cutrhs += (-val) * lb;
810 cutinds[
i] = cutinds[*cutnnz];
848 for(
i = 0;
i < *cutnnz; )
907 cutinds[
i] = cutinds[*cutnnz];
944 for(
i = 0;
i < *cutnnz; )
972 if(
EPSZ(val, minval) || isfixed )
1003 cutinds[
i] = cutinds[*cutnnz];
1032 if( abscoef1 < abscoef2 )
1034 if( abscoef2 < abscoef1 )
1048 abscoef1 =
REALABS(coefs[ind1]);
1049 abscoef2 =
REALABS(coefs[ind2]);
1051 if( abscoef1 < abscoef2 )
1053 if( abscoef2 < abscoef1 )
1246 for(
i = 0;
i < *cutnnz; ++
i )
1262 if( cutinds[
i] < nintegralvars )
1280 if( cutinds[
i] < nintegralvars )
1312 equiscale = 1.0 /
MIN((maxact -
QUAD_TO_DBL(*cutrhs)), maxabsintval);
1314 for(
i = 0;
i < *cutnnz; ++
i )
1325 (
SCIP_Longint)
scip->set->sepa_maxcoefratio,
scip->set->sepa_maxcoefratio, &intscalar, &success) );
1332 intscalar *= equiscale;
1335 for(
i = 0;
i < *cutnnz; )
1364 cutinds[
i] = cutinds[*cutnnz];
1374 for(
i = 0;
i < *cutnnz; ++
i )
1417 maxabsintval *= equiscale;
1419 for(
i = 0;
i < *cutnnz; ++
i )
1436 maxabsval =
MIN(maxabsval, maxabsintval);
1437 maxabsval =
MAX(maxabsval, maxabscontval);
1439 scale = 1.0 / maxabsval;
1444 maxabsintval *= scale;
1446 for(
i = 0;
i < *cutnnz; ++
i )
1471 SCIPsortDownInd(cutinds, compareAbsCoefsQuad, (
void*) cutcoefs, *cutnnz);
1474 for(
i = 0;
i < *cutnnz; )
1478 if( cutinds[
i] >= nintegralvars )
1511 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
1530 cutinds[
i] = cutinds[*cutnnz];
1558 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
1577 cutinds[
i] = cutinds[*cutnnz];
1707 for(
i = 0;
i < *cutnnz; ++
i )
1714 val = cutcoefs[cutinds[
i]];
1723 if( cutinds[
i] < nintegralvars )
1724 maxabsintval =
MAX(maxabsintval, -val);
1727 maxabscontval =
MAX(maxabscontval, -val);
1742 if( cutinds[
i] < nintegralvars )
1743 maxabsintval =
MAX(maxabsintval, val);
1746 maxabscontval =
MAX(maxabscontval, val);
1776 equiscale = 1.0 /
MAX(maxabscontval, maxabsintval);
1778 for(
i = 0;
i < *cutnnz; ++
i )
1782 val = cutcoefs[cutinds[
i]];
1789 (
SCIP_Longint)
scip->set->sepa_maxcoefratio,
scip->set->sepa_maxcoefratio, &intscalar, &success) );
1797 intscalar *= equiscale;
1799 *cutrhs *= intscalar;
1804 mirinfo->
scale = intscalar;
1807 for(
i = 0;
i < *cutnnz; )
1812 val = cutcoefs[cutinds[
i]];
1815 *cutrhs += rhschange;
1837 cutcoefs[cutinds[
i]] = val;
1844 cutcoefs[cutinds[
i]] = val;
1846 cutinds[
i] = cutinds[*cutnnz];
1855 *cutrhs = floor(*cutrhs);
1861 for(
i = 0;
i < *cutnnz; ++
i )
1868 val = cutcoefs[cutinds[
i]];
1874 maxabsintval =
MAX(maxabsintval, -val);
1884 maxabsintval =
MAX(maxabsintval, val);
1909 *cutrhs *= equiscale;
1910 maxabsintval *= equiscale;
1914 mirinfo->
scale = equiscale;
1917 for(
i = 0;
i < *cutnnz; ++
i )
1921 val = cutcoefs[cutinds[
i]];
1930 cutcoefs[cutinds[
i]] = val;
1931 *cutrhs += rhschange;
1944 maxabsval =
MIN(maxabsval, maxabsintval);
1945 maxabsval =
MAX(maxabsval, maxabscontval);
1947 scale = 1.0 / maxabsval;
1953 maxabsintval *= scale;
1957 mirinfo->
scale = scale;
1960 for(
i = 0;
i < *cutnnz; ++
i )
1964 val = cutcoefs[cutinds[
i]];
1967 *cutrhs += rhschange;
1975 cutcoefs[cutinds[
i]] = val;
1988#ifdef SCIP_DISABLED_CODE
1991 for(
i = 0;
i < *cutnnz &&
FALSE; )
1995 if( cutinds[
i] >= nintegralvars )
2028 SCIPdebugPrintf(
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
2047 cutinds[
i] = cutinds[*cutnnz];
2075 SCIPdebugPrintf(
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
2094 cutinds[
i] = cutinds[*cutnnz];
2144 for(
i = 0;
i < *cutnnz; ++
i )
2152 val = cutcoefs[cutinds[
i]];
2161 if( cutinds[
i] < nintegralvars )
2162 maxabsintval =
MAX(maxabsintval, -val);
2165 maxabscontval =
MAX(maxabscontval, -val);
2179 if( cutinds[
i] < nintegralvars )
2180 maxabsintval =
MAX(maxabsintval, val);
2183 maxabscontval =
MAX(maxabscontval, val);
2211 equiscale = 1.0 /
MIN((maxact -
QUAD_TO_DBL(*cutrhs)), maxabsintval);
2213 for(
i = 0;
i < *cutnnz; ++
i )
2217 val = equiscale * cutcoefs[cutinds[
i]];
2223 (
SCIP_Longint)
scip->set->sepa_maxcoefratio,
scip->set->sepa_maxcoefratio, &intscalar, &success) );
2230 intscalar *= equiscale;
2233 for(
i = 0;
i < *cutnnz; )
2238 val = cutcoefs[cutinds[
i]];
2252 cutcoefs[cutinds[
i]] = intval;
2258 cutcoefs[cutinds[
i]] = 0.0;
2260 cutinds[
i] = cutinds[*cutnnz];
2270 for(
i = 0;
i < *cutnnz; ++
i )
2278 val = cutcoefs[cutinds[
i]];
2284 maxabsintval =
MAX(maxabsintval, -val);
2293 maxabsintval =
MAX(maxabsintval, val);
2312 maxabsintval *= equiscale;
2314 for(
i = 0;
i < *cutnnz; ++
i )
2315 cutcoefs[cutinds[
i]] *= equiscale;
2325 maxabsval =
MIN(maxabsval, maxabsintval);
2326 maxabsval =
MAX(maxabsval, maxabscontval);
2328 scale = 1.0 / maxabsval;
2333 maxabsintval *= scale;
2335 for(
i = 0;
i < *cutnnz; ++
i )
2336 cutcoefs[cutinds[
i]] *= scale;
2357 for(
i = 0;
i < *cutnnz; )
2361 if( cutinds[
i] >= nintegralvars )
2367 val = cutcoefs[cutinds[
i]];
2394 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
2410 cutcoefs[cutinds[
i]] = 0.0;
2412 cutinds[
i] = cutinds[*cutnnz];
2440 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
2456 cutcoefs[cutinds[
i]] = 0.0;
2458 cutinds[
i] = cutinds[*cutnnz];
2507 for(
i = 0;
i < *cutnnz; ++
i )
2514 if( cutcoefs[
i] < 0.0 )
2521 if( cutinds[
i] < nintegralvars )
2523 maxabsval =
MAX(maxabsval, -cutcoefs[
i]);
2524 absvals[
i] = -cutcoefs[
i];
2539 if( cutinds[
i] < nintegralvars )
2541 maxabsval =
MAX(maxabsval, cutcoefs[
i]);
2542 absvals[
i] = cutcoefs[
i];
2569 for(
i = 0;
i < *cutnnz; ++
i )
2572 if( cutinds[
i] >= nintegralvars )
2577 if( cutcoefs[
i] < 0.0 &&
SCIPisLE(
scip, maxact + cutcoefs[
i], *cutrhs) )
2584 if( coef > cutcoefs[
i] )
2593 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
2612 cutinds[
i] = cutinds[*cutnnz];
2613 cutcoefs[
i] = cutcoefs[*cutnnz];
2618 else if( cutcoefs[
i] > 0.0 &&
SCIPisLE(
scip, maxact - cutcoefs[
i], *cutrhs) )
2625 if( coef < cutcoefs[
i] )
2634 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
2653 cutinds[
i] = cutinds[*cutnnz];
2654 cutcoefs[
i] = cutcoefs[*cutnnz];
2697 (*aggrrow)->local =
FALSE;
2698 (*aggrrow)->nnz = 0;
2699 (*aggrrow)->rank = 0;
2701 (*aggrrow)->rowsinds =
NULL;
2702 (*aggrrow)->slacksign =
NULL;
2703 (*aggrrow)->rowweights =
NULL;
2704 (*aggrrow)->nrows = 0;
2705 (*aggrrow)->rowssize = 0;
2752 if( aggrrow->
nnz == 0 )
2755 for(
i = 0;
i < aggrrow->
nnz; ++
i )
2786 (*aggrrow)->nnz = source->
nnz;
2789 if( source->
nrows > 0 )
2801 (*aggrrow)->rowsinds =
NULL;
2802 (*aggrrow)->slacksign =
NULL;
2803 (*aggrrow)->rowweights =
NULL;
2806 (*aggrrow)->nrows = source->
nrows;
2807 (*aggrrow)->rowssize = source->
nrows;
2808 (*aggrrow)->rank = source->
rank;
2809 (*aggrrow)->local = source->
local;
2849 if( sidetype == -1 )
2854 else if( sidetype == 1 )
2937 if( sidetype == -1 )
2942 else if( sidetype == 1 )
2976#ifdef SCIP_DISABLED_CODE
2980 sideval = ceil(sideval)
2987#ifdef SCIP_DISABLED_CODE
2991 sideval = floor(sideval);
2997 sidevalchg += sideval * weight;
3033 v = aggrrow->
inds[pos];
3096 if( aggrrow->
nnz == 0 )
3183 for(
i = 0 ;
i < len; ++
i )
3186 int probindex = inds[
i];
3191 aggrrow->
inds[aggrrow->
nnz++] = probindex;
3216 for(
i = 0;
i < aggrrow->
nnz; ++
i )
3238 for(
i = 0;
i < aggrrow->
nnz; ++
i )
3286 *rowtoolong =
FALSE;
3321 if( weight > 0.0 && ((negslack == 0) || (negslack == 1 && !row->
integral)) )
3333 if( weight < 0.0 && ((negslack == 0) || (negslack == 1 && !row->
integral)) )
3368 if( aggrrow->
nnz > maxaggrlen )
3407 *rowtoolong =
FALSE;
3457 if( weight > 0.0 && ((negslack == 0) || (negslack == 1 && !row->
integral)) )
3463#ifdef SCIP_DISABLED_CODE
3467 sideval = ceil(sideval);
3475 if( weight < 0.0 && ((negslack == 0) || (negslack == 1 && !row->
integral)) )
3481#ifdef SCIP_DISABLED_CODE
3485 sideval = floor(sideval);
3492 sidevalchg += sideval * weight;
3522 if( aggrrow->
nnz > maxaggrlen )
3560 SCIP_Bool rowused, rowusedcert, lhsused;
3589 if( rowinds !=
NULL && nrowinds > -1 )
3591 for( k = 0; k < nrowinds; ++k )
3595 SCIP_CALL(
addOneRow(
scip, aggrrow, rows[rowinds[k]], weights[rowinds[k]], sidetypebasis, allowlocal, negslack, maxaggrlen, &rowtoolong) );
3605 negslack, maxaggrlen, &rowtoolong, &rowused,
valid, &lhsused) );
3613 if( certificaterow !=
NULL )
3629 rowusedcert =
FALSE;
3636 allowlocal, 0,
nvars, &rowtoolong, &rowusedcert,
valid, &lhsused) );
3641 usedrows[nusedrows] = rows[rowinds[k]];
3642 usedweights[nusedrows] = weights[rowinds[k]];
3645 if( rowused && !rowusedcert && !integral )
3648 assert( (lhsused && weights[rowinds[k]] >= 0) || ((!lhsused) && weights[rowinds[k]] <= 0) || row->
integral );
3649 negslackrows[nnegslackrows] = rows[rowinds[k]];
3650 negslackweights[nnegslackrows] = -weights[rowinds[k]];
3662 for( k = 0; k < nrows; ++k )
3664 if( weights[k] != 0.0 )
3668 SCIP_CALL(
addOneRow(
scip, aggrrow, rows[k], weights[k], sidetypebasis, allowlocal, negslack, maxaggrlen, &rowtoolong) );
3678 maxaggrlen, &rowtoolong, &rowused,
valid, &lhsused) );
3686 if( certificaterow !=
NULL )
3701 rowusedcert =
FALSE;
3709 nvars, &rowtoolong, &rowusedcert,
valid, &lhsused) );
3714 usedrows[nusedrows] = rows[k];
3715 usedweights[nusedrows] = weights[k];
3718 if( rowused && !rowusedcert && !integral )
3721 assert( (lhsused && weights[k] >= 0) || ((!lhsused) && weights[k] <= 0) || row->
integral );
3722 negslackrows[nnegslackrows] = rows[k];
3723 negslackweights[nnegslackrows] = -weights[k];
3739 if( certificaterow !=
NULL )
3743 negslackrows, negslackweights, nnegslackrows) );
3747 if( certificaterow !=
NULL )
3808 for(
i = 0;
i < *nnz; ++
i )
3811 maxcoef =
MAX(absval, maxcoef);
3814 maxcoef /=
scip->set->sepa_maxcoefratio;
3816 minallowedcoef =
MAX(minallowedcoef, maxcoef);
3818 *success = !
removeZeros(
scip, minallowedcoef, cutislocal, cutcoefs,
QUAD(&rhs), cutinds, nnz);
3873 for(
i = 0;
i < *nnz; ++
i )
3879 maxcoef =
MAX(abscoef, maxcoef);
3882 maxcoef /=
scip->set->sepa_maxcoefratio;
3884 minallowedcoef =
MAX(minallowedcoef, maxcoef);
3941 for(
i = 0;
i < *nnz; ++
i )
3945 coef = cutcoefs[cutinds[
i]];
3947 maxcoef =
MAX(abscoef, maxcoef);
3950 maxcoef /=
scip->set->sepa_maxcoefratio;
3952 minallowedcoef =
MAX(minallowedcoef, maxcoef);
3980 QUAD(&aggrrow->rhs), aggrrow->
inds, &aggrrow->
nnz);
3990 return aggrrow->
nrows;
4029 for(
i = 0;
i < aggrrow->
nrows; ++
i )
4045 return aggrrow->
inds;
4055 return aggrrow->
nnz;
4065 return aggrrow->
rank;
4075 return aggrrow->
local;
4090#define MAXCMIRSCALE 1e+6
4145 if( probindex >= limit )
4149 if( probindex >= limit )
4153 if( probindex >= limit )
4157 if( probindex >= limit )
4161 if( probindex >= limit )
4188 assert(usevbds >= 0 && usevbds <= 2);
4205 *simplebound = *bestlb;
4213 if( bestvlbidx >= 0 && (bestvlb > *bestlb || (*bestlbtype < 0 &&
SCIPisGE(
scip, bestvlb, *bestlb))) )
4224 vlbvar = vlbvars[bestvlbidx];
4231 *bestlbtype = bestvlbidx;
4273 *simplebound = *bestub;
4281 if( bestvubidx >= 0 && (bestvub < *bestub || (*bestubtype < 0 &&
SCIPisLE(
scip, bestvub, *bestub))) )
4292 vubvar = vubvars[bestvubidx];
4299 *bestubtype = bestvubidx;
4319 int* boundsfortrans,
4339 if( boundsfortrans !=
NULL && boundsfortrans[v] > -3 )
4348 *bestlbtype = boundsfortrans[v];
4349 if( *bestlbtype == -1 )
4351 else if( *bestlbtype == -2 )
4366 k = boundsfortrans[v];
4386 *bestubtype = boundsfortrans[v];
4387 if( *bestubtype == -1 )
4389 else if( *bestubtype == -2 )
4404 k = boundsfortrans[v];
4439 *freevariable =
TRUE;
4452 else if(
SCIPisLT(
scip, varsol, (1.0 - boundswitch) * (*bestlb) + boundswitch * (*bestub)) )
4454 else if(
SCIPisGT(
scip, varsol, (1.0 - boundswitch) * (*bestlb) + boundswitch * (*bestub)) )
4456 else if( *bestlbtype == -1 )
4458 else if( *bestubtype == -1 )
4460 else if( ((*bestlbtype) >= 0 || (*bestubtype) >= 0) && !
SCIPisEQ(
scip, *bestlb - simplelb, simpleub - *bestub) )
4462 if( *bestlb - simplelb > simpleub - *bestub )
4467 else if( *bestlbtype >= 0 )
4469 else if( *bestubtype >= 0 )
4521 assert(usevbds >= 0 && usevbds <= 2);
4544 if( bestvlbidx >= 0 && (bestvlb > *bestlb || (*bestlbtype < 0 &&
SCIPisGE(
scip, bestvlb, *bestlb))) )
4555 vlbvar = vlbvars[bestvlbidx];
4562 *bestlbtype = bestvlbidx;
4584 assert(usevbds >= 0 && usevbds <= 2);
4607 if( bestvubidx >= 0 && (bestvub < *bestub || (*bestubtype < 0 &&
SCIPisLE(
scip, bestvub, *bestub))) )
4618 vubvar = vubvars[bestvubidx];
4625 *bestubtype = bestvubidx;
4651 assert(usevbds >= 0 && usevbds <= 2);
4668 *simplebound = *bestlb;
4677 int bestvlbtype = -1;
4690 for(
i = 0;
i < nvlbs;
i++ )
4702 vlbbnd = vlbcoefs[
i] * vlbsol + vlbconsts[
i];
4704 if( vlbbnd > bestvlb )
4712 if( bestvlbtype >= 0 &&
SCIPisGE(
scip, bestvlb, *bestlb) )
4715 *bestlbtype = bestvlbtype;
4740 assert(usevbds >= 0 && usevbds <= 2);
4757 *simplebound = *bestub;
4766 int bestvubtype = -1;
4779 for(
i = 0;
i < nvubs;
i++ )
4791 vubbnd = vubcoefs[
i] * vubsol + vubconsts[
i];
4793 if( vubbnd < bestvub )
4801 if( bestvubtype >= 0 &&
SCIPisLE(
scip, bestvub, *bestub) )
4804 *bestubtype = bestvubtype;
4824 int* boundsfortrans,
4841 assert(usevbds >= 0 && usevbds <= 2);
4846 if( boundsfortrans !=
NULL && boundsfortrans[v] > -3 )
4855 *bestlbtype = boundsfortrans[v];
4856 if( *bestlbtype == -1 )
4858 else if( *bestlbtype == -2 )
4874 k = boundsfortrans[v];
4882 *bestlb = vlbcoefs[k] * vlbsol + vlbconsts[k];
4896 *bestubtype = boundsfortrans[v];
4897 if( *bestubtype == -1 )
4899 else if( *bestubtype == -2 )
4915 k = boundsfortrans[v];
4922 *bestub = vubcoefs[k] * vubsol + vubconsts[k];
4950 *freevariable =
TRUE;
4963 else if(
SCIPisLT(
scip, varsol, (1.0 - boundswitch) * (*bestlb) + boundswitch * (*bestub)) )
4965 else if(
SCIPisGT(
scip, varsol, (1.0 - boundswitch) * (*bestlb) + boundswitch * (*bestub)) )
4967 else if( *bestlbtype == -1 )
4969 else if( *bestubtype == -1 )
4971 else if( ((*bestlbtype) >= 0 || (*bestubtype) >= 0) && !
SCIPisEQ(
scip, *bestlb - simplelb, simpleub - *bestub) )
4973 if( *bestlb - simplelb > simpleub - *bestub )
4978 else if( *bestlbtype >= 0 )
4980 else if( *bestubtype >= 0 )
5043 *localbdsused = *localbdsused || ( boundtype == -2 );
5131 coef = cutcoefs[probindex];
5136 *cutrhs += coef * (-boundval);
5137 *localbdsused = *localbdsused || (boundtype == -2);
5143 SCIPerrorMessage(
"variable lower bounds not implemented in exact solving mode yet \n");
5177 coef = cutcoefs[probindex];
5182 *cutrhs += coef * (-boundval);
5184 *localbdsused = *localbdsused || (boundtype == -2);
5218 *localbdsused = *localbdsused || (boundtype == -2);
5258 cutinds[(*nnz)++] = zidx;
5296 *localbdsused = *localbdsused || (boundtype == -2);
5339 int* boundsfortrans,
5361 int aggrrowintstart;
5380 *freevariable =
FALSE;
5381 *localbdsused =
FALSE;
5404 ignoresol, boundsfortrans, boundtypesfortrans,
5405 bestlbs +
i, bestubs +
i, bestlbtypes +
i, bestubtypes +
i, selectedbounds +
i, freevariable) );
5412 aggrrowintstart =
i;
5415 for(
i = 0;
i < aggrrowintstart; ++
i )
5424 boundtype[
i] = bestlbtypes[
i];
5434 boundtype[
i] = bestubtypes[
i];
5443 if( boundtype[
i] == -2 )
5458 assert(cutinds[
i] < firstcontvar);
5462 ignoresol, boundsfortrans, boundtypesfortrans,
5463 bestlbs +
i, bestubs +
i, bestlbtypes +
i, bestubtypes +
i, selectedbounds +
i, freevariable) );
5473 for(
i = aggrrowintstart;
i < *nnz; ++
i )
5484 boundtype[
i] = bestlbtypes[
i];
5495 boundtype[
i] = bestubtypes[
i];
5504 if( boundtype[
i] == -2 )
5562 int* boundsfortrans,
5594 *freevariable =
FALSE;
5595 *localbdsused =
FALSE;
5610 int usevbds = data->
usevbds[s];
5626 indices[
i] = indices[data->
secnnz[s]];
5632 assert(cutindex < allocsize);
5634 ignoresol, boundsfortrans, boundtypesfortrans,
5635 bestlbs + cutindex, bestubs + cutindex, bestlbtypes + cutindex, bestubtypes + cutindex,
5636 selectedbounds + cutindex, freevariable) );
5655 for( k = 0; k < data->
secnnz[j]; ++k )
5676 boundtype[
i] = bestlbtypes[
i];
5678 bestbnd = bestlbs[
i];
5685 boundtype[
i] = bestubtypes[
i];
5687 bestbnd = bestubs[
i];
5693 if( fixintegralrhs )
5699 if( f0 < minfrac || f0 > maxfrac )
5707 bestviolgain = -1e+100;
5719 if( boundtype[
i] < 0
5743 if( newf0 < minfrac || newf0 > maxfrac )
5759 viol = f0 - fj * (varsign[
i] == +1 ? solval - bestlbs[
i] : bestubs[
i] - solval);
5760 newviol = newf0 - newfj * (varsign[
i] == -1 ? solval - bestlbs[
i] : bestubs[
i] - solval);
5761 violgain = newviol - viol;
5766 SCIPerrorMessage(
"Cannot handle closest bounds with ignoring the LP solution.\n");
5776 bestviolgain = violgain;
5786 assert(besti < data->ncutinds);
5787 assert(boundtype[besti] < 0);
5799 if( varsign[besti] == +1 )
5802 assert(bestubtypes[besti] < 0);
5803 boundtype[besti] = bestubtypes[besti];
5804 varsign[besti] = -1;
5809 assert(bestlbtypes[besti] < 0);
5810 boundtype[besti] = bestlbtypes[besti];
5811 varsign[besti] = +1;
5813 *localbdsused = *localbdsused || (boundtype[besti] == -2);
5936 while(
i < *nnz && cutinds[
i] >= firstcontvar )
5941 assert(cutinds[
i] < firstcontvar);
5949 for(
i = *nnz - 1;
i >= 0 && cutinds[
i] < firstcontvar; --
i )
5962 assert(varsign[
i] == +1 || varsign[
i] == -1);
5973 aj = cutcoefs[v] * varsign[
i];
6033 if( cutaj.
inf != 0.0 || cutaj.
sup != 0 )
6039 if( varsign[
i] == +1 )
6042 if( boundtype[
i] == -1 )
6061 if( boundtype[
i] == -1 )
6081 if( cutaj.
inf == 0.0 )
6085 cutinds[
i] = cutinds[*nnz];
6097 while(
i >= ndelcontvars )
6110 assert(varsign[
i] == +1 || varsign[
i] == -1);
6111 assert( v >= firstcontvar );
6119 if( aj * varsign[
i] >= 0.0 )
6134 cutinds[
i] = cutinds[ndelcontvars];
6135 varsign[
i] = varsign[ndelcontvars];
6136 boundtype[
i] = boundtype[ndelcontvars];
6146 if( boundtype[
i] < 0 )
6151 if( varsign[
i] == +1 )
6154 if( boundtype[
i] == -1 )
6172 if( boundtype[
i] == -1 )
6199 if( ndelcontvars > 0 )
6201 assert(ndelcontvars <= *nnz);
6202 *nnz -= ndelcontvars;
6203 if( *nnz < ndelcontvars )
6219#ifdef SCIP_DISABLED_CODE
6327 while(
i < *nnz && cutinds[
i] >= firstcontvar )
6332 assert(cutinds[
i] < firstcontvar);
6337 for(
i = *nnz - 1;
i >= 0 && cutinds[
i] < firstcontvar; --
i )
6352 assert(varsign[
i] == +1 || varsign[
i] == -1);
6428 cutinds[
i] = cutinds[*nnz];
6443 if( varsign[
i] == +1 )
6446 if( boundtype[
i] == -1 )
6463 if( boundtype[
i] == -1 )
6482 while(
i >= ndelcontvars )
6503 assert(varsign[
i] == +1 || varsign[
i] == -1);
6504 assert( v >= firstcontvar );
6527 cutinds[
i] = cutinds[ndelcontvars];
6528 varsign[
i] = varsign[ndelcontvars];
6529 boundtype[
i] = boundtype[ndelcontvars];
6544 if( boundtype[
i] < 0 )
6549 if( varsign[
i] == +1 )
6552 if( boundtype[
i] == -1 )
6569 if( boundtype[
i] == -1 )
6589#ifdef SCIP_DISABLED_CODE
6600 vbidx = boundtype[
i];
6603 if( varsign[
i] == +1 )
6621 assert(0 <= zidx && zidx < firstcontvar);
6631 cutinds[(*nnz)++] = zidx;
6645 if( ndelcontvars > 0 )
6647 assert(ndelcontvars <= *nnz);
6648 *nnz -= ndelcontvars;
6649 if( *nnz < ndelcontvars )
6750 int nnz = data->
secnnz[s];
6756 for(
i = nnz - 1;
i >= 0 ; --
i )
6769 sign = varsign[cutindex];
6770 assert(sign == +1 || sign == -1);
6771 type = boundtype[cutindex];
6781 if( enfintegral || implintegral )
6823 indices[
i] = indices[data->
secnnz[s]];
6913 ++data->
secnnz[zsection];
6930 int nnz = data->
secnnz[s];
6931 for(
i = 0;
i < nnz; ++
i )
6990 int currentnegslackrow;
7019 currentnegslackrow = 0;
7020 for(
i = 0;
i < nrowinds;
i++ )
7030 assert(slacksign[
i] == -1 || slacksign[
i] == +1);
7039 if( slacksign[
i] == 1 )
7062 downar = floor(ar.
inf);
7065 integralslack =
TRUE;
7071 slackweight = weights[
i];
7072 slackroundeddown =
TRUE;
7083 splitcoef = downar + 1;
7084 slackweight = weights[
i];
7085 slackroundeddown =
FALSE;
7086 SCIPdebugMessage(
"fractionality %g, f0 %g -> round up! splitcoef %g sub-coefficient %g", fr.
inf, f0.
inf, splitcoef, cutar.
inf);
7113 if( slacksign[
i] == -1 )
7135 if( slackroundeddown )
7157 currentnegslackrow++;
7165 *cutrhs += sidevalchg;
7169 if( slacksign[
i] == +1 )
7178#ifdef SCIP_DISABLED_CODE
7198#ifdef SCIP_DISABLED_CODE
7220#ifdef SCIP_DISABLED_CODE
7264 int currentnegslackrow;
7297 currentnegslackrow = 0;
7298 for(
i = 0;
i < nrowinds;
i++ )
7304 assert(slacksign[
i] == -1 || slacksign[
i] == +1);
7313 if( slacksign[
i] == 1 )
7324#ifdef SCIP_DISABLED_CODE
7386 if( slacksign[
i] == -1 )
7395 currentnegslackrow++;
7403 *cutrhs += sidevalchg;
7407 if( slacksign[
i] == +1 )
7415#ifdef SCIP_DISABLED_CODE
7437#ifdef SCIP_DISABLED_CODE
7522 for(
i = 0;
i < nrowinds;
i++ )
7535 assert(slacksign[
i] == -1 || slacksign[
i] == +1);
7593 if( slacksign[
i] == +1 )
7656 int* boundsfortrans,
7700 *cutislocal =
FALSE;
7710 tmpnnz = aggrrow->
nnz;
7711 tmpislocal = aggrrow->
local;
7727 for(
i = 0;
i < tmpnnz; ++
i )
7730 int k = aggrrow->
inds[
i];
7732 coef = aggrrow->
vals[k];
7758 boundsfortrans, boundtypesfortrans, tmpcoefs, &rhs, tmpinds, &tmpnnz, varsign, boundtype, &freevariable, &localbdsused) );
7759 assert(allowlocal || !localbdsused);
7760 tmpislocal = tmpislocal || localbdsused;
7797 downrhs = floor(rhs);
7810 if( f0interval.
inf < minfrac || f0interval.
sup > maxfrac )
7846 aggrrow->
nrows, scale, tmpcoefs, &rhs, tmpinds, &tmpnnz, f0interval) );
7875 *cutislocal = tmpislocal;
7878 for(
i = 0;
i < *cutnnz; ++
i )
7882 cutcoefs[
i] = tmpcoefs[j];
7886 if( cutefficacy !=
NULL )
7887 *cutefficacy = mirefficacy;
7889 if( cutrank !=
NULL )
7890 *cutrank = aggrrow->
rank + 1;
7905 for(
i = 0;
i < tmpnnz; ++
i )
7907 tmpcoefs[tmpinds[
i]] = 0.0;
7945 int* boundsfortrans,
7981 boundsfortrans, boundtypesfortrans, minfrac, maxfrac, scale, aggrrow, cutcoefs, cutrhs,
7982 cutinds, cutnnz, cutefficacy, cutrank, cutislocal, success);
8009 data->
usevbds[l] = l < vartypeusevbds ? 2 : 0;
8032 for( l = 0; l < nnz; ++l )
8035 int m = aggrrow->
inds[l];
8048 for( l = 0; l < nnz; ++l )
8060 tmpislocal = aggrrow->
local;
8084 boundsfortrans, boundtypesfortrans, minfrac, maxfrac,
8085 varsign, boundtype, &freevariable, &localbdsused) );
8086 assert(allowlocal || !localbdsused);
8087 tmpislocal = tmpislocal || localbdsused;
8165 aggrrow->
nrows, scale,
8195 *cutislocal = tmpislocal;
8198 for(
int i = 0;
i < *cutnnz; ++
i )
8210 if( cutefficacy !=
NULL )
8211 *cutefficacy = mirefficacy;
8213 if( cutrank !=
NULL )
8214 *cutrank = aggrrow->
rank + 1;
8254 for(
int s =
NSECTIONS - 1; s >= 0; --s )
8290 scale = 1.0 / delta;
8295 if( f0 < minfrac || f0 > maxfrac )
8298 onedivoneminusf0 = 1.0 / (1.0 - f0);
8300 contscale = scale * onedivoneminusf0;
8309 rhs -= contscale * contactivity;
8310 norm =
SQR(contscale) * contsqrnorm;
8322 if( fi > f0pluseps )
8323 floorai += (fi - f0) * onedivoneminusf0;
8325 rhs -= solvals[
i] * floorai;
8326 norm +=
SQR(floorai);
8331 return - rhs /
MAX(norm, 1e-6);
8361 int* boundsfortrans,
8453 data->
usevbds[l] = l < vartypeusevbds ? 2 : 0;
8476 for( l = 0; l < nnz; ++l )
8479 int m = aggrrow->
inds[l];
8492 for( l = 0; l < nnz; ++l )
8502 *cutislocal = aggrrow->
local;
8520 boundsfortrans, boundtypesfortrans, minfrac, maxfrac, varsign, boundtype, &freevariable, &localbdsused) );
8521 assert(allowlocal || !localbdsused);
8537 maxabsmksetcoef = -1.0;
8541 for(
i = mksetnnz - 1;
i >= 0 && mksetinds[
i] < firstcontvar; --
i )
8555 bounddistpos[nbounddist] =
i;
8562 if( nbounddist == 0 )
8569 for(
int j = 0; j < intstart; ++j )
8573 for(
int j = intstart; j < data->
ncutinds; ++j )
8579 ndeltacands = nbounddist;
8589 if( intscalesuccess )
8595 intscalerhs =
QUAD_TO_DBL(data->cutrhs) * intscale;
8596 delta = 1.0 / intscale;
8597 intf0 = intscalerhs - floor(intscalerhs);
8601 if( intf0 < minfrac || intf0 > maxfrac )
8603 intscale *=
SCIPceil(
scip,
MAX(minfrac, (1.0 - maxfrac)) /
MIN(intf0, (1.0 - intf0)));
8604 intscalerhs =
QUAD_TO_DBL(data->cutrhs) * intscale;
8605 delta = 1.0 / intscale;
8606 intf0 = intscalerhs - floor(intscalerhs);
8609 if( intf0 >= minfrac && intf0 <= maxfrac )
8612 deltacands[ndeltacands++] = delta;
8614 if( intf0 < maxfrac )
8618 delta2 = 1.0 / (intscale *
SCIPfloor(
scip, maxfrac / intf0));
8621 deltacands[ndeltacands++] = delta2;
8628 for(
i = 0;
i < nbounddist; ++
i )
8632 absmksetcoef =
REALABS(deltacands[
i]);
8633 maxabsmksetcoef =
MAX(absmksetcoef, maxabsmksetcoef);
8635 deltacands[
i] = absmksetcoef;
8639 if( maxabsmksetcoef != -1.0 )
8640 deltacands[ndeltacands++] = maxabsmksetcoef + 1.0;
8642 deltacands[ndeltacands++] = 1.0;
8644 maxtestdelta =
MIN(ndeltacands, maxtestdelta);
8677 for(
i = intstart;
i < mksetnnz; ++
i )
8689 if( boundtype[
i] == -1 )
8692 if( varsign[
i] == -1 )
8702 if( varsign[
i] == -1 )
8708 tmpvalues[ntmpcoefs] = solval;
8714 assert(ntmpcoefs == mksetnnz - intstart);
8718 for(
i = 0;
i < intstart; ++
i )
8732 switch( boundtype[
i] )
8736 if( varsign[
i] == -1 )
8743 if( varsign[
i] == -1 )
8750 if( varsign[
i] == -1 )
8760 solval = (coef * vbdsolval + constant) - solval;
8772 solval = solval - (coef * vbdsolval + constant);
8776 contactivity += solval * (
QUAD_TO_DBL(mksetcoef) * varsign[
i]);
8785 for(
i = 0;
i < aggrrow->
nrows; ++
i )
8803 slackval = row->
rhs - slackval;
8811 slackval = slackval - row->
lhs;
8817 tmpvalues[ntmpcoefs] = slackval;
8826 contactivity += slackval * slackcoeff;
8827 contsqrnorm +=
SQR(slackcoeff);
8836 for(
i = 0;
i < maxtestdelta; ++
i )
8843 for( j = 0; j <
i; ++j )
8847 deltaseenbefore =
TRUE;
8853 if( deltaseenbefore )
8855 maxtestdelta =
MIN(maxtestdelta + 1, ndeltacands);
8861 if( efficacy > bestefficacy )
8863 bestefficacy = efficacy;
8864 bestdelta = deltacands[
i];
8875 for(
i = 2;
i <= 8 ;
i *= 2 )
8880 delta = basedelta /
i;
8884 if( efficacy > bestefficacy )
8886 bestefficacy = efficacy;
8895 for(
i = 0;
i < nbounddist; ++
i )
8907 k = bounddistpos[
i];
8931 tmpcoefs[k - intstart] = -tmpcoefs[k - intstart];
8933 oldsolval = tmpvalues[k - intstart];
8940 if( newefficacy > bestefficacy )
8943 bestefficacy = newefficacy;
8946 if( varsign[k] == +1 )
8950 boundtype[k] = bestubtype;
8957 boundtype[k] = bestlbtype;
8961 localbdsused = localbdsused || (boundtype[k] == -2);
8966 tmpcoefs[k - intstart] = -tmpcoefs[k - intstart];
8967 tmpvalues[k - intstart] = oldsolval;
8971 if( bestefficacy > 0.0 )
8978 scale = 1.0 / bestdelta;
8988 for(
i = 0;
i < mksetnnz; ++
i )
9040 SCIPdebugMsg(
scip,
"efficacy of cmir cut is different than expected efficacy: %f != %f\n", efficacy, bestefficacy);
9045 *cutislocal = *cutislocal || localbdsused;
9059 SCIPdebugMsg(
scip,
"post-processed cut (success = %s):\n", *success ?
"TRUE" :
"FALSE");
9082 *cutefficacy = mirefficacy;
9083 if( cutrank !=
NULL )
9084 *cutrank = aggrrow->
rank + 1;
9085 *cutislocal = *cutislocal || localbdsused;
9108 if(mksetcoefs[
i] != 0.0)
9122 for(
int s =
NSECTIONS - 1; s >= 0; --s )
9142#define NO_EXACT_KNAPSACK
9144#ifndef NO_EXACT_KNAPSACK
9145#define MAXDNOM 1000LL
9146#define MINDELTA 1e-03
9147#define MAXDELTA 1e-09
9148#define MAXSCALE 1000.0
9149#define MAXDYNPROGSPACE 1000000
9152#define MAXABSVBCOEF 1e+5
9153#define MAXBOUND 1e+10
9230 *closestvlbidx = -1;
9243 for(
i = 0;
i < nvlbs;
i++ )
9252 if( bestsub > vlbconsts[
i] )
9267 if( (
unsigned int)probidxbinvar >= (
unsigned int)nbinvars )
9288 if( binvarused[probidxbinvar] == 1 )
9297 rowcoefsign =
COPYSIGN(1.0, rowcoef);
9299 val2 = rowcoefsign * ((rowcoef * vlbcoefs[
i]) + rowcoefbinvar);
9305 val1 = rowcoefsign * ((rowcoef * (bestsub - vlbconsts[
i])) + rowcoefbinvar);
9312 if( vlbsol > *closestvlb )
9314 *closestvlb = vlbsol;
9317 assert(*closestvlbidx >= 0);
9360 *closestvubidx = -1;
9373 for(
i = 0;
i < nvubs;
i++ )
9382 if( bestslb < vubconsts[
i] )
9397 if( (
unsigned int)probidxbinvar >= (
unsigned int)nbinvars )
9418 if( binvarused[probidxbinvar] == 1 )
9427 rowcoefsign =
COPYSIGN(1.0, rowcoef);
9429 val2 = rowcoefsign * ((rowcoef * vubcoefs[
i]) + rowcoefbinvar);
9435 val1 = rowcoefsign * ((rowcoef * (bestslb - vubconsts[
i])) + rowcoefbinvar);
9442 if( vubsol < *closestvub )
9444 *closestvub = vubsol;
9447 assert(*closestvubidx >= 0);
9491 bestlbtype[varposinrow] = -3;
9492 bestubtype[varposinrow] = -3;
9494 probidx = rowinds[varposinrow];
9509 if( bestslb[varposinrow] <= -
MAXBOUND )
9512 if( bestsub[varposinrow] >=
MAXBOUND )
9517 SCIPdebugMsg(
scip,
" %d: %g <%s, idx=%d, lp=%g, [%g(%d),%g(%d)]>:\n", varposinrow, rowcoef,
SCIPvarGetName(
var), probidx,
9518 solval, bestslb[varposinrow], bestslbtype[varposinrow], bestsub[varposinrow], bestsubtype[varposinrow]);
9525 *freevariable =
TRUE;
9534 bestlb[varposinrow] = bestslb[varposinrow];
9535 bestlbtype[varposinrow] = bestslbtype[varposinrow];
9545 bestlb[varposinrow] = bestvlb;
9546 bestlbtype[varposinrow] = bestvlbidx;
9556 bestub[varposinrow] = bestsub[varposinrow];
9557 bestubtype[varposinrow] = bestsubtype[varposinrow];
9567 bestub[varposinrow] = bestvub;
9568 bestubtype[varposinrow] = bestvubidx;
9572 SCIPdebugMsg(
scip,
" bestlb=%g(%d), bestub=%g(%d)\n", bestlb[varposinrow], bestlbtype[varposinrow], bestub[varposinrow], bestubtype[varposinrow]);
9579 *freevariable =
TRUE;
9583 *freevariable =
FALSE;
9589 if(
SCIPisEQ(
scip, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow]) && bestlbtype[varposinrow] >= 0 )
9593 else if(
SCIPisEQ(
scip, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow])
9594 && bestubtype[varposinrow] >= 0 )
9598 else if(
SCIPisLE(
scip, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow]) )
9604 assert(
SCIPisGT(
scip, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow]));
9617 binvarused[vlbvarprobidx] = 1;
9628 binvarused[vubvarprobidx] = 1;
9672 SCIPdebugMsg(
scip,
"--------------------- construction of SNF relaxation ------------------------------------\n");
9693 for(
i = nnz - 1;
i >= 0 && rowinds[
i] < nbinvars; --
i )
9694 binvarused[rowinds[
i]] = -1;
9696 nnonbinvarsrow =
i + 1;
9698 for(
i = 0;
i < nnonbinvarsrow; ++
i )
9702 assert(rowinds[
i] >= nbinvars);
9705 bestlb, bestub, bestslb, bestsub, bestlbtype, bestubtype, bestslbtype, bestsubtype, selectedbounds, &freevariable) );
9712 for( j = nnz - 1; j >= nnonbinvarsrow; --j )
9713 binvarused[rowinds[j]] = 0;
9716 for( j = 0; j <
i; ++j )
9735 *localbdsused =
FALSE;
9750 for(
i = 0;
i < nnonbinvarsrow; ++
i )
9757 probidx = rowinds[
i];
9763 assert(probidx >= nbinvars);
9771 assert(bestsubtype[
i] == -1 || bestsubtype[
i] == -2);
9779 if( bestlbtype[
i] < 0 )
9799 if( bestlbtype[
i] == -2 || bestsubtype[
i] == -2 )
9800 *localbdsused =
TRUE;
9832 SCIPdebugMsg(
scip,
" --> bestlb used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=1), rhs=%g-(%g*%g)=%g\n",
9860 assert(binvarused[vlbvarprobidx] == 1);
9861 assert(vlbvarprobidx < nbinvars);
9880 binvarused[vlbvarprobidx] = 0;
9911 SCIPdebugMsg(
scip,
" --> bestlb used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=%s), rhs=%g-(%g*%g)=%g\n",
9923 assert(bestslbtype[
i] == -1 || bestslbtype[
i] == -2);
9931 if( bestubtype[
i] < 0 )
9951 if( bestubtype[
i] == -2 || bestslbtype[
i] == -2 )
9952 *localbdsused =
TRUE;
9984 SCIPdebugMsg(
scip,
" --> bestub used for trans: ... %s y'_%d + ..., Y'_%d <= %g x_%d (=1), rhs=%g-(%g*%g)=%g\n",
10012 assert(binvarused[vubvarprobidx] == 1);
10013 assert(vubvarprobidx < nbinvars);
10019 binvarused[vubvarprobidx] = 0;
10063 SCIPdebugMsg(
scip,
" --> bestub used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=%s), rhs=%g-(%g*%g)=%g\n",
10080 for(
i = nnonbinvarsrow;
i < nnz; ++
i )
10089 probidx = rowinds[
i];
10092 assert(probidx < nbinvars);
10095 if( binvarused[probidx] == 0 )
10099 assert(binvarused[probidx] == -1);
10102 binvarused[probidx] = 0;
10109 SCIPdebugMsg(
scip,
" %d: %g <%s, idx=%d, lp=%g, [%g, %g]>:\n",
i,
QUAD_TO_DBL(rowcoef),
SCIPvarGetName(
var), probidx, varsolval,
10166 SCIPdebugMsg(
scip,
"constraint in constructed 0-1 single node flow relaxation: ");
10261 if( solitems !=
NULL )
10266 if( solval !=
NULL )
10273 for(
i = nitems - 1;
i >= 0; --
i )
10274 tempsort[
i] = profits[
i] / weights[
i];
10286 solitemsweight = 0.0;
10287 for( j = 0; j < nitems &&
SCIPisFeasLT(
scip, solitemsweight + weights[j], capacity); j++ )
10289 if( solitems !=
NULL )
10291 solitems[*nsolitems] = items[j];
10294 if( solval !=
NULL )
10295 (*solval) += profits[j];
10296 solitemsweight += weights[j];
10300 for( ; j < nitems; j++ )
10304 if( solitems !=
NULL )
10306 solitems[*nsolitems] = items[j];
10309 if( solval !=
NULL )
10310 (*solval) += profits[j];
10311 solitemsweight += weights[j];
10313 else if( solitems !=
NULL )
10315 nonsolitems[*nnonsolitems] = items[j];
10337 int* nflowcovervars,
10338 int* nnonflowcovervars,
10339 int* flowcoverstatus,
10353 assert(nnonsolitems >= 0);
10354 assert(nflowcovervars !=
NULL && *nflowcovervars >= 0);
10355 assert(nnonflowcovervars !=
NULL && *nnonflowcovervars >= 0);
10361 for( j = 0; j < nsolitems; j++ )
10364 if( coefs[solitems[j]] == 1 )
10366 flowcoverstatus[solitems[j]] = -1;
10367 (*nnonflowcovervars)++;
10372 assert(coefs[solitems[j]] == -1);
10373 flowcoverstatus[solitems[j]] = 1;
10374 (*nflowcovervars)++;
10378 for( j = 0; j < nnonsolitems; j++ )
10381 if( coefs[nonsolitems[j]] == 1 )
10383 flowcoverstatus[nonsolitems[j]] = 1;
10384 (*nflowcovervars)++;
10385 SCIPquadprecSumQD(*flowcoverweight, *flowcoverweight, vubcoefs[nonsolitems[j]]);
10390 assert(coefs[nonsolitems[j]] == -1);
10391 flowcoverstatus[nonsolitems[j]] = -1;
10392 (*nnonflowcovervars)++;
10401#ifndef NO_EXACT_KNAPSACK
10416 assert(mindelta <= 0.0);
10417 assert(maxdelta >= 0.0);
10419 sval = val * scalar;
10420 downval = floor(sval);
10421 upval = ceil(sval);
10441 assert(mindelta <= 0.0);
10442 assert(maxdelta >= 0.0);
10444 sval = val * scalar;
10445 upval = ceil(sval);
10463 int* nflowcovervars,
10464 int* nnonflowcovervars,
10465 int* flowcoverstatus,
10484#if !defined(NDEBUG) || defined(SCIP_DEBUG)
10490 int nflowcovervarsafterfix;
10493 int nnonflowcovervarsafterfix;
10509 SCIPdebugMsg(
scip,
"--------------------- get flow cover ----------------------------------------------------\n");
10523 *nflowcovervars = 0;
10524 *nnonflowcovervars = 0;
10527 nflowcovervarsafterfix = 0;
10528 nnonflowcovervarsafterfix = 0;
10530#if !defined(NDEBUG) || defined(SCIP_DEBUG)
10544 n1itemsweight = 0.0;
10555 flowcoverstatus[j] = -1;
10556 (*nnonflowcovervars)++;
10576 flowcoverstatus[j] = -1;
10577 (*nnonflowcovervars)++;
10583 flowcoverstatus[j] = 1;
10584 (*nflowcovervars)++;
10591 flowcoverstatus[j] = 1;
10592 (*nflowcovervars)++;
10600 flowcoverstatus[j] = -1;
10601 (*nnonflowcovervars)++;
10605 assert((*nflowcovervars) + (*nnonflowcovervars) + nitems == snf->
ntransvars);
10639 transweightsrealintegral =
TRUE;
10640 for( j = 0; j < nitems; j++ )
10645 transweightsrealintegral =
FALSE;
10650 SCIPdebugMsg(
scip,
" <%d>: j in N1: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
10651 items[j], transprofitsreal[j],
SCIPisIntegral(
scip, transweightsreal[j]) ?
"" :
" ----> NOT integral");
10656 SCIPdebugMsg(
scip,
" <%d>: j in N2: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
10657 items[j], transprofitsreal[j],
SCIPisIntegral(
scip, transweightsreal[j]) ?
"" :
" ----> NOT integral");
10662 SCIPdebugMsg(
scip,
" transcapacity = -rhs(%g) + flowcoverweight(%g) + n1itemsweight(%g) = %g\n",
10691 if( transweightsrealintegral )
10695 scalesuccess =
TRUE;
10699 scalesuccess =
FALSE;
10715 for( j = 0; j < nitems; ++j )
10717 transweightsint[j] = getIntegralVal(transweightsreal[j], scalar, -
MINDELTA,
MAXDELTA);
10718 transprofitsint[j] = transprofitsreal[j];
10719 itemsint[j] = items[j];
10723 transcapacityint = getIntegralVal(transcapacityreal, scalar, -
MINDELTA,
MAXDELTA);
10724 transcapacityint -= 1;
10727 transcapacityint = (
SCIP_Longint) (transcapacityreal * scalar);
10728 nflowcovervarsafterfix = *nflowcovervars;
10729 nnonflowcovervarsafterfix = *nnonflowcovervars;
10733 tmp2 = (
SCIP_Real) ((transcapacityint) + 1);
10734 if( transcapacityint * nitems <= MAXDYNPROGSPACE && tmp1 * tmp2 <= INT_MAX / 8.0)
10740 itemsint, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL, &success) );
10746 transcapacityreal, items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL) );
10748#if !defined(NDEBUG) || defined(SCIP_DEBUG)
10757 items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL) );
10765 items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL) );
10769 assert(nsolitems != -1);
10770 assert(nnonsolitems != -1);
10773 assert(*nflowcovervars + *nnonflowcovervars + nsolitems + nnonsolitems == snf->
ntransvars);
10775 nnonflowcovervars, flowcoverstatus,
QUAD(&flowcoverweight), lambda);
10785 items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL) );
10791 *nflowcovervars = nflowcovervarsafterfix;
10792 *nnonflowcovervars = nnonflowcovervarsafterfix;
10795 assert(*nflowcovervars + *nnonflowcovervars + nsolitems + nnonsolitems == snf->
ntransvars);
10797 nnonflowcovervars, flowcoverstatus,
QUAD(&flowcoverweight), lambda);
10807 SCIPdebugMsg(
scip,
"2. %s solution:\n", kpexact ?
"exact" :
"approximate");
10810 if( snf->
transvarcoefs[j] == 1 && flowcoverstatus[j] == 1 )
10814 else if( snf->
transvarcoefs[j] == -1 && flowcoverstatus[j] == 1 )
10847 int* nflowcovervars,
10848 int* nnonflowcovervars,
10849 int* flowcoverstatus,
10884 SCIPdebugMsg(
scip,
"--------------------- get flow cover ----------------------------------------------------\n");
10897 *nflowcovervars = 0;
10898 *nnonflowcovervars = 0;
10911 n1itemsweight = 0.0;
10922 flowcoverstatus[j] = -1;
10923 (*nnonflowcovervars)++;
10945 flowcoverstatus[j] = -1;
10946 (*nnonflowcovervars)++;
10952 flowcoverstatus[j] = 1;
10953 (*nflowcovervars)++;
10960 flowcoverstatus[j] = 1;
10961 (*nflowcovervars)++;
10969 flowcoverstatus[j] = -1;
10970 (*nnonflowcovervars)++;
10974 assert((*nflowcovervars) + (*nnonflowcovervars) + nitems == snf->
ntransvars);
11008 for( j = 0; j < nitems; j++ )
11015 SCIPdebugMsg(
scip,
" <%d>: j in N1: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
11016 items[j], transprofitsreal[j],
SCIPisIntegral(
scip, transweightsreal[j]) ?
"" :
" ----> NOT integral");
11021 SCIPdebugMsg(
scip,
" <%d>: j in N2: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
11022 items[j], transprofitsreal[j],
SCIPisIntegral(
scip, transweightsreal[j]) ?
"" :
" ----> NOT integral");
11027 SCIPdebugMsg(
scip,
" transcapacity = -rhs(%g) + flowcoverweight(%g) + n1itemsweight(%g) = %g\n",
11059 items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL) );
11061 assert(nsolitems != -1);
11062 assert(nnonsolitems != -1);
11065 assert(*nflowcovervars + *nnonflowcovervars + nsolitems + nnonsolitems == snf->
ntransvars);
11067 nnonflowcovervars, flowcoverstatus,
QUAD(&flowcoverweight), lambda);
11080 if( snf->
transvarcoefs[j] == 1 && flowcoverstatus[j] == 1 )
11084 else if( snf->
transvarcoefs[j] == -1 && flowcoverstatus[j] == 1 )
11123 xpluslambda =
x + liftingdata->
lambda;
11134 return i * liftingdata->
lambda;
11165 return i * liftingdata->
lambda;
11169 MAX(0.0, liftingdata->
m[
i] - (liftingdata->
mp - liftingdata->
lambda) - liftingdata->
ml)));
11206 vubcoefpluslambda = vubcoef + liftingdata->
lambda;
11215 assert(liftingdata->
M[
i] < vubcoefpluslambda);
11235 int* transvarflowcoverstatus,
11250 liftingdata->
m =
NULL;
11251 liftingdata->
M =
NULL;
11253 liftingdata->
t = 0;
11259 liftingdata->
r = 0;
11271 int s = (snf->
transvarcoefs[
i] + 1) + (transvarflowcoverstatus[
i] + 1)/2;
11337 for(
i = 0;
i < liftingdata->
r; ++
i)
11352 while( liftingdata->
t < liftingdata->
r && liftingdata->
m[liftingdata->
t] == liftingdata->
mp )
11355 liftingdata->
lambda = lambda;
11379 int* flowcoverstatus,
11398 assert( liftingdata.
r >= 0 );
11399 assert( liftingdata.
t >= 0 );
11459 if( liftedbincoef != 0.0 )
11564 for(
i = 0;
i < aggrrow->
nrows; ++
i )
11573 assert(slackcoef != 0.0);
11576 if( slackcoef > 0.0 )
11594 slackub = rowrhs - rowlhs;
11681 int* transvarflowcoverstatus;
11683 int nflowcovervars;
11684 int nnonflowcovervars;
11697 SCIP_CALL(
constructSNFRelaxation(
scip,
sol, boundswitch, allowlocal, aggrrow->
vals,
QUAD(aggrrow->rhs), aggrrow->
inds, aggrrow->
nnz, &snf, success, &localbdsused) );
11704 tmpislocal = aggrrow->
local || localbdsused;
11740 if( cutefficacy !=
NULL )
11746 *cutefficacy = efficacy;
11754 if( cutrank !=
NULL )
11755 *cutrank = aggrrow->
rank + 1;
11756 if( cutislocal !=
NULL )
11757 *cutislocal = tmpislocal;
11759 for(
i = 0;
i < tmpnnz; ++
i )
11761 int j = tmpinds[
i];
11764 cutcoefs[
i] = tmpcoefs[j];
11773 for(
i = 0;
i < tmpnnz; ++
i )
11775 int j = tmpinds[
i];
11776 assert(tmpcoefs[j] != 0.0);
11820 int aggrrowbinstart;
11821 int firstnonbinvar;
11848 int v = cutinds[
i];
11879 aggrrowbinstart =
i;
11882 for(
i = 0;
i < aggrrowbinstart; ++
i )
11885 int v = cutinds[
i];
11894 assert(
i == aggrrowbinstart);
11897 if( aggrrowbinstart != 0 )
11899 *nnz -= aggrrowbinstart;
11914 int v = cutinds[
i];
11918 assert(v < firstnonbinvar);
11938 *localbdsused = *localbdsused || (boundtype[
i] == -2);
11966 assert(boundtype[
i] == -1 || boundtype[
i] == -2);
11975 cutinds[
i] = cutinds[*nnz];
12020 for( k = 0; k < cutnnz; ++k )
12023 int v = cutinds[k];
12028 if( varsign[k] == -1 )
12029 solval = 1 - solval;
12034 coverpos[*coversize] = k;
12036 coverstatus[k] = 1;
12044 coverstatus[k] = 0;
12055 SCIPsortDownRealInt(covervals + (*coversize), coverpos + (*coversize), cutnnz - (*coversize));
12060 while( *coversize < cutnnz &&
12065 k = coverpos[*coversize];
12067 coverstatus[k] = 1;
12120 for( k = 1; k < coversize; ++k )
12166 for( k = 0; k < coversize; ++k )
12184 coverstatus[coverpos[k]] = -1;
12189 coverstatus[coverpos[k]] = -1;
12266 while(
h < coversize )
12281 covervals[
h], cutcoef);
12349 if( aggrrow->
nnz == 0 )
12352 for( k = 0; k < aggrrow->
nrows; ++k )
12370 nnz = aggrrow->
nnz;
12375 for( k = 0; k < nnz; ++k )
12378 int j = tmpinds[k];
12394 local = aggrrow->
local;
12396 tmpcoefs,
QUAD(&rhs), tmpinds, &nnz, varsign, boundtype, &local, &transformed) );
12398 assert(allowlocal || !local);
12407 coverpos, covervals, &coversize,
QUAD(&coverweight)) )
12416 if( coversize == 1 )
12421 for( k = 0; k < nnz; ++k )
12423 if( coverstatus[k] == 0 )
12429 tmpinds[0] = tmpinds[k];
12430 varsign[0] = varsign[k];
12435 if( varsign[0] == -1 )
12465 QUAD(coverweight), covervals, coverstatus,
QUAD(&abar), &cplussize);
12469 for( k = 0; k < nnz; )
12472 if( coverstatus[k] == -1 )
12480 SCIPdebugMsg(
scip,
"load QUAD(coef) from tmpcoefs[tmpinds[k] = %d]\n",tmpinds[k]);
12489 if( cutcoef == 0.0 )
12494 coverstatus[k] = coverstatus[nnz];
12495 tmpinds[k] = tmpinds[nnz];
12496 varsign[k] = varsign[nnz];
12502 if( varsign[k] == -1 )
12506 cutcoef = -cutcoef;
12529 *cutislocal = local;
12534 for( k = 0; k < nnz; ++k )
12537 int j = tmpinds[k];
12553 if( cutrank !=
NULL )
12554 *cutrank = aggrrow->
rank + 1;
12565 for( k = 0; k < nnz; ++k )
12573 if(tmpcoefs[k] != 0.0)
12659 *freevariable =
FALSE;
12660 *localbdsused =
FALSE;
12673 int cutindsstart = data->
ncutinds;
12674 int usevbds = data->
usevbds[s];
12681 int v = indices[
i];
12691 indices[
i] = indices[data->
secnnz[s]];
12706 bestlbs + cutindex, &simplelb, bestlbtypes + cutindex) );
12711 *freevariable =
TRUE;
12715 varsign[cutindex] = +1;
12726 bestubs + cutindex, &simpleub, bestubtypes + cutindex) );
12731 *freevariable =
TRUE;
12735 varsign[cutindex] = -1;
12751 bestlbs + cutindex, &simplelb, bestlbtypes + cutindex) );
12755 bestubs + cutindex, &simpleub, bestubtypes + cutindex) );
12761 if( lowerinf && upperinf )
12766 *freevariable =
TRUE;
12771 if( (positive && lowerinf) || (!positive && !upperinf) )
12773 varsign[cutindex] = -1;
12778 varsign[cutindex] = +1;
12786 NULL,
NULL, bestlbs + cutindex, bestubs + cutindex,
12787 bestlbtypes + cutindex, bestubtypes + cutindex, selectedbounds + cutindex, freevariable) );
12810 boundtype[
i] = bestlbtypes[
i];
12812 bestbnd = bestlbs[
i];
12819 boundtype[
i] = bestubtypes[
i];
12821 bestbnd = bestubs[
i];
12835 if( *freevariable )
12844 for( k = 0; k < data->
secnnz[j]; ++k )
12946 int nnz = data->
secnnz[s];
12951 for(
i = nnz - 1;
i >= 0 ; --
i )
12956 int v = indices[
i];
12962 sign = varsign[cutindex];
12963 assert(sign == +1 || sign == -1);
12964 type = boundtype[cutindex];
12974 if( enfintegral || implintegral )
13020 indices[
i] = indices[data->
secnnz[s]];
13110 ++data->
secnnz[zsection];
13127 int nnz = data->
secnnz[s];
13128 for(
i = 0;
i < nnz; ++
i )
13190 for(
i = 0;
i < nrowinds;
i++ )
13202 assert(slacksign[
i] == -1 || slacksign[
i] == +1);
13259 if( slacksign[
i] == +1 )
13318 int vartypeusevbds,
13367 for(
i = 0;
i < aggrrow->
nrows; ++
i )
13387 nnz = aggrrow->
nnz;
13400 data->
usevbds[l] = l < vartypeusevbds ? 2 : 0;
13423 for( l = 0; l < nnz; ++l )
13426 int m = aggrrow->
inds[l];
13439 for( l = 0; l < nnz; ++l )
13443 ++data->
secnnz[section];
13448 *cutislocal = aggrrow->
local;
13474 assert(allowlocal || !localbdsused);
13475 *cutislocal = *cutislocal || localbdsused;
13588 for(
i = 0;
i < *cutnnz; ++
i )
13602 if( cutefficacy !=
NULL )
13605 if( cutrank !=
NULL )
13606 *cutrank = aggrrow->
rank + 1;
13628 for(
int s =
NSECTIONS - 1; s >= 0; --s )
13751 if( aggrrow->
nnz == 0 )
13761 efficacy =
result->cutefficacy;
13763 result->cutcoefs, &cutrhs,
result->cutinds, &cutnnz, &efficacy, &cutrank, &cutislocal, &success) );
13768 result->cutefficacy = efficacy;
13769 result->cutrhs = cutrhs;
13770 result->cutnnz = cutnnz;
13771 result->cutrank = cutrank;
13772 result->cutislocal = cutislocal;
13780 efficacy =
result->cutefficacy;
13782 result->cutcoefs, &cutrhs,
result->cutinds, &cutnnz, &efficacy, &cutrank, &cutislocal, &success) );
13787 result->cutefficacy = efficacy;
13788 result->cutrhs = cutrhs;
13789 result->cutnnz = cutnnz;
13790 result->cutrank = cutrank;
13791 result->cutislocal = cutislocal;
13799 efficacy =
result->cutefficacy;
13803 result->cutcoefs, &cutrhs,
result->cutinds, &cutnnz, &efficacy, &cutrank, &cutislocal, &success) );
13808 result->cutefficacy = efficacy;
13809 result->cutrhs = cutrhs;
13810 result->cutnnz = cutnnz;
13811 result->cutrank = cutrank;
13812 result->cutislocal = cutislocal;
SCIP_CERTIFICATE * SCIPgetCertificate(SCIP *scip)
methods for certificate output
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 cutsRoundMIRSafely(SCIP *scip, SCIP_Real *RESTRICT cutcoefs, SCIP_Real *RESTRICT cutrhs, int *RESTRICT cutinds, int *RESTRICT nnz, int *RESTRICT varsign, int *RESTRICT boundtype, SCIP_INTERVAL f0)
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,)
static SCIP_RETCODE findBestUb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, int usevbds, SCIP_Bool allowlocal, SCIP_Real *bestub, int *bestubtype)
static SCIP_Bool chgQuadCoeffWithBound(SCIP *scip, SCIP_VAR *var, QUAD(SCIP_Real oldcoeff), SCIP_Real newcoeff, SCIP_Bool cutislocal,)
static SCIP_RETCODE findBestLbSafely(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, int usevbds, SCIP_Bool allowlocal, SCIP_Real *bestlb, SCIP_Real *simplebound, int *bestlbtype)
static SCIP_RETCODE varVecAddScaledRowCoefsSafely(SCIP *scip, int *inds, SCIP_Real *vals, int *nnz, SCIP_ROW *row, SCIP_Real scale, SCIP_Real *rhschange, SCIP_Bool *success)
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 postprocessCutSafely(SCIP *scip, SCIP_Bool cutislocal, int *cutinds, SCIP_Real *cutcoefs, int *nnz, SCIP_Real *cutrhs, SCIP_Bool *success)
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_Bool removeZerosSafely(SCIP *scip, SCIP_Real minval, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz)
static SCIP_Real calcEfficacyDenseStorageQuad(SCIP *scip, SCIP_SOL *sol, SCIP_Real *cutcoefs, SCIP_Real cutrhs, int *cutinds, int cutnnz)
#define DEFAULT_CUTGEN_VARTYPEUSEVBDS
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 cutsRoundStrongCG(SCIP *scip, MIR_DATA *data, int *varsign, int *boundtype, QUAD(SCIP_Real f0), SCIP_Real k)
static SCIP_RETCODE findBestUbSafely(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, int usevbds, SCIP_Bool allowlocal, SCIP_Real *bestub, SCIP_Real *simplebound, int *bestubtype)
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 void doMIRBoundSubstitution(SCIP *scip, MIR_DATA *data, int varsign, int boundtype, SCIP_Real boundval, int probindex, SCIP_Bool *localbdsused)
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 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 varVecAddScaledRowCoefsQuadScale(int *RESTRICT inds, SCIP_Real *RESTRICT vals, int *RESTRICT nnz, SCIP_ROW *row,)
static SCIP_RETCODE cutsRoundMIR(SCIP *scip, MIR_DATA *data, int *RESTRICT varsign, int *RESTRICT boundtype,)
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_Real scaleValSafely(SCIP *scip, SCIP_Real val, SCIP_Real scale, SCIP_Bool cutislocal, SCIP_VAR *var, SCIP_Real *rhschange, SCIP_Bool *success)
static SCIP_RETCODE findBestLb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, int usevbds, SCIP_Bool allowlocal, SCIP_Real *bestlb, int *bestlbtype)
static SCIP_RETCODE cutsTransformMIR(SCIP *scip, MIR_DATA *data, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, SCIP_Bool ignoresol, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, SCIP_Real minfrac, SCIP_Real maxfrac, int *varsign, int *boundtype, SCIP_Bool *freevariable, SCIP_Bool *localbdsused)
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)
#define DEFAULT_CUTGEN_MAXFRAC
static SCIP_Bool chgCoeffWithBound(SCIP *scip, SCIP_VAR *var, SCIP_Real oldcoeff, SCIP_Real newcoeff, SCIP_Bool cutislocal,)
static SCIP_RETCODE calcMIRSafely(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)
static int varSection(MIR_DATA *data, int probindex)
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 void performBoundSubstitutionSimpleSafely(SCIP *scip, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int boundtype, SCIP_Real boundval, int probindex, SCIP_Bool *localbdsused)
static SCIP_RETCODE findMIRBestLb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, MIR_DATA *data, int usevbds, SCIP_Bool allowlocal, SCIP_Real *bestlb, SCIP_Real *simplebound, int *bestlbtype)
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_RETCODE determineBestBounds(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, MIR_DATA *data, 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)
#define DEFAULT_CUTGEN_BOUNDSWITCH
static SCIP_Bool removeZeros(SCIP *scip, SCIP_Real minval, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, QUAD(SCIP_Real *cutrhs), int *cutinds, int *cutnnz)
#define DEFAULT_CUTGEN_MAXTESTDELTA
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_Real calcEfficacyDenseStorage(SCIP *scip, SCIP_SOL *sol, SCIP_Real *cutcoefs, SCIP_Real cutrhs, int *cutinds, int cutnnz)
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 addOneRowSafely(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_ROW *row, SCIP_Real weight, SCIP_Bool sidetypebasis, SCIP_Bool allowlocal, int negslack, int maxaggrlen, SCIP_Bool *rowtoolong, SCIP_Bool *rowused, SCIP_Bool *success, SCIP_Bool *lhsused)
#define DEFAULT_CUTGEN_MINFRAC
static SCIP_Bool chgCoeffWithBoundSafely(SCIP *scip, SCIP_VAR *var, SCIP_Real oldcoeff, SCIP_Real newcoeff, SCIP_Bool cutislocal, SCIP_Real *cutrhs)
static SCIP_RETCODE cutsSubstituteMIRSafely(SCIP *scip, SCIP_Real *weights, int *slacksign, int *rowinds, int nrowinds, SCIP_Real scale, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *nnz, SCIP_INTERVAL f0)
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)
#define DEFAULT_CUTGEN_ALLOWLOCAL
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 SCIP_RETCODE cutsTransformStrongCG(SCIP *scip, MIR_DATA *data, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool allowlocal, int *varsign, int *boundtype, SCIP_Bool *freevariable, SCIP_Bool *localbdsused)
static SCIP_RETCODE cutTightenCoefsSafely(SCIP *scip, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Bool *redundant)
static void getAlphaAndBeta(SCIP *scip, LIFTINGDATA *liftingdata, SCIP_Real vubcoef, int *alpha, SCIP_Real *beta)
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,)
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 determineBestBoundsSafely(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 void performBoundSubstitutionSafely(SCIP *scip, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int varsign, int boundtype, SCIP_Real boundval, int probindex, SCIP_Bool *localbdsused)
static SCIP_RETCODE cutsTransformMIRSafely(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 *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *nnz, int *varsign, int *boundtype, SCIP_Bool *freevariable, SCIP_Bool *localbdsused)
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)
#define DEFAULT_CUTGEN_POSTPROCESS
static SCIP_RETCODE findMIRBestUb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, MIR_DATA *data, int usevbds, SCIP_Bool allowlocal, SCIP_Real *bestub, SCIP_Real *simplebound, int *bestubtype)
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 SCIPgetNIntVars(SCIP *scip)
int SCIPgetNContVars(SCIP *scip)
int SCIPgetNBinImplVars(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 SCIPgetNIntImplVars(SCIP *scip)
int SCIPgetNContImplVars(SCIP *scip)
int SCIPgetNBinVars(SCIP *scip)
#define SCIPdebugMsgPrint
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
SCIP_Bool SCIPrealIsExactlyIntegral(SCIP_Real val)
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)
SCIP_RETCODE SCIPaddCertificateMirInfo(SCIP *scip)
SCIP_Bool SCIPisCertified(SCIP *scip)
SCIP_RETCODE SCIPaddCertificateAggrInfo(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_ROW **aggrrows, SCIP_Real *weights, int naggrrows, SCIP_ROW **negslackrows, SCIP_Real *negslackweights, int nnegslackrows)
void SCIPaggrRowCancelVarWithBound(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_VAR *var, int pos, SCIP_Bool *valid)
SCIP_Bool SCIPaggrRowHasRowBeenAdded(SCIP_AGGRROW *aggrrow, SCIP_ROW *row)
SCIP_RETCODE SCIPcutGenerationHeuristicCMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, int vartypeusevbds, 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_RETCODE SCIPcalcMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, int vartypeusevbds, 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)
int SCIPaggrRowGetRank(SCIP_AGGRROW *aggrrow)
SCIP_Bool SCIPcutsTightenCoefficients(SCIP *scip, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, int *nchgcoefs)
void SCIPaggrRowClearSafely(SCIP_AGGRROW *aggrrow)
SCIP_RETCODE SCIPaggrRowCreate(SCIP *scip, SCIP_AGGRROW **aggrrow)
SCIP_RETCODE SCIPaggrRowAddRowSafely(SCIP *scip, SCIP_AGGRROW *aggrrow, SCIP_ROW *row, SCIP_Real weight, int sidetype, 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)
SCIP_RETCODE SCIPcreateCutGenResult(SCIP *scip, SCIP_CUTGENRESULT **result)
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)
SCIP_RETCODE SCIPcalcStrongCG(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, int vartypeusevbds, 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)
void SCIPfreeCutGenResult(SCIP *scip, SCIP_CUTGENRESULT **result)
void SCIPaggrRowFree(SCIP *scip, SCIP_AGGRROW **aggrrow)
void SCIPinitCutGenParams(SCIP_CUTGENPARAMS *params)
SCIP_RETCODE SCIPcalcBestCut(SCIP *scip, SCIP_SOL *sol, SCIP_AGGRROW *aggrrow, SCIP_CUTGENMETHOD methods, SCIP_CUTGENPARAMS *params, SCIP_CUTGENRESULT *result)
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_Bool SCIPisExact(SCIP *scip)
void SCIPintervalSetRoundingModeUpwards(void)
void SCIPintervalSetRoundingModeDownwards(void)
SCIP_Real SCIPintervalGetInf(SCIP_INTERVAL interval)
void SCIPintervalSub(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
SCIP_ROUNDMODE SCIPintervalGetRoundingMode(void)
void SCIPintervalSetRoundingMode(SCIP_ROUNDMODE roundmode)
void SCIPintervalSubScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
void SCIPintervalSet(SCIP_INTERVAL *resultant, SCIP_Real value)
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
struct SCIP_Interval SCIP_INTERVAL
void SCIPintervalMulScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
void SCIPintervalMul(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalDiv(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalAddScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
SCIP_Real SCIPintervalGetSup(SCIP_INTERVAL interval)
void SCIPintervalAdd(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalSetRational(SCIP_INTERVAL *resultant, SCIP_RATIONAL *value)
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
SCIP_ROW ** SCIPgetLPRows(SCIP *scip)
int SCIPgetNLPRows(SCIP *scip)
#define SCIPfreeCleanBufferArray(scip, ptr)
#define SCIPfreeBuffer(scip, ptr)
#define SCIPallocCleanBufferArray(scip, ptr, num)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
BMS_BUFMEM * SCIPbuffer(SCIP *scip)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPallocBuffer(scip, ptr)
#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_Bool SCIPrationalIsLTReal(SCIP_RATIONAL *rat, SCIP_Real real)
void SCIPrationalMult(SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_RATIONAL *op2)
void SCIPrationalInvert(SCIP_RATIONAL *res, SCIP_RATIONAL *op)
SCIP_Real SCIPrationalGetReal(SCIP_RATIONAL *rational)
void SCIPrationalDiv(SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_RATIONAL *op2)
void SCIPrationalSetReal(SCIP_RATIONAL *res, SCIP_Real real)
void SCIPrationalFreeBuffer(BMS_BUFMEM *bufmem, SCIP_RATIONAL **rational)
void SCIPrationalDiff(SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_RATIONAL *op2)
SCIP_Bool SCIPrationalIsPositive(SCIP_RATIONAL *rational)
SCIP_RETCODE SCIPrationalCreateBuffer(BMS_BUFMEM *bufmem, SCIP_RATIONAL **rational)
SCIP_Bool SCIPrationalIsZero(SCIP_RATIONAL *rational)
void SCIPrationalSetRational(SCIP_RATIONAL *res, SCIP_RATIONAL *src)
SCIP_Bool SCIPrationalIsGEReal(SCIP_RATIONAL *rat, SCIP_Real real)
SCIP_Bool SCIPrationalIsNegative(SCIP_RATIONAL *rational)
void SCIPrationalDiffReal(SCIP_RATIONAL *res, SCIP_RATIONAL *rat, SCIP_Real real)
SCIP_Real SCIPrationalRoundReal(SCIP_RATIONAL *rational, SCIP_ROUNDMODE_RAT roundmode)
SCIP_Bool SCIPrationalIsEQReal(SCIP_RATIONAL *rat, SCIP_Real real)
void SCIPrationalMultReal(SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_Real op2)
SCIP_Bool SCIPrationalIsLE(SCIP_RATIONAL *rat1, SCIP_RATIONAL *rat2)
void SCIPrationalAddReal(SCIP_RATIONAL *res, SCIP_RATIONAL *rat, SCIP_Real real)
void SCIPrationalAddProdReal(SCIP_RATIONAL *res, SCIP_RATIONAL *op1, SCIP_Real op2)
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_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
SCIP_RETCODE SCIPcaptureRow(SCIP *scip, SCIP_ROW *row)
SCIP_ROWEXACT * SCIProwGetRowExact(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_Bool SCIPvarIsImpliedIntegral(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_RATIONAL * SCIPvarGetUbLocalExact(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_RATIONAL * SCIPvarGetLbGlobalExact(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetVlbVars(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RATIONAL * SCIPvarGetLbLocalExact(SCIP_VAR *var)
SCIP_Real * SCIPvarGetVubConstants(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetVubVars(SCIP_VAR *var)
SCIP_Real * SCIPvarGetVubCoefs(SCIP_VAR *var)
SCIP_RATIONAL * SCIPvarGetUbGlobalExact(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)
void SCIPsortInt(int *intarray, int len)
assert(minobj< SCIPgetCutoffbound(scip))
interval arithmetics for provable bounds
static SCIP_Bool isIntegralScalar(SCIP_Real val, SCIP_Real scalar, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Real *intval)
internal methods for LP management
SCIP_Bool SCIProwExactHasFpRelax(SCIP_ROWEXACT *row)
SCIP_ROW * SCIProwExactGetRowRhs(SCIP_ROWEXACT *row)
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,...)
internal miscellaneous methods
public methods for LP management
public methods for LP management
public methods for message output
public data structures and miscellaneous methods
methods for selecting k-medians
methods for sorting joint arrays of various types
public methods for problem variables
wrapper for rational number arithmetic
public methods for certified solving
public methods for cuts and aggregation rows
public methods for exact solving
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_Bool isenfint[NSECTIONS]
SCIP_Bool isimplint[NSECTIONS]
int * secindices[NSECTIONS]
SCIP_Real * negslackweights
SCIP_AGGREGATIONINFO ** aggrinfo
SCIP_BOUNDTYPE * boundtypesfortrans
SCIP_Real * slackcoefficients
SCIP_Real * splitcoefficients
SCIP_Real * slackusedcoef
SCIP_Bool * slackroundeddown
SCIP_INTERVAL * valsinterval
SCIP_Real * transbinvarsolvals
SCIP_Real * transcontvarsolvals
SCIP_Real * aggrconstants
SCIP_Real * aggrcoefscont
SCIP_Real * transvarvubcoefs
data structures for certificate output
data structures for LP management
data structures for exact LP management
SCIP main data structure.
datastructures for global SCIP settings
type definitions for certificate output
struct SCIP_MirInfo SCIP_MIRINFO
struct SCIP_AggregationInfo SCIP_AGGREGATIONINFO
struct SCIP_CutGenParams SCIP_CUTGENPARAMS
struct SCIP_AggrRow SCIP_AGGRROW
#define SCIP_CUTGENMETHOD_KNAPSACKCOVER
#define SCIP_CUTGENMETHOD_NONE
struct SCIP_CutGenResult SCIP_CUTGENRESULT
#define SCIP_CUTGENMETHOD_CMIR
uint32_t SCIP_CUTGENMETHOD
#define SCIP_CUTGENMETHOD_FLOWCOVER
enum SCIP_BoundType SCIP_BOUNDTYPE
struct SCIP_RowExact SCIP_ROWEXACT
enum SCIP_BaseStat SCIP_BASESTAT
struct SCIP_Messagehdlr SCIP_MESSAGEHDLR
#define SCIP_DECL_SORTINDCOMP(x)
struct SCIP_Rational SCIP_RATIONAL
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_VARTYPE_CONTINUOUS