Skip to content

Commit c9175d4

Browse files
committed
Merge remote-tracking branch 'origin/v91-bugfix' into v9-minor
2 parents 70b3734 + dad857c commit c9175d4

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
@@ -62,6 +62,7 @@ Fixed bugs
6262
- fixed NULL pointer dereference in SCIPtpiGetNumThreads() of TinyCThread interface if called before SCIPtpiInit(); now returns 0 in this case
6363
- calling SCIPsolveConcurrent() when SCIP was compiled without a TPI now results in a plugin-not-found error
6464
- fixed LPI status functions of lpi_cpx if the barrier is called
65+
- check cuts for redundancy after scaling in cutTightenCoefs() and cutTightenCoefsQuad() of cuts.c
6566

6667
Performance improvements
6768
------------------------

src/scip/cuts.c

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,6 @@ SCIP_RETCODE cutTightenCoefsQuad(
905905
{
906906
/* if successful, apply the scaling */
907907
intscalar *= equiscale;
908-
909908
SCIPquadprecProdQD(*cutrhs, *cutrhs, intscalar);
910909

911910
for( i = 0; i < *cutnnz; )
@@ -978,18 +977,9 @@ SCIP_RETCODE cutTightenCoefsQuad(
978977
}
979978
}
980979

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

999989
/* perform the scaling */
1000990
SCIPquadprecProdQD(maxacttmp, maxacttmp, equiscale);
1001-
1002991
SCIPquadprecProdQD(*cutrhs, *cutrhs, equiscale);
1003992
maxabsintval *= equiscale;
1004993

@@ -1026,8 +1015,6 @@ SCIP_RETCODE cutTightenCoefsQuad(
10261015

10271016
/* perform the scaling */
10281017
SCIPquadprecProdQD(maxacttmp, maxacttmp, scale);
1029-
maxact = QUAD_TO_DBL(maxacttmp);
1030-
10311018
SCIPquadprecProdQD(*cutrhs, *cutrhs, scale);
10321019
maxabsintval *= scale;
10331020

@@ -1041,6 +1028,15 @@ SCIP_RETCODE cutTightenCoefsQuad(
10411028
}
10421029
}
10431030

1031+
maxact = QUAD_TO_DBL(maxacttmp);
1032+
1033+
/* check again for redundancy after scaling */
1034+
if( SCIPisFeasLE(scip, maxact, QUAD_TO_DBL(*cutrhs)) )
1035+
{
1036+
*redundant = TRUE;
1037+
return SCIP_OKAY;
1038+
}
1039+
10441040
/* no coefficient tightening can be performed since the precondition doesn't hold for any of the variables */
10451041
if( SCIPisGT(scip, maxact - maxabsintval, QUAD_TO_DBL(*cutrhs)) )
10461042
return SCIP_OKAY;
@@ -1284,7 +1280,6 @@ SCIP_RETCODE cutTightenCoefs(
12841280
{
12851281
/* if successful, apply the scaling */
12861282
intscalar *= equiscale;
1287-
12881283
SCIPquadprecProdQD(*cutrhs, *cutrhs, intscalar);
12891284

12901285
for( i = 0; i < *cutnnz; )
@@ -1354,18 +1349,9 @@ SCIP_RETCODE cutTightenCoefs(
13541349
}
13551350
}
13561351

1357-
maxact = QUAD_TO_DBL(maxacttmp);
1358-
1359-
assert(EPSISINT(maxact, 1e-4));
1360-
maxact = SCIPround(scip, maxact);
1361-
QUAD_ASSIGN(maxacttmp, maxact);
1362-
1363-
/* check again for redundancy */
1364-
if( SCIPisFeasLE(scip, maxact, QUAD_TO_DBL(*cutrhs)) )
1365-
{
1366-
*redundant = TRUE;
1367-
return SCIP_OKAY;
1368-
}
1352+
assert(EPSISINT(QUAD_TO_DBL(maxacttmp), 1e-4));
1353+
SCIPquadprecSumQD(maxacttmp, maxacttmp, 0.5);
1354+
SCIPquadprecFloorQ(maxacttmp, maxacttmp);
13691355
}
13701356
else
13711357
{
@@ -1374,7 +1360,6 @@ SCIP_RETCODE cutTightenCoefs(
13741360

13751361
/* perform the scaling */
13761362
SCIPquadprecProdQD(maxacttmp, maxacttmp, equiscale);
1377-
13781363
SCIPquadprecProdQD(*cutrhs, *cutrhs, equiscale);
13791364
maxabsintval *= equiscale;
13801365

@@ -1396,15 +1381,22 @@ SCIP_RETCODE cutTightenCoefs(
13961381

13971382
/* perform the scaling */
13981383
SCIPquadprecProdQD(maxacttmp, maxacttmp, scale);
1399-
maxact = QUAD_TO_DBL(maxacttmp);
1400-
14011384
SCIPquadprecProdQD(*cutrhs, *cutrhs, scale);
14021385
maxabsintval *= scale;
14031386

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

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

0 commit comments

Comments
 (0)