Skip to content

Commit 3ec4a8e

Browse files
committed
Merge remote-tracking branch 'origin/v9-minor'
2 parents 6bd0ccb + c9175d4 commit 3ec4a8e

File tree

2 files changed

+25
-32
lines changed

2 files changed

+25
-32
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ Fixed bugs
144144
- fixed NULL pointer dereference in SCIPtpiGetNumThreads() of TinyCThread interface if called before SCIPtpiInit(); now returns 0 in this case
145145
- calling SCIPsolveConcurrent() when SCIP was compiled without a TPI now results in a plugin-not-found error
146146
- fixed LPI status functions of lpi_cpx if the barrier is called
147+
- check cuts for redundancy after scaling in cutTightenCoefs() and cutTightenCoefsQuad() of cuts.c
147148

148149
Performance improvements
149150
------------------------

src/scip/cuts.c

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,6 @@ SCIP_RETCODE cutTightenCoefsQuad(
907907
{
908908
/* if successful, apply the scaling */
909909
intscalar *= equiscale;
910-
911910
SCIPquadprecProdQD(*cutrhs, *cutrhs, intscalar);
912911

913912
for( i = 0; i < *cutnnz; )
@@ -980,18 +979,9 @@ SCIP_RETCODE cutTightenCoefsQuad(
980979
}
981980
}
982981

983-
maxact = QUAD_TO_DBL(maxacttmp);
984-
985-
assert(EPSISINT(maxact, 1e-4));
986-
maxact = SCIPround(scip, maxact);
987-
QUAD_ASSIGN(maxacttmp, maxact);
988-
989-
/* check again for redundancy */
990-
if( SCIPisFeasLE(scip, maxact, QUAD_TO_DBL(*cutrhs)) )
991-
{
992-
*redundant = TRUE;
993-
return SCIP_OKAY;
994-
}
982+
assert(EPSISINT(QUAD_TO_DBL(maxacttmp), 1e-4));
983+
SCIPquadprecSumQD(maxacttmp, maxacttmp, 0.5);
984+
SCIPquadprecFloorQ(maxacttmp, maxacttmp);
995985
}
996986
else
997987
{
@@ -1000,7 +990,6 @@ SCIP_RETCODE cutTightenCoefsQuad(
1000990

1001991
/* perform the scaling */
1002992
SCIPquadprecProdQD(maxacttmp, maxacttmp, equiscale);
1003-
1004993
SCIPquadprecProdQD(*cutrhs, *cutrhs, equiscale);
1005994
maxabsintval *= equiscale;
1006995

@@ -1028,8 +1017,6 @@ SCIP_RETCODE cutTightenCoefsQuad(
10281017

10291018
/* perform the scaling */
10301019
SCIPquadprecProdQD(maxacttmp, maxacttmp, scale);
1031-
maxact = QUAD_TO_DBL(maxacttmp);
1032-
10331020
SCIPquadprecProdQD(*cutrhs, *cutrhs, scale);
10341021
maxabsintval *= scale;
10351022

@@ -1043,6 +1030,15 @@ SCIP_RETCODE cutTightenCoefsQuad(
10431030
}
10441031
}
10451032

1033+
maxact = QUAD_TO_DBL(maxacttmp);
1034+
1035+
/* check again for redundancy after scaling */
1036+
if( SCIPisFeasLE(scip, maxact, QUAD_TO_DBL(*cutrhs)) )
1037+
{
1038+
*redundant = TRUE;
1039+
return SCIP_OKAY;
1040+
}
1041+
10461042
/* no coefficient tightening can be performed since the precondition doesn't hold for any of the variables */
10471043
if( SCIPisGT(scip, maxact - maxabsintval, QUAD_TO_DBL(*cutrhs)) )
10481044
return SCIP_OKAY;
@@ -1286,7 +1282,6 @@ SCIP_RETCODE cutTightenCoefs(
12861282
{
12871283
/* if successful, apply the scaling */
12881284
intscalar *= equiscale;
1289-
12901285
SCIPquadprecProdQD(*cutrhs, *cutrhs, intscalar);
12911286

12921287
for( i = 0; i < *cutnnz; )
@@ -1356,18 +1351,9 @@ SCIP_RETCODE cutTightenCoefs(
13561351
}
13571352
}
13581353

1359-
maxact = QUAD_TO_DBL(maxacttmp);
1360-
1361-
assert(EPSISINT(maxact, 1e-4));
1362-
maxact = SCIPround(scip, maxact);
1363-
QUAD_ASSIGN(maxacttmp, maxact);
1364-
1365-
/* check again for redundancy */
1366-
if( SCIPisFeasLE(scip, maxact, QUAD_TO_DBL(*cutrhs)) )
1367-
{
1368-
*redundant = TRUE;
1369-
return SCIP_OKAY;
1370-
}
1354+
assert(EPSISINT(QUAD_TO_DBL(maxacttmp), 1e-4));
1355+
SCIPquadprecSumQD(maxacttmp, maxacttmp, 0.5);
1356+
SCIPquadprecFloorQ(maxacttmp, maxacttmp);
13711357
}
13721358
else
13731359
{
@@ -1376,7 +1362,6 @@ SCIP_RETCODE cutTightenCoefs(
13761362

13771363
/* perform the scaling */
13781364
SCIPquadprecProdQD(maxacttmp, maxacttmp, equiscale);
1379-
13801365
SCIPquadprecProdQD(*cutrhs, *cutrhs, equiscale);
13811366
maxabsintval *= equiscale;
13821367

@@ -1398,15 +1383,22 @@ SCIP_RETCODE cutTightenCoefs(
13981383

13991384
/* perform the scaling */
14001385
SCIPquadprecProdQD(maxacttmp, maxacttmp, scale);
1401-
maxact = QUAD_TO_DBL(maxacttmp);
1402-
14031386
SCIPquadprecProdQD(*cutrhs, *cutrhs, scale);
14041387
maxabsintval *= scale;
14051388

14061389
for( i = 0; i < *cutnnz; ++i )
14071390
cutcoefs[cutinds[i]] *= scale;
14081391
}
14091392

1393+
maxact = QUAD_TO_DBL(maxacttmp);
1394+
1395+
/* check again for redundancy after scaling */
1396+
if( SCIPisFeasLE(scip, maxact, QUAD_TO_DBL(*cutrhs)) )
1397+
{
1398+
*redundant = TRUE;
1399+
return SCIP_OKAY;
1400+
}
1401+
14101402
/* no coefficient tightening can be performed since the precondition doesn't hold for any of the variables */
14111403
if( SCIPisGT(scip, maxact - maxabsintval, QUAD_TO_DBL(*cutrhs)) )
14121404
return SCIP_OKAY;

0 commit comments

Comments
 (0)