91 for(
int i = 0;
i < cutnnz; ++
i )
110 if( cutcoefs[
i] > 0.0 )
147 for(
i = 0;
i < cutnnz; ++
i )
151 coef = cutcoefs[cutinds[
i]];
166 if( cutcoefs[
i] > 0.0 )
189#define NONZERO(x) (COPYSIGN(1e-100, (x)) + (x))
211 for(
i = 0 ;
i < row->
len; ++
i )
217 val = vals[probindex];
220 inds[(*nnz)++] = probindex;
222 val += row->
vals[
i] * scale;
228 vals[probindex] = val;
256 for(
i = 0 ;
i < row->
len; ++
i )
266 inds[(*nnz)++] = probindex;
303 for(
i = 0 ;
i < row->
len; ++
i )
314 inds[(*nnz)++] = probindex;
384 for(
i = 0 ;
i < row->
len; ++
i )
392 val = vals[probindex];
397 inds[(*nnz)++] = probindex;
415 val = valinterval.
inf;
417 val = valinterval.
sup;
420 val = valinterval.
inf;
426 val = valinterval.
sup;
442 vals[probindex] = val;
472 switch(
scip->set->sepa_efficacynorm )
475 for(
i = 0;
i < cutnnz; ++
i )
478 norm +=
SQR(cutcoefs[
i]);
483 for(
i = 0;
i < cutnnz; ++
i )
489 norm =
MAX(norm, absval);
493 for(
i = 0;
i < cutnnz; ++
i )
500 for(
i = 0;
i < cutnnz; ++
i )
512 return (activity - cutrhs) /
MAX(1e-6, norm);
531 switch(
scip->set->sepa_efficacynorm )
534 for(
i = 0;
i < nnz; ++
i )
542 for(
i = 0;
i < nnz; ++
i )
548 norm =
MAX(norm, absval);
552 for(
i = 0;
i < nnz; ++
i )
559 for(
i = 0;
i < nnz; ++
i )
601 switch(
scip->set->sepa_efficacynorm )
604 for(
i = 0;
i < cutnnz; ++
i )
606 coef = cutcoefs[cutinds[
i]];
613 for(
i = 0;
i < cutnnz; ++
i )
617 coef = cutcoefs[cutinds[
i]];
620 norm =
MAX(norm, absval);
624 for(
i = 0;
i < cutnnz; ++
i )
626 coef = cutcoefs[cutinds[
i]];
632 for(
i = 0;
i < cutnnz; ++
i )
634 coef = cutcoefs[cutinds[
i]];
645 return (activity - cutrhs) /
MAX(1e-6, norm);
672 switch(
scip->set->sepa_efficacynorm )
675 for(
i = 0;
i < cutnnz; ++
i )
684 for(
i = 0;
i < cutnnz; ++
i )
691 norm =
MAX(norm, absval);
695 for(
i = 0;
i < cutnnz; ++
i )
703 for(
i = 0;
i < cutnnz; ++
i )
716 return (activity - cutrhs) /
MAX(1e-6, norm);
747 for(
i = 0;
i < *cutnnz; )
770 if(
EPSZ(val, minval) || isfixed )
781 *cutrhs += (-val) * ub;
791 *cutrhs += (-val) * lb;
799 cutinds[
i] = cutinds[*cutnnz];
837 for(
i = 0;
i < *cutnnz; )
896 cutinds[
i] = cutinds[*cutnnz];
933 for(
i = 0;
i < *cutnnz; )
961 if(
EPSZ(val, minval) || isfixed )
992 cutinds[
i] = cutinds[*cutnnz];
1021 if( abscoef1 < abscoef2 )
1023 if( abscoef2 < abscoef1 )
1037 abscoef1 =
REALABS(coefs[ind1]);
1038 abscoef2 =
REALABS(coefs[ind2]);
1040 if( abscoef1 < abscoef2 )
1042 if( abscoef2 < abscoef1 )
1235 for(
i = 0;
i < *cutnnz; ++
i )
1251 if( cutinds[
i] < nintegralvars )
1269 if( cutinds[
i] < nintegralvars )
1301 equiscale = 1.0 /
MIN((maxact -
QUAD_TO_DBL(*cutrhs)), maxabsintval);
1303 for(
i = 0;
i < *cutnnz; ++
i )
1314 (
SCIP_Longint)
scip->set->sepa_maxcoefratio,
scip->set->sepa_maxcoefratio, &intscalar, &success) );
1321 intscalar *= equiscale;
1324 for(
i = 0;
i < *cutnnz; )
1353 cutinds[
i] = cutinds[*cutnnz];
1363 for(
i = 0;
i < *cutnnz; ++
i )
1406 maxabsintval *= equiscale;
1408 for(
i = 0;
i < *cutnnz; ++
i )
1425 maxabsval =
MIN(maxabsval, maxabsintval);
1426 maxabsval =
MAX(maxabsval, maxabscontval);
1428 scale = 1.0 / maxabsval;
1433 maxabsintval *= scale;
1435 for(
i = 0;
i < *cutnnz; ++
i )
1460 SCIPsortDownInd(cutinds, compareAbsCoefsQuad, (
void*) cutcoefs, *cutnnz);
1463 for(
i = 0;
i < *cutnnz; )
1467 if( cutinds[
i] >= nintegralvars )
1500 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
1519 cutinds[
i] = cutinds[*cutnnz];
1547 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
1566 cutinds[
i] = cutinds[*cutnnz];
1696 for(
i = 0;
i < *cutnnz; ++
i )
1703 val = cutcoefs[cutinds[
i]];
1712 if( cutinds[
i] < nintegralvars )
1713 maxabsintval =
MAX(maxabsintval, -val);
1716 maxabscontval =
MAX(maxabscontval, -val);
1731 if( cutinds[
i] < nintegralvars )
1732 maxabsintval =
MAX(maxabsintval, val);
1735 maxabscontval =
MAX(maxabscontval, val);
1765 equiscale = 1.0 /
MAX(maxabscontval, maxabsintval);
1767 for(
i = 0;
i < *cutnnz; ++
i )
1771 val = cutcoefs[cutinds[
i]];
1778 (
SCIP_Longint)
scip->set->sepa_maxcoefratio,
scip->set->sepa_maxcoefratio, &intscalar, &success) );
1786 intscalar *= equiscale;
1788 *cutrhs *= intscalar;
1793 mirinfo->
scale = intscalar;
1796 for(
i = 0;
i < *cutnnz; )
1801 val = cutcoefs[cutinds[
i]];
1804 *cutrhs += rhschange;
1826 cutcoefs[cutinds[
i]] = val;
1833 cutcoefs[cutinds[
i]] = val;
1835 cutinds[
i] = cutinds[*cutnnz];
1844 *cutrhs = floor(*cutrhs);
1850 for(
i = 0;
i < *cutnnz; ++
i )
1857 val = cutcoefs[cutinds[
i]];
1863 maxabsintval =
MAX(maxabsintval, -val);
1873 maxabsintval =
MAX(maxabsintval, val);
1898 *cutrhs *= equiscale;
1899 maxabsintval *= equiscale;
1903 mirinfo->
scale = equiscale;
1906 for(
i = 0;
i < *cutnnz; ++
i )
1910 val = cutcoefs[cutinds[
i]];
1919 cutcoefs[cutinds[
i]] = val;
1920 *cutrhs += rhschange;
1933 maxabsval =
MIN(maxabsval, maxabsintval);
1934 maxabsval =
MAX(maxabsval, maxabscontval);
1936 scale = 1.0 / maxabsval;
1942 maxabsintval *= scale;
1946 mirinfo->
scale = scale;
1949 for(
i = 0;
i < *cutnnz; ++
i )
1953 val = cutcoefs[cutinds[
i]];
1956 *cutrhs += rhschange;
1964 cutcoefs[cutinds[
i]] = val;
1977#ifdef SCIP_DISABLED_CODE
1980 for(
i = 0;
i < *cutnnz &&
FALSE; )
1984 if( cutinds[
i] >= nintegralvars )
2017 SCIPdebugPrintf(
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
2036 cutinds[
i] = cutinds[*cutnnz];
2064 SCIPdebugPrintf(
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
2083 cutinds[
i] = cutinds[*cutnnz];
2133 for(
i = 0;
i < *cutnnz; ++
i )
2141 val = cutcoefs[cutinds[
i]];
2150 if( cutinds[
i] < nintegralvars )
2151 maxabsintval =
MAX(maxabsintval, -val);
2154 maxabscontval =
MAX(maxabscontval, -val);
2168 if( cutinds[
i] < nintegralvars )
2169 maxabsintval =
MAX(maxabsintval, val);
2172 maxabscontval =
MAX(maxabscontval, val);
2200 equiscale = 1.0 /
MIN((maxact -
QUAD_TO_DBL(*cutrhs)), maxabsintval);
2202 for(
i = 0;
i < *cutnnz; ++
i )
2206 val = equiscale * cutcoefs[cutinds[
i]];
2212 (
SCIP_Longint)
scip->set->sepa_maxcoefratio,
scip->set->sepa_maxcoefratio, &intscalar, &success) );
2219 intscalar *= equiscale;
2222 for(
i = 0;
i < *cutnnz; )
2227 val = cutcoefs[cutinds[
i]];
2241 cutcoefs[cutinds[
i]] = intval;
2247 cutcoefs[cutinds[
i]] = 0.0;
2249 cutinds[
i] = cutinds[*cutnnz];
2259 for(
i = 0;
i < *cutnnz; ++
i )
2267 val = cutcoefs[cutinds[
i]];
2273 maxabsintval =
MAX(maxabsintval, -val);
2282 maxabsintval =
MAX(maxabsintval, val);
2301 maxabsintval *= equiscale;
2303 for(
i = 0;
i < *cutnnz; ++
i )
2304 cutcoefs[cutinds[
i]] *= equiscale;
2314 maxabsval =
MIN(maxabsval, maxabsintval);
2315 maxabsval =
MAX(maxabsval, maxabscontval);
2317 scale = 1.0 / maxabsval;
2322 maxabsintval *= scale;
2324 for(
i = 0;
i < *cutnnz; ++
i )
2325 cutcoefs[cutinds[
i]] *= scale;
2346 for(
i = 0;
i < *cutnnz; )
2350 if( cutinds[
i] >= nintegralvars )
2356 val = cutcoefs[cutinds[
i]];
2383 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
2399 cutcoefs[cutinds[
i]] = 0.0;
2401 cutinds[
i] = cutinds[*cutnnz];
2429 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
2445 cutcoefs[cutinds[
i]] = 0.0;
2447 cutinds[
i] = cutinds[*cutnnz];
2496 for(
i = 0;
i < *cutnnz; ++
i )
2503 if( cutcoefs[
i] < 0.0 )
2510 if( cutinds[
i] < nintegralvars )
2512 maxabsval =
MAX(maxabsval, -cutcoefs[
i]);
2513 absvals[
i] = -cutcoefs[
i];
2528 if( cutinds[
i] < nintegralvars )
2530 maxabsval =
MAX(maxabsval, cutcoefs[
i]);
2531 absvals[
i] = cutcoefs[
i];
2558 for(
i = 0;
i < *cutnnz; ++
i )
2561 if( cutinds[
i] >= nintegralvars )
2566 if( cutcoefs[
i] < 0.0 &&
SCIPisLE(
scip, maxact + cutcoefs[
i], *cutrhs) )
2573 if( coef > cutcoefs[
i] )
2582 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
2601 cutinds[
i] = cutinds[*cutnnz];
2602 cutcoefs[
i] = cutcoefs[*cutnnz];
2607 else if( cutcoefs[
i] > 0.0 &&
SCIPisLE(
scip, maxact - cutcoefs[
i], *cutrhs) )
2614 if( coef < cutcoefs[
i] )
2623 SCIPdebugMsg(
scip,
"tightened coefficient from %g to %g; rhs changed from %g to %g; the bounds are [%g,%g]\n",
2642 cutinds[
i] = cutinds[*cutnnz];
2643 cutcoefs[
i] = cutcoefs[*cutnnz];
2686 (*aggrrow)->local =
FALSE;
2687 (*aggrrow)->nnz = 0;
2688 (*aggrrow)->rank = 0;
2690 (*aggrrow)->rowsinds =
NULL;
2691 (*aggrrow)->slacksign =
NULL;
2692 (*aggrrow)->rowweights =
NULL;
2693 (*aggrrow)->nrows = 0;
2694 (*aggrrow)->rowssize = 0;
2741 if( aggrrow->
nnz == 0 )
2744 for(
i = 0;
i < aggrrow->
nnz; ++
i )
2775 (*aggrrow)->nnz = source->
nnz;
2778 if( source->
nrows > 0 )
2790 (*aggrrow)->rowsinds =
NULL;
2791 (*aggrrow)->slacksign =
NULL;
2792 (*aggrrow)->rowweights =
NULL;
2795 (*aggrrow)->nrows = source->
nrows;
2796 (*aggrrow)->rowssize = source->
nrows;
2797 (*aggrrow)->rank = source->
rank;
2798 (*aggrrow)->local = source->
local;
2838 if( sidetype == -1 )
2843 else if( sidetype == 1 )
2926 if( sidetype == -1 )
2931 else if( sidetype == 1 )
2965#ifdef SCIP_DISABLED_CODE
2969 sideval = ceil(sideval)
2976#ifdef SCIP_DISABLED_CODE
2980 sideval = floor(sideval);
2986 sidevalchg += sideval * weight;
3022 v = aggrrow->
inds[pos];
3085 if( aggrrow->
nnz == 0 )
3172 for(
i = 0 ;
i < len; ++
i )
3175 int probindex = inds[
i];
3180 aggrrow->
inds[aggrrow->
nnz++] = probindex;
3205 for(
i = 0;
i < aggrrow->
nnz; ++
i )
3227 for(
i = 0;
i < aggrrow->
nnz; ++
i )
3275 *rowtoolong =
FALSE;
3310 if( weight > 0.0 && ((negslack == 0) || (negslack == 1 && !row->
integral)) )
3322 if( weight < 0.0 && ((negslack == 0) || (negslack == 1 && !row->
integral)) )
3357 if( aggrrow->
nnz > maxaggrlen )
3396 *rowtoolong =
FALSE;
3446 if( weight > 0.0 && ((negslack == 0) || (negslack == 1 && !row->
integral)) )
3452#ifdef SCIP_DISABLED_CODE
3456 sideval = ceil(sideval);
3464 if( weight < 0.0 && ((negslack == 0) || (negslack == 1 && !row->
integral)) )
3470#ifdef SCIP_DISABLED_CODE
3474 sideval = floor(sideval);
3481 sidevalchg += sideval * weight;
3511 if( aggrrow->
nnz > maxaggrlen )
3549 SCIP_Bool rowused, rowusedcert, lhsused;
3578 if( rowinds !=
NULL && nrowinds > -1 )
3580 for( k = 0; k < nrowinds; ++k )
3584 SCIP_CALL(
addOneRow(
scip, aggrrow, rows[rowinds[k]], weights[rowinds[k]], sidetypebasis, allowlocal, negslack, maxaggrlen, &rowtoolong) );
3594 negslack, maxaggrlen, &rowtoolong, &rowused,
valid, &lhsused) );
3602 if( certificaterow !=
NULL )
3618 rowusedcert =
FALSE;
3625 allowlocal, 0,
nvars, &rowtoolong, &rowusedcert,
valid, &lhsused) );
3630 usedrows[nusedrows] = rows[rowinds[k]];
3631 usedweights[nusedrows] = weights[rowinds[k]];
3634 if( rowused && !rowusedcert && !integral )
3637 assert( (lhsused && weights[rowinds[k]] >= 0) || ((!lhsused) && weights[rowinds[k]] <= 0) || row->
integral );
3638 negslackrows[nnegslackrows] = rows[rowinds[k]];
3639 negslackweights[nnegslackrows] = -weights[rowinds[k]];
3651 for( k = 0; k < nrows; ++k )
3653 if( weights[k] != 0.0 )
3657 SCIP_CALL(
addOneRow(
scip, aggrrow, rows[k], weights[k], sidetypebasis, allowlocal, negslack, maxaggrlen, &rowtoolong) );
3667 maxaggrlen, &rowtoolong, &rowused,
valid, &lhsused) );
3675 if( certificaterow !=
NULL )
3690 rowusedcert =
FALSE;
3698 nvars, &rowtoolong, &rowusedcert,
valid, &lhsused) );
3703 usedrows[nusedrows] = rows[k];
3704 usedweights[nusedrows] = weights[k];
3707 if( rowused && !rowusedcert && !integral )
3710 assert( (lhsused && weights[k] >= 0) || ((!lhsused) && weights[k] <= 0) || row->
integral );
3711 negslackrows[nnegslackrows] = rows[k];
3712 negslackweights[nnegslackrows] = -weights[k];
3728 if( certificaterow !=
NULL )
3732 negslackrows, negslackweights, nnegslackrows) );
3736 if( certificaterow !=
NULL )
3797 for(
i = 0;
i < *nnz; ++
i )
3800 maxcoef =
MAX(absval, maxcoef);
3803 maxcoef /=
scip->set->sepa_maxcoefratio;
3805 minallowedcoef =
MAX(minallowedcoef, maxcoef);
3807 *success = !
removeZeros(
scip, minallowedcoef, cutislocal, cutcoefs,
QUAD(&rhs), cutinds, nnz);
3862 for(
i = 0;
i < *nnz; ++
i )
3868 maxcoef =
MAX(abscoef, maxcoef);
3871 maxcoef /=
scip->set->sepa_maxcoefratio;
3873 minallowedcoef =
MAX(minallowedcoef, maxcoef);
3930 for(
i = 0;
i < *nnz; ++
i )
3934 coef = cutcoefs[cutinds[
i]];
3936 maxcoef =
MAX(abscoef, maxcoef);
3939 maxcoef /=
scip->set->sepa_maxcoefratio;
3941 minallowedcoef =
MAX(minallowedcoef, maxcoef);
3969 QUAD(&aggrrow->rhs), aggrrow->
inds, &aggrrow->
nnz);
3979 return aggrrow->
nrows;
4018 for(
i = 0;
i < aggrrow->
nrows; ++
i )
4034 return aggrrow->
inds;
4044 return aggrrow->
nnz;
4054 return aggrrow->
rank;
4064 return aggrrow->
local;
4079#define MAXCMIRSCALE 1e+6
4134 if( probindex >= limit )
4138 if( probindex >= limit )
4142 if( probindex >= limit )
4146 if( probindex >= limit )
4150 if( probindex >= limit )
4177 assert(usevbds >= 0 && usevbds <= 2);
4194 *simplebound = *bestlb;
4202 if( bestvlbidx >= 0 && (bestvlb > *bestlb || (*bestlbtype < 0 &&
SCIPisGE(
scip, bestvlb, *bestlb))) )
4213 vlbvar = vlbvars[bestvlbidx];
4220 *bestlbtype = bestvlbidx;
4262 *simplebound = *bestub;
4270 if( bestvubidx >= 0 && (bestvub < *bestub || (*bestubtype < 0 &&
SCIPisLE(
scip, bestvub, *bestub))) )
4281 vubvar = vubvars[bestvubidx];
4288 *bestubtype = bestvubidx;
4308 int* boundsfortrans,
4328 if( boundsfortrans !=
NULL && boundsfortrans[v] > -3 )
4337 *bestlbtype = boundsfortrans[v];
4338 if( *bestlbtype == -1 )
4340 else if( *bestlbtype == -2 )
4355 k = boundsfortrans[v];
4375 *bestubtype = boundsfortrans[v];
4376 if( *bestubtype == -1 )
4378 else if( *bestubtype == -2 )
4393 k = boundsfortrans[v];
4428 *freevariable =
TRUE;
4441 else if(
SCIPisLT(
scip, varsol, (1.0 - boundswitch) * (*bestlb) + boundswitch * (*bestub)) )
4443 else if(
SCIPisGT(
scip, varsol, (1.0 - boundswitch) * (*bestlb) + boundswitch * (*bestub)) )
4445 else if( *bestlbtype == -1 )
4447 else if( *bestubtype == -1 )
4449 else if( ((*bestlbtype) >= 0 || (*bestubtype) >= 0) && !
SCIPisEQ(
scip, *bestlb - simplelb, simpleub - *bestub) )
4451 if( *bestlb - simplelb > simpleub - *bestub )
4456 else if( *bestlbtype >= 0 )
4458 else if( *bestubtype >= 0 )
4510 assert(usevbds >= 0 && usevbds <= 2);
4533 if( bestvlbidx >= 0 && (bestvlb > *bestlb || (*bestlbtype < 0 &&
SCIPisGE(
scip, bestvlb, *bestlb))) )
4544 vlbvar = vlbvars[bestvlbidx];
4551 *bestlbtype = bestvlbidx;
4573 assert(usevbds >= 0 && usevbds <= 2);
4596 if( bestvubidx >= 0 && (bestvub < *bestub || (*bestubtype < 0 &&
SCIPisLE(
scip, bestvub, *bestub))) )
4607 vubvar = vubvars[bestvubidx];
4614 *bestubtype = bestvubidx;
4640 assert(usevbds >= 0 && usevbds <= 2);
4657 *simplebound = *bestlb;
4666 int bestvlbtype = -1;
4679 for(
i = 0;
i < nvlbs;
i++ )
4691 vlbbnd = vlbcoefs[
i] * vlbsol + vlbconsts[
i];
4693 if( vlbbnd > bestvlb )
4701 if( bestvlbtype >= 0 &&
SCIPisGE(
scip, bestvlb, *bestlb) )
4704 *bestlbtype = bestvlbtype;
4729 assert(usevbds >= 0 && usevbds <= 2);
4746 *simplebound = *bestub;
4755 int bestvubtype = -1;
4768 for(
i = 0;
i < nvubs;
i++ )
4780 vubbnd = vubcoefs[
i] * vubsol + vubconsts[
i];
4782 if( vubbnd < bestvub )
4790 if( bestvubtype >= 0 &&
SCIPisLE(
scip, bestvub, *bestub) )
4793 *bestubtype = bestvubtype;
4813 int* boundsfortrans,
4830 assert(usevbds >= 0 && usevbds <= 2);
4835 if( boundsfortrans !=
NULL && boundsfortrans[v] > -3 )
4844 *bestlbtype = boundsfortrans[v];
4845 if( *bestlbtype == -1 )
4847 else if( *bestlbtype == -2 )
4863 k = boundsfortrans[v];
4871 *bestlb = vlbcoefs[k] * vlbsol + vlbconsts[k];
4885 *bestubtype = boundsfortrans[v];
4886 if( *bestubtype == -1 )
4888 else if( *bestubtype == -2 )
4904 k = boundsfortrans[v];
4911 *bestub = vubcoefs[k] * vubsol + vubconsts[k];
4939 *freevariable =
TRUE;
4952 else if(
SCIPisLT(
scip, varsol, (1.0 - boundswitch) * (*bestlb) + boundswitch * (*bestub)) )
4954 else if(
SCIPisGT(
scip, varsol, (1.0 - boundswitch) * (*bestlb) + boundswitch * (*bestub)) )
4956 else if( *bestlbtype == -1 )
4958 else if( *bestubtype == -1 )
4960 else if( ((*bestlbtype) >= 0 || (*bestubtype) >= 0) && !
SCIPisEQ(
scip, *bestlb - simplelb, simpleub - *bestub) )
4962 if( *bestlb - simplelb > simpleub - *bestub )
4967 else if( *bestlbtype >= 0 )
4969 else if( *bestubtype >= 0 )
5032 *localbdsused = *localbdsused || ( boundtype == -2 );
5120 coef = cutcoefs[probindex];
5125 *cutrhs += coef * (-boundval);
5126 *localbdsused = *localbdsused || (boundtype == -2);
5132 SCIPerrorMessage(
"variable lower bounds not implemented in exact solving mode yet \n");
5166 coef = cutcoefs[probindex];
5171 *cutrhs += coef * (-boundval);
5173 *localbdsused = *localbdsused || (boundtype == -2);
5207 *localbdsused = *localbdsused || (boundtype == -2);
5247 cutinds[(*nnz)++] = zidx;
5285 *localbdsused = *localbdsused || (boundtype == -2);
5328 int* boundsfortrans,
5350 int aggrrowintstart;
5369 *freevariable =
FALSE;
5370 *localbdsused =
FALSE;
5393 ignoresol, boundsfortrans, boundtypesfortrans,
5394 bestlbs +
i, bestubs +
i, bestlbtypes +
i, bestubtypes +
i, selectedbounds +
i, freevariable) );
5401 aggrrowintstart =
i;
5404 for(
i = 0;
i < aggrrowintstart; ++
i )
5413 boundtype[
i] = bestlbtypes[
i];
5423 boundtype[
i] = bestubtypes[
i];
5432 if( boundtype[
i] == -2 )
5447 assert(cutinds[
i] < firstcontvar);
5451 ignoresol, boundsfortrans, boundtypesfortrans,
5452 bestlbs +
i, bestubs +
i, bestlbtypes +
i, bestubtypes +
i, selectedbounds +
i, freevariable) );
5462 for(
i = aggrrowintstart;
i < *nnz; ++
i )
5473 boundtype[
i] = bestlbtypes[
i];
5484 boundtype[
i] = bestubtypes[
i];
5493 if( boundtype[
i] == -2 )
5551 int* boundsfortrans,
5583 *freevariable =
FALSE;
5584 *localbdsused =
FALSE;
5599 int usevbds = data->
usevbds[s];
5615 indices[
i] = indices[data->
secnnz[s]];
5621 assert(cutindex < allocsize);
5623 ignoresol, boundsfortrans, boundtypesfortrans,
5624 bestlbs + cutindex, bestubs + cutindex, bestlbtypes + cutindex, bestubtypes + cutindex,
5625 selectedbounds + cutindex, freevariable) );
5644 for( k = 0; k < data->
secnnz[j]; ++k )
5665 boundtype[
i] = bestlbtypes[
i];
5667 bestbnd = bestlbs[
i];
5674 boundtype[
i] = bestubtypes[
i];
5676 bestbnd = bestubs[
i];
5682 if( fixintegralrhs )
5688 if( f0 < minfrac || f0 > maxfrac )
5696 bestviolgain = -1e+100;
5708 if( boundtype[
i] < 0
5732 if( newf0 < minfrac || newf0 > maxfrac )
5748 viol = f0 - fj * (varsign[
i] == +1 ? solval - bestlbs[
i] : bestubs[
i] - solval);
5749 newviol = newf0 - newfj * (varsign[
i] == -1 ? solval - bestlbs[
i] : bestubs[
i] - solval);
5750 violgain = newviol - viol;
5755 SCIPerrorMessage(
"Cannot handle closest bounds with ignoring the LP solution.\n");
5765 bestviolgain = violgain;
5775 assert(besti < data->ncutinds);
5776 assert(boundtype[besti] < 0);
5788 if( varsign[besti] == +1 )
5791 assert(bestubtypes[besti] < 0);
5792 boundtype[besti] = bestubtypes[besti];
5793 varsign[besti] = -1;
5798 assert(bestlbtypes[besti] < 0);
5799 boundtype[besti] = bestlbtypes[besti];
5800 varsign[besti] = +1;
5802 *localbdsused = *localbdsused || (boundtype[besti] == -2);
5925 while(
i < *nnz && cutinds[
i] >= firstcontvar )
5930 assert(cutinds[
i] < firstcontvar);
5938 for(
i = *nnz - 1;
i >= 0 && cutinds[
i] < firstcontvar; --
i )
5951 assert(varsign[
i] == +1 || varsign[
i] == -1);
5962 aj = cutcoefs[v] * varsign[
i];
6022 if( cutaj.
inf != 0.0 || cutaj.
sup != 0 )
6028 if( varsign[
i] == +1 )
6031 if( boundtype[
i] == -1 )
6050 if( boundtype[
i] == -1 )
6070 if( cutaj.
inf == 0.0 )
6074 cutinds[
i] = cutinds[*nnz];
6086 while(
i >= ndelcontvars )
6099 assert(varsign[
i] == +1 || varsign[
i] == -1);
6100 assert( v >= firstcontvar );
6108 if( aj * varsign[
i] >= 0.0 )
6123 cutinds[
i] = cutinds[ndelcontvars];
6124 varsign[
i] = varsign[ndelcontvars];
6125 boundtype[
i] = boundtype[ndelcontvars];
6135 if( boundtype[
i] < 0 )
6140 if( varsign[
i] == +1 )
6143 if( boundtype[
i] == -1 )
6161 if( boundtype[
i] == -1 )
6188 if( ndelcontvars > 0 )
6190 assert(ndelcontvars <= *nnz);
6191 *nnz -= ndelcontvars;
6192 if( *nnz < ndelcontvars )
6208#ifdef SCIP_DISABLED_CODE
6316 while(
i < *nnz && cutinds[
i] >= firstcontvar )
6321 assert(cutinds[
i] < firstcontvar);
6326 for(
i = *nnz - 1;
i >= 0 && cutinds[
i] < firstcontvar; --
i )
6341 assert(varsign[
i] == +1 || varsign[
i] == -1);
6417 cutinds[
i] = cutinds[*nnz];
6432 if( varsign[
i] == +1 )
6435 if( boundtype[
i] == -1 )
6452 if( boundtype[
i] == -1 )
6471 while(
i >= ndelcontvars )
6492 assert(varsign[
i] == +1 || varsign[
i] == -1);
6493 assert( v >= firstcontvar );
6516 cutinds[
i] = cutinds[ndelcontvars];
6517 varsign[
i] = varsign[ndelcontvars];
6518 boundtype[
i] = boundtype[ndelcontvars];
6533 if( boundtype[
i] < 0 )
6538 if( varsign[
i] == +1 )
6541 if( boundtype[
i] == -1 )
6558 if( boundtype[
i] == -1 )
6578#ifdef SCIP_DISABLED_CODE
6589 vbidx = boundtype[
i];
6592 if( varsign[
i] == +1 )
6610 assert(0 <= zidx && zidx < firstcontvar);
6620 cutinds[(*nnz)++] = zidx;
6634 if( ndelcontvars > 0 )
6636 assert(ndelcontvars <= *nnz);
6637 *nnz -= ndelcontvars;
6638 if( *nnz < ndelcontvars )
6739 int nnz = data->
secnnz[s];
6745 for(
i = nnz - 1;
i >= 0 ; --
i )
6758 sign = varsign[cutindex];
6759 assert(sign == +1 || sign == -1);
6760 type = boundtype[cutindex];
6770 if( enfintegral || implintegral )
6812 indices[
i] = indices[data->
secnnz[s]];
6902 ++data->
secnnz[zsection];
6919 int nnz = data->
secnnz[s];
6920 for(
i = 0;
i < nnz; ++
i )
6979 int currentnegslackrow;
7008 currentnegslackrow = 0;
7009 for(
i = 0;
i < nrowinds;
i++ )
7019 assert(slacksign[
i] == -1 || slacksign[
i] == +1);
7028 if( slacksign[
i] == 1 )
7051 downar = floor(ar.
inf);
7054 integralslack =
TRUE;
7060 slackweight = weights[
i];
7061 slackroundeddown =
TRUE;
7072 splitcoef = downar + 1;
7073 slackweight = weights[
i];
7074 slackroundeddown =
FALSE;
7075 SCIPdebugMessage(
"fractionality %g, f0 %g -> round up! splitcoef %g sub-coefficient %g", fr.
inf, f0.
inf, splitcoef, cutar.
inf);
7102 if( slacksign[
i] == -1 )
7124 if( slackroundeddown )
7146 currentnegslackrow++;
7154 *cutrhs += sidevalchg;
7158 if( slacksign[
i] == +1 )
7167#ifdef SCIP_DISABLED_CODE
7187#ifdef SCIP_DISABLED_CODE
7209#ifdef SCIP_DISABLED_CODE
7253 int currentnegslackrow;
7286 currentnegslackrow = 0;
7287 for(
i = 0;
i < nrowinds;
i++ )
7293 assert(slacksign[
i] == -1 || slacksign[
i] == +1);
7302 if( slacksign[
i] == 1 )
7313#ifdef SCIP_DISABLED_CODE
7375 if( slacksign[
i] == -1 )
7384 currentnegslackrow++;
7392 *cutrhs += sidevalchg;
7396 if( slacksign[
i] == +1 )
7404#ifdef SCIP_DISABLED_CODE
7426#ifdef SCIP_DISABLED_CODE
7511 for(
i = 0;
i < nrowinds;
i++ )
7524 assert(slacksign[
i] == -1 || slacksign[
i] == +1);
7582 if( slacksign[
i] == +1 )
7645 int* boundsfortrans,
7689 *cutislocal =
FALSE;
7699 tmpnnz = aggrrow->
nnz;
7700 tmpislocal = aggrrow->
local;
7716 for(
i = 0;
i < tmpnnz; ++
i )
7719 int k = aggrrow->
inds[
i];
7721 coef = aggrrow->
vals[k];
7747 boundsfortrans, boundtypesfortrans, tmpcoefs, &rhs, tmpinds, &tmpnnz, varsign, boundtype, &freevariable, &localbdsused) );
7748 assert(allowlocal || !localbdsused);
7749 tmpislocal = tmpislocal || localbdsused;
7786 downrhs = floor(rhs);
7799 if( f0interval.
inf < minfrac || f0interval.
sup > maxfrac )
7835 aggrrow->
nrows, scale, tmpcoefs, &rhs, tmpinds, &tmpnnz, f0interval) );
7864 *cutislocal = tmpislocal;
7867 for(
i = 0;
i < *cutnnz; ++
i )
7871 cutcoefs[
i] = tmpcoefs[j];
7875 if( cutefficacy !=
NULL )
7876 *cutefficacy = mirefficacy;
7878 if( cutrank !=
NULL )
7879 *cutrank = aggrrow->
rank + 1;
7894 for(
i = 0;
i < tmpnnz; ++
i )
7896 tmpcoefs[tmpinds[
i]] = 0.0;
7934 int* boundsfortrans,
7970 boundsfortrans, boundtypesfortrans, minfrac, maxfrac, scale, aggrrow, cutcoefs, cutrhs,
7971 cutinds, cutnnz, cutefficacy, cutrank, cutislocal, success);
7998 data->
usevbds[l] = l < vartypeusevbds ? 2 : 0;
8021 for( l = 0; l < nnz; ++l )
8024 int m = aggrrow->
inds[l];
8037 for( l = 0; l < nnz; ++l )
8049 tmpislocal = aggrrow->
local;
8073 boundsfortrans, boundtypesfortrans, minfrac, maxfrac,
8074 varsign, boundtype, &freevariable, &localbdsused) );
8075 assert(allowlocal || !localbdsused);
8076 tmpislocal = tmpislocal || localbdsused;
8154 aggrrow->
nrows, scale,
8184 *cutislocal = tmpislocal;
8187 for(
int i = 0;
i < *cutnnz; ++
i )
8199 if( cutefficacy !=
NULL )
8200 *cutefficacy = mirefficacy;
8202 if( cutrank !=
NULL )
8203 *cutrank = aggrrow->
rank + 1;
8243 for(
int s =
NSECTIONS - 1; s >= 0; --s )
8279 scale = 1.0 / delta;
8284 if( f0 < minfrac || f0 > maxfrac )
8287 onedivoneminusf0 = 1.0 / (1.0 - f0);
8289 contscale = scale * onedivoneminusf0;
8298 rhs -= contscale * contactivity;
8299 norm =
SQR(contscale) * contsqrnorm;
8311 if( fi > f0pluseps )
8312 floorai += (fi - f0) * onedivoneminusf0;
8314 rhs -= solvals[
i] * floorai;
8315 norm +=
SQR(floorai);
8320 return - rhs /
MAX(norm, 1e-6);
8350 int* boundsfortrans,
8442 data->
usevbds[l] = l < vartypeusevbds ? 2 : 0;
8465 for( l = 0; l < nnz; ++l )
8468 int m = aggrrow->
inds[l];
8481 for( l = 0; l < nnz; ++l )
8491 *cutislocal = aggrrow->
local;
8509 boundsfortrans, boundtypesfortrans, minfrac, maxfrac, varsign, boundtype, &freevariable, &localbdsused) );
8510 assert(allowlocal || !localbdsused);
8526 maxabsmksetcoef = -1.0;
8530 for(
i = mksetnnz - 1;
i >= 0 && mksetinds[
i] < firstcontvar; --
i )
8544 bounddistpos[nbounddist] =
i;
8551 if( nbounddist == 0 )
8558 for(
int j = 0; j < intstart; ++j )
8562 for(
int j = intstart; j < data->
ncutinds; ++j )
8568 ndeltacands = nbounddist;
8578 if( intscalesuccess )
8584 intscalerhs =
QUAD_TO_DBL(data->cutrhs) * intscale;
8585 delta = 1.0 / intscale;
8586 intf0 = intscalerhs - floor(intscalerhs);
8590 if( intf0 < minfrac || intf0 > maxfrac )
8592 intscale *=
SCIPceil(
scip,
MAX(minfrac, (1.0 - maxfrac)) /
MIN(intf0, (1.0 - intf0)));
8593 intscalerhs =
QUAD_TO_DBL(data->cutrhs) * intscale;
8594 delta = 1.0 / intscale;
8595 intf0 = intscalerhs - floor(intscalerhs);
8598 if( intf0 >= minfrac && intf0 <= maxfrac )
8601 deltacands[ndeltacands++] = delta;
8603 if( intf0 < maxfrac )
8607 delta2 = 1.0 / (intscale *
SCIPfloor(
scip, maxfrac / intf0));
8610 deltacands[ndeltacands++] = delta2;
8617 for(
i = 0;
i < nbounddist; ++
i )
8621 absmksetcoef =
REALABS(deltacands[
i]);
8622 maxabsmksetcoef =
MAX(absmksetcoef, maxabsmksetcoef);
8624 deltacands[
i] = absmksetcoef;
8628 if( maxabsmksetcoef != -1.0 )
8629 deltacands[ndeltacands++] = maxabsmksetcoef + 1.0;
8631 deltacands[ndeltacands++] = 1.0;
8633 maxtestdelta =
MIN(ndeltacands, maxtestdelta);
8666 for(
i = intstart;
i < mksetnnz; ++
i )
8678 if( boundtype[
i] == -1 )
8681 if( varsign[
i] == -1 )
8691 if( varsign[
i] == -1 )
8697 tmpvalues[ntmpcoefs] = solval;
8703 assert(ntmpcoefs == mksetnnz - intstart);
8707 for(
i = 0;
i < intstart; ++
i )
8721 switch( boundtype[
i] )
8725 if( varsign[
i] == -1 )
8732 if( varsign[
i] == -1 )
8739 if( varsign[
i] == -1 )
8749 solval = (coef * vbdsolval + constant) - solval;
8761 solval = solval - (coef * vbdsolval + constant);
8765 contactivity += solval * (
QUAD_TO_DBL(mksetcoef) * varsign[
i]);
8774 for(
i = 0;
i < aggrrow->
nrows; ++
i )
8792 slackval = row->
rhs - slackval;
8800 slackval = slackval - row->
lhs;
8806 tmpvalues[ntmpcoefs] = slackval;
8815 contactivity += slackval * slackcoeff;
8816 contsqrnorm +=
SQR(slackcoeff);
8825 for(
i = 0;
i < maxtestdelta; ++
i )
8832 for( j = 0; j <
i; ++j )
8836 deltaseenbefore =
TRUE;
8842 if( deltaseenbefore )
8844 maxtestdelta =
MIN(maxtestdelta + 1, ndeltacands);
8850 if( efficacy > bestefficacy )
8852 bestefficacy = efficacy;
8853 bestdelta = deltacands[
i];
8864 for(
i = 2;
i <= 8 ;
i *= 2 )
8869 delta = basedelta /
i;
8873 if( efficacy > bestefficacy )
8875 bestefficacy = efficacy;
8884 for(
i = 0;
i < nbounddist; ++
i )
8896 k = bounddistpos[
i];
8920 tmpcoefs[k - intstart] = -tmpcoefs[k - intstart];
8922 oldsolval = tmpvalues[k - intstart];
8929 if( newefficacy > bestefficacy )
8932 bestefficacy = newefficacy;
8935 if( varsign[k] == +1 )
8939 boundtype[k] = bestubtype;
8946 boundtype[k] = bestlbtype;
8950 localbdsused = localbdsused || (boundtype[k] == -2);
8955 tmpcoefs[k - intstart] = -tmpcoefs[k - intstart];
8956 tmpvalues[k - intstart] = oldsolval;
8960 if( bestefficacy > 0.0 )
8967 scale = 1.0 / bestdelta;
8977 for(
i = 0;
i < mksetnnz; ++
i )
9029 SCIPdebugMsg(
scip,
"efficacy of cmir cut is different than expected efficacy: %f != %f\n", efficacy, bestefficacy);
9034 *cutislocal = *cutislocal || localbdsused;
9048 SCIPdebugMsg(
scip,
"post-processed cut (success = %s):\n", *success ?
"TRUE" :
"FALSE");
9071 *cutefficacy = mirefficacy;
9072 if( cutrank !=
NULL )
9073 *cutrank = aggrrow->
rank + 1;
9074 *cutislocal = *cutislocal || localbdsused;
9097 if(mksetcoefs[
i] != 0.0)
9111 for(
int s =
NSECTIONS - 1; s >= 0; --s )
9131#define NO_EXACT_KNAPSACK
9133#ifndef NO_EXACT_KNAPSACK
9134#define MAXDNOM 1000LL
9135#define MINDELTA 1e-03
9136#define MAXDELTA 1e-09
9137#define MAXSCALE 1000.0
9138#define MAXDYNPROGSPACE 1000000
9141#define MAXABSVBCOEF 1e+5
9142#define MAXBOUND 1e+10
9219 *closestvlbidx = -1;
9232 for(
i = 0;
i < nvlbs;
i++ )
9241 if( bestsub > vlbconsts[
i] )
9256 if( (
unsigned int)probidxbinvar >= (
unsigned int)nbinvars )
9277 if( binvarused[probidxbinvar] == 1 )
9286 rowcoefsign =
COPYSIGN(1.0, rowcoef);
9288 val2 = rowcoefsign * ((rowcoef * vlbcoefs[
i]) + rowcoefbinvar);
9294 val1 = rowcoefsign * ((rowcoef * (bestsub - vlbconsts[
i])) + rowcoefbinvar);
9301 if( vlbsol > *closestvlb )
9303 *closestvlb = vlbsol;
9306 assert(*closestvlbidx >= 0);
9349 *closestvubidx = -1;
9362 for(
i = 0;
i < nvubs;
i++ )
9371 if( bestslb < vubconsts[
i] )
9386 if( (
unsigned int)probidxbinvar >= (
unsigned int)nbinvars )
9407 if( binvarused[probidxbinvar] == 1 )
9416 rowcoefsign =
COPYSIGN(1.0, rowcoef);
9418 val2 = rowcoefsign * ((rowcoef * vubcoefs[
i]) + rowcoefbinvar);
9424 val1 = rowcoefsign * ((rowcoef * (bestslb - vubconsts[
i])) + rowcoefbinvar);
9431 if( vubsol < *closestvub )
9433 *closestvub = vubsol;
9436 assert(*closestvubidx >= 0);
9480 bestlbtype[varposinrow] = -3;
9481 bestubtype[varposinrow] = -3;
9483 probidx = rowinds[varposinrow];
9498 if( bestslb[varposinrow] <= -
MAXBOUND )
9501 if( bestsub[varposinrow] >=
MAXBOUND )
9506 SCIPdebugMsg(
scip,
" %d: %g <%s, idx=%d, lp=%g, [%g(%d),%g(%d)]>:\n", varposinrow, rowcoef,
SCIPvarGetName(
var), probidx,
9507 solval, bestslb[varposinrow], bestslbtype[varposinrow], bestsub[varposinrow], bestsubtype[varposinrow]);
9514 *freevariable =
TRUE;
9523 bestlb[varposinrow] = bestslb[varposinrow];
9524 bestlbtype[varposinrow] = bestslbtype[varposinrow];
9534 bestlb[varposinrow] = bestvlb;
9535 bestlbtype[varposinrow] = bestvlbidx;
9545 bestub[varposinrow] = bestsub[varposinrow];
9546 bestubtype[varposinrow] = bestsubtype[varposinrow];
9556 bestub[varposinrow] = bestvub;
9557 bestubtype[varposinrow] = bestvubidx;
9561 SCIPdebugMsg(
scip,
" bestlb=%g(%d), bestub=%g(%d)\n", bestlb[varposinrow], bestlbtype[varposinrow], bestub[varposinrow], bestubtype[varposinrow]);
9568 *freevariable =
TRUE;
9572 *freevariable =
FALSE;
9578 if(
SCIPisEQ(
scip, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow]) && bestlbtype[varposinrow] >= 0 )
9582 else if(
SCIPisEQ(
scip, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow])
9583 && bestubtype[varposinrow] >= 0 )
9587 else if(
SCIPisLE(
scip, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow]) )
9593 assert(
SCIPisGT(
scip, solval, (1.0 - boundswitch) * bestlb[varposinrow] + boundswitch * bestub[varposinrow]));
9606 binvarused[vlbvarprobidx] = 1;
9617 binvarused[vubvarprobidx] = 1;
9661 SCIPdebugMsg(
scip,
"--------------------- construction of SNF relaxation ------------------------------------\n");
9682 for(
i = nnz - 1;
i >= 0 && rowinds[
i] < nbinvars; --
i )
9683 binvarused[rowinds[
i]] = -1;
9685 nnonbinvarsrow =
i + 1;
9687 for(
i = 0;
i < nnonbinvarsrow; ++
i )
9691 assert(rowinds[
i] >= nbinvars);
9694 bestlb, bestub, bestslb, bestsub, bestlbtype, bestubtype, bestslbtype, bestsubtype, selectedbounds, &freevariable) );
9701 for( j = nnz - 1; j >= nnonbinvarsrow; --j )
9702 binvarused[rowinds[j]] = 0;
9705 for( j = 0; j <
i; ++j )
9724 *localbdsused =
FALSE;
9739 for(
i = 0;
i < nnonbinvarsrow; ++
i )
9746 probidx = rowinds[
i];
9752 assert(probidx >= nbinvars);
9760 assert(bestsubtype[
i] == -1 || bestsubtype[
i] == -2);
9768 if( bestlbtype[
i] < 0 )
9788 if( bestlbtype[
i] == -2 || bestsubtype[
i] == -2 )
9789 *localbdsused =
TRUE;
9821 SCIPdebugMsg(
scip,
" --> bestlb used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=1), rhs=%g-(%g*%g)=%g\n",
9849 assert(binvarused[vlbvarprobidx] == 1);
9850 assert(vlbvarprobidx < nbinvars);
9869 binvarused[vlbvarprobidx] = 0;
9900 SCIPdebugMsg(
scip,
" --> bestlb used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=%s), rhs=%g-(%g*%g)=%g\n",
9912 assert(bestslbtype[
i] == -1 || bestslbtype[
i] == -2);
9920 if( bestubtype[
i] < 0 )
9940 if( bestubtype[
i] == -2 || bestslbtype[
i] == -2 )
9941 *localbdsused =
TRUE;
9973 SCIPdebugMsg(
scip,
" --> bestub used for trans: ... %s y'_%d + ..., Y'_%d <= %g x_%d (=1), rhs=%g-(%g*%g)=%g\n",
10001 assert(binvarused[vubvarprobidx] == 1);
10002 assert(vubvarprobidx < nbinvars);
10008 binvarused[vubvarprobidx] = 0;
10052 SCIPdebugMsg(
scip,
" --> bestub used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=%s), rhs=%g-(%g*%g)=%g\n",
10069 for(
i = nnonbinvarsrow;
i < nnz; ++
i )
10078 probidx = rowinds[
i];
10081 assert(probidx < nbinvars);
10084 if( binvarused[probidx] == 0 )
10088 assert(binvarused[probidx] == -1);
10091 binvarused[probidx] = 0;
10098 SCIPdebugMsg(
scip,
" %d: %g <%s, idx=%d, lp=%g, [%g, %g]>:\n",
i,
QUAD_TO_DBL(rowcoef),
SCIPvarGetName(
var), probidx, varsolval,
10155 SCIPdebugMsg(
scip,
"constraint in constructed 0-1 single node flow relaxation: ");
10250 if( solitems !=
NULL )
10255 if( solval !=
NULL )
10262 for(
i = nitems - 1;
i >= 0; --
i )
10263 tempsort[
i] = profits[
i] / weights[
i];
10275 solitemsweight = 0.0;
10276 for( j = 0; j < nitems &&
SCIPisFeasLT(
scip, solitemsweight + weights[j], capacity); j++ )
10278 if( solitems !=
NULL )
10280 solitems[*nsolitems] = items[j];
10283 if( solval !=
NULL )
10284 (*solval) += profits[j];
10285 solitemsweight += weights[j];
10289 for( ; j < nitems; j++ )
10293 if( solitems !=
NULL )
10295 solitems[*nsolitems] = items[j];
10298 if( solval !=
NULL )
10299 (*solval) += profits[j];
10300 solitemsweight += weights[j];
10302 else if( solitems !=
NULL )
10304 nonsolitems[*nnonsolitems] = items[j];
10326 int* nflowcovervars,
10327 int* nnonflowcovervars,
10328 int* flowcoverstatus,
10342 assert(nnonsolitems >= 0);
10343 assert(nflowcovervars !=
NULL && *nflowcovervars >= 0);
10344 assert(nnonflowcovervars !=
NULL && *nnonflowcovervars >= 0);
10350 for( j = 0; j < nsolitems; j++ )
10353 if( coefs[solitems[j]] == 1 )
10355 flowcoverstatus[solitems[j]] = -1;
10356 (*nnonflowcovervars)++;
10361 assert(coefs[solitems[j]] == -1);
10362 flowcoverstatus[solitems[j]] = 1;
10363 (*nflowcovervars)++;
10367 for( j = 0; j < nnonsolitems; j++ )
10370 if( coefs[nonsolitems[j]] == 1 )
10372 flowcoverstatus[nonsolitems[j]] = 1;
10373 (*nflowcovervars)++;
10374 SCIPquadprecSumQD(*flowcoverweight, *flowcoverweight, vubcoefs[nonsolitems[j]]);
10379 assert(coefs[nonsolitems[j]] == -1);
10380 flowcoverstatus[nonsolitems[j]] = -1;
10381 (*nnonflowcovervars)++;
10390#ifndef NO_EXACT_KNAPSACK
10405 assert(mindelta <= 0.0);
10406 assert(maxdelta >= 0.0);
10408 sval = val * scalar;
10409 downval = floor(sval);
10410 upval = ceil(sval);
10430 assert(mindelta <= 0.0);
10431 assert(maxdelta >= 0.0);
10433 sval = val * scalar;
10434 upval = ceil(sval);
10452 int* nflowcovervars,
10453 int* nnonflowcovervars,
10454 int* flowcoverstatus,
10473#if !defined(NDEBUG) || defined(SCIP_DEBUG)
10479 int nflowcovervarsafterfix;
10482 int nnonflowcovervarsafterfix;
10498 SCIPdebugMsg(
scip,
"--------------------- get flow cover ----------------------------------------------------\n");
10512 *nflowcovervars = 0;
10513 *nnonflowcovervars = 0;
10516 nflowcovervarsafterfix = 0;
10517 nnonflowcovervarsafterfix = 0;
10519#if !defined(NDEBUG) || defined(SCIP_DEBUG)
10533 n1itemsweight = 0.0;
10544 flowcoverstatus[j] = -1;
10545 (*nnonflowcovervars)++;
10565 flowcoverstatus[j] = -1;
10566 (*nnonflowcovervars)++;
10572 flowcoverstatus[j] = 1;
10573 (*nflowcovervars)++;
10580 flowcoverstatus[j] = 1;
10581 (*nflowcovervars)++;
10589 flowcoverstatus[j] = -1;
10590 (*nnonflowcovervars)++;
10594 assert((*nflowcovervars) + (*nnonflowcovervars) + nitems == snf->
ntransvars);
10628 transweightsrealintegral =
TRUE;
10629 for( j = 0; j < nitems; j++ )
10634 transweightsrealintegral =
FALSE;
10639 SCIPdebugMsg(
scip,
" <%d>: j in N1: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
10640 items[j], transprofitsreal[j],
SCIPisIntegral(
scip, transweightsreal[j]) ?
"" :
" ----> NOT integral");
10645 SCIPdebugMsg(
scip,
" <%d>: j in N2: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
10646 items[j], transprofitsreal[j],
SCIPisIntegral(
scip, transweightsreal[j]) ?
"" :
" ----> NOT integral");
10651 SCIPdebugMsg(
scip,
" transcapacity = -rhs(%g) + flowcoverweight(%g) + n1itemsweight(%g) = %g\n",
10680 if( transweightsrealintegral )
10684 scalesuccess =
TRUE;
10688 scalesuccess =
FALSE;
10704 for( j = 0; j < nitems; ++j )
10706 transweightsint[j] = getIntegralVal(transweightsreal[j], scalar, -
MINDELTA,
MAXDELTA);
10707 transprofitsint[j] = transprofitsreal[j];
10708 itemsint[j] = items[j];
10712 transcapacityint = getIntegralVal(transcapacityreal, scalar, -
MINDELTA,
MAXDELTA);
10713 transcapacityint -= 1;
10716 transcapacityint = (
SCIP_Longint) (transcapacityreal * scalar);
10717 nflowcovervarsafterfix = *nflowcovervars;
10718 nnonflowcovervarsafterfix = *nnonflowcovervars;
10722 tmp2 = (
SCIP_Real) ((transcapacityint) + 1);
10723 if( transcapacityint * nitems <= MAXDYNPROGSPACE && tmp1 * tmp2 <= INT_MAX / 8.0)
10729 itemsint, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL, &success) );
10735 transcapacityreal, items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL) );
10737#if !defined(NDEBUG) || defined(SCIP_DEBUG)
10746 items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL) );
10754 items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL) );
10758 assert(nsolitems != -1);
10759 assert(nnonsolitems != -1);
10762 assert(*nflowcovervars + *nnonflowcovervars + nsolitems + nnonsolitems == snf->
ntransvars);
10764 nnonflowcovervars, flowcoverstatus,
QUAD(&flowcoverweight), lambda);
10774 items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL) );
10780 *nflowcovervars = nflowcovervarsafterfix;
10781 *nnonflowcovervars = nnonflowcovervarsafterfix;
10784 assert(*nflowcovervars + *nnonflowcovervars + nsolitems + nnonsolitems == snf->
ntransvars);
10786 nnonflowcovervars, flowcoverstatus,
QUAD(&flowcoverweight), lambda);
10796 SCIPdebugMsg(
scip,
"2. %s solution:\n", kpexact ?
"exact" :
"approximate");
10799 if( snf->
transvarcoefs[j] == 1 && flowcoverstatus[j] == 1 )
10803 else if( snf->
transvarcoefs[j] == -1 && flowcoverstatus[j] == 1 )
10836 int* nflowcovervars,
10837 int* nnonflowcovervars,
10838 int* flowcoverstatus,
10873 SCIPdebugMsg(
scip,
"--------------------- get flow cover ----------------------------------------------------\n");
10886 *nflowcovervars = 0;
10887 *nnonflowcovervars = 0;
10900 n1itemsweight = 0.0;
10911 flowcoverstatus[j] = -1;
10912 (*nnonflowcovervars)++;
10934 flowcoverstatus[j] = -1;
10935 (*nnonflowcovervars)++;
10941 flowcoverstatus[j] = 1;
10942 (*nflowcovervars)++;
10949 flowcoverstatus[j] = 1;
10950 (*nflowcovervars)++;
10958 flowcoverstatus[j] = -1;
10959 (*nnonflowcovervars)++;
10963 assert((*nflowcovervars) + (*nnonflowcovervars) + nitems == snf->
ntransvars);
10997 for( j = 0; j < nitems; j++ )
11004 SCIPdebugMsg(
scip,
" <%d>: j in N1: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
11005 items[j], transprofitsreal[j],
SCIPisIntegral(
scip, transweightsreal[j]) ?
"" :
" ----> NOT integral");
11010 SCIPdebugMsg(
scip,
" <%d>: j in N2: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
11011 items[j], transprofitsreal[j],
SCIPisIntegral(
scip, transweightsreal[j]) ?
"" :
" ----> NOT integral");
11016 SCIPdebugMsg(
scip,
" transcapacity = -rhs(%g) + flowcoverweight(%g) + n1itemsweight(%g) = %g\n",
11048 items, solitems, nonsolitems, &nsolitems, &nnonsolitems,
NULL) );
11050 assert(nsolitems != -1);
11051 assert(nnonsolitems != -1);
11054 assert(*nflowcovervars + *nnonflowcovervars + nsolitems + nnonsolitems == snf->
ntransvars);
11056 nnonflowcovervars, flowcoverstatus,
QUAD(&flowcoverweight), lambda);
11069 if( snf->
transvarcoefs[j] == 1 && flowcoverstatus[j] == 1 )
11073 else if( snf->
transvarcoefs[j] == -1 && flowcoverstatus[j] == 1 )
11112 xpluslambda =
x + liftingdata->
lambda;
11123 return i * liftingdata->
lambda;
11154 return i * liftingdata->
lambda;
11158 MAX(0.0, liftingdata->
m[
i] - (liftingdata->
mp - liftingdata->
lambda) - liftingdata->
ml)));
11195 vubcoefpluslambda = vubcoef + liftingdata->
lambda;
11204 assert(liftingdata->
M[
i] < vubcoefpluslambda);
11224 int* transvarflowcoverstatus,
11239 liftingdata->
m =
NULL;
11240 liftingdata->
M =
NULL;
11242 liftingdata->
t = 0;
11248 liftingdata->
r = 0;
11260 int s = (snf->
transvarcoefs[
i] + 1) + (transvarflowcoverstatus[
i] + 1)/2;
11326 for(
i = 0;
i < liftingdata->
r; ++
i)
11341 while( liftingdata->
t < liftingdata->
r && liftingdata->
m[liftingdata->
t] == liftingdata->
mp )
11344 liftingdata->
lambda = lambda;
11368 int* flowcoverstatus,
11387 assert( liftingdata.
r >= 0 );
11388 assert( liftingdata.
t >= 0 );
11448 if( liftedbincoef != 0.0 )
11553 for(
i = 0;
i < aggrrow->
nrows; ++
i )
11562 assert(slackcoef != 0.0);
11565 if( slackcoef > 0.0 )
11583 slackub = rowrhs - rowlhs;
11668 int *transvarflowcoverstatus;
11669 int nflowcovervars;
11670 int nnonflowcovervars;
11682 SCIP_CALL(
constructSNFRelaxation(
scip,
sol, boundswitch, allowlocal, aggrrow->
vals,
QUAD(aggrrow->rhs), aggrrow->
inds, aggrrow->
nnz, &snf, success, &localbdsused) );
11689 *cutislocal = aggrrow->
local || localbdsused;
11724 for(
i = 0;
i < *cutnnz; ++
i )
11726 int j = cutinds[
i];
11727 assert(tmpcoefs[j] != 0.0);
11728 cutcoefs[
i] = tmpcoefs[j];
11732 if( cutefficacy !=
NULL )
11735 if( cutrank !=
NULL )
11736 *cutrank = aggrrow->
rank + 1;
11741 for(
i = 0;
i < *cutnnz; ++
i )
11743 int j = cutinds[
i];
11744 assert(tmpcoefs[j] != 0.0);
11788 int aggrrowbinstart;
11789 int firstnonbinvar;
11816 int v = cutinds[
i];
11847 aggrrowbinstart =
i;
11850 for(
i = 0;
i < aggrrowbinstart; ++
i )
11853 int v = cutinds[
i];
11862 assert(
i == aggrrowbinstart);
11865 if( aggrrowbinstart != 0 )
11867 *nnz -= aggrrowbinstart;
11882 int v = cutinds[
i];
11886 assert(v < firstnonbinvar);
11906 *localbdsused = *localbdsused || (boundtype[
i] == -2);
11934 assert(boundtype[
i] == -1 || boundtype[
i] == -2);
11943 cutinds[
i] = cutinds[*nnz];
11988 for( k = 0; k < cutnnz; ++k )
11991 int v = cutinds[k];
11996 if( varsign[k] == -1 )
11997 solval = 1 - solval;
12002 coverpos[*coversize] = k;
12004 coverstatus[k] = 1;
12012 coverstatus[k] = 0;
12023 SCIPsortDownRealInt(covervals + (*coversize), coverpos + (*coversize), cutnnz - (*coversize));
12028 while( *coversize < cutnnz &&
12033 k = coverpos[*coversize];
12035 coverstatus[k] = 1;
12088 for( k = 1; k < coversize; ++k )
12134 for( k = 0; k < coversize; ++k )
12152 coverstatus[coverpos[k]] = -1;
12157 coverstatus[coverpos[k]] = -1;
12234 while(
h < coversize )
12249 covervals[
h], cutcoef);
12317 if( aggrrow->
nnz == 0 )
12320 for( k = 0; k < aggrrow->
nrows; ++k )
12338 nnz = aggrrow->
nnz;
12343 for( k = 0; k < nnz; ++k )
12346 int j = tmpinds[k];
12362 local = aggrrow->
local;
12364 tmpcoefs,
QUAD(&rhs), tmpinds, &nnz, varsign, boundtype, &local, &transformed) );
12366 assert(allowlocal || !local);
12375 coverpos, covervals, &coversize,
QUAD(&coverweight)) )
12384 if( coversize == 1 )
12389 for( k = 0; k < nnz; ++k )
12391 if( coverstatus[k] == 0 )
12397 tmpinds[0] = tmpinds[k];
12398 varsign[0] = varsign[k];
12403 if( varsign[0] == -1 )
12433 QUAD(coverweight), covervals, coverstatus,
QUAD(&abar), &cplussize);
12437 for( k = 0; k < nnz; )
12440 if( coverstatus[k] == -1 )
12448 SCIPdebugMsg(
scip,
"load QUAD(coef) from tmpcoefs[tmpinds[k] = %d]\n",tmpinds[k]);
12457 if( cutcoef == 0.0 )
12462 coverstatus[k] = coverstatus[nnz];
12463 tmpinds[k] = tmpinds[nnz];
12464 varsign[k] = varsign[nnz];
12470 if( varsign[k] == -1 )
12474 cutcoef = -cutcoef;
12497 *cutislocal = local;
12502 for( k = 0; k < nnz; ++k )
12505 int j = tmpinds[k];
12521 if( cutrank !=
NULL )
12522 *cutrank = aggrrow->
rank + 1;
12533 for( k = 0; k < nnz; ++k )
12541 if(tmpcoefs[k] != 0.0)
12627 *freevariable =
FALSE;
12628 *localbdsused =
FALSE;
12641 int cutindsstart = data->
ncutinds;
12642 int usevbds = data->
usevbds[s];
12649 int v = indices[
i];
12659 indices[
i] = indices[data->
secnnz[s]];
12674 bestlbs + cutindex, &simplelb, bestlbtypes + cutindex) );
12679 *freevariable =
TRUE;
12683 varsign[cutindex] = +1;
12694 bestubs + cutindex, &simpleub, bestubtypes + cutindex) );
12699 *freevariable =
TRUE;
12703 varsign[cutindex] = -1;
12719 bestlbs + cutindex, &simplelb, bestlbtypes + cutindex) );
12723 bestubs + cutindex, &simpleub, bestubtypes + cutindex) );
12729 if( lowerinf && upperinf )
12734 *freevariable =
TRUE;
12739 if( (positive && lowerinf) || (!positive && !upperinf) )
12741 varsign[cutindex] = -1;
12746 varsign[cutindex] = +1;
12754 NULL,
NULL, bestlbs + cutindex, bestubs + cutindex,
12755 bestlbtypes + cutindex, bestubtypes + cutindex, selectedbounds + cutindex, freevariable) );
12778 boundtype[
i] = bestlbtypes[
i];
12780 bestbnd = bestlbs[
i];
12787 boundtype[
i] = bestubtypes[
i];
12789 bestbnd = bestubs[
i];
12803 if( *freevariable )
12812 for( k = 0; k < data->
secnnz[j]; ++k )
12914 int nnz = data->
secnnz[s];
12919 for(
i = nnz - 1;
i >= 0 ; --
i )
12924 int v = indices[
i];
12930 sign = varsign[cutindex];
12931 assert(sign == +1 || sign == -1);
12932 type = boundtype[cutindex];
12942 if( enfintegral || implintegral )
12988 indices[
i] = indices[data->
secnnz[s]];
13078 ++data->
secnnz[zsection];
13095 int nnz = data->
secnnz[s];
13096 for(
i = 0;
i < nnz; ++
i )
13158 for(
i = 0;
i < nrowinds;
i++ )
13170 assert(slacksign[
i] == -1 || slacksign[
i] == +1);
13227 if( slacksign[
i] == +1 )
13286 int vartypeusevbds,
13335 for(
i = 0;
i < aggrrow->
nrows; ++
i )
13355 nnz = aggrrow->
nnz;
13368 data->
usevbds[l] = l < vartypeusevbds ? 2 : 0;
13391 for( l = 0; l < nnz; ++l )
13394 int m = aggrrow->
inds[l];
13407 for( l = 0; l < nnz; ++l )
13411 ++data->
secnnz[section];
13416 *cutislocal = aggrrow->
local;
13442 assert(allowlocal || !localbdsused);
13443 *cutislocal = *cutislocal || localbdsused;
13556 for(
i = 0;
i < *cutnnz; ++
i )
13570 if( cutefficacy !=
NULL )
13573 if( cutrank !=
NULL )
13574 *cutrank = aggrrow->
rank + 1;
13596 for(
int s =
NSECTIONS - 1; s >= 0; --s )
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)
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)
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)
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_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)
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)
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)
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)
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 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_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 (weighted) 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_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_AggrRow SCIP_AGGRROW
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