Skip to content

Commit bf28f6a

Browse files
committed
Update tolerances
1 parent 8c54b3e commit bf28f6a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

highs/mip/HighsCutGeneration.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,9 @@ bool HighsCutGeneration::cmirCutGenerationHeuristic(double minEfficacy,
704704
double f0 = scalrhs - downrhs;
705705
double oneoveroneminusf0 = 1.0 / (1.0 - f0);
706706
// Skip numerically troublesome cuts
707-
double k = fast_ceil((1 / f0) - epsilon) - 1;
708-
double checkk = fast_ceil((1 / f0) + epsilon) - 1;
709-
if (checkk - k > 0.5) {
707+
double oneoverf0 = 1 / f0;
708+
double k = fast_ceil(oneoverf0) - 1;
709+
if (oneoverf0 - k < 1e-3 || oneoverf0 - k > 1 - 1e-3) {
710710
strongcg = false;
711711
} else {
712712
// All coefficients of continuous variables are 0 in strong CG cut
@@ -717,12 +717,12 @@ bool HighsCutGeneration::cmirCutGenerationHeuristic(double minEfficacy,
717717
double scalaj = vals[j] * scale;
718718
double downaj = fast_floor(scalaj + kHighsTiny);
719719
double fj = scalaj - downaj;
720-
if (fj <= f0 + 1e-6) {
720+
if (fj <= f0 + feastol) {
721721
double aj = downaj;
722722
updateViolationAndNorm(j, aj, viol, sqrnorm);
723723
} else {
724724
double pj =
725-
fast_ceil(k * (fj - f0) * oneoveroneminusf0 - (10 * epsilon));
725+
fast_ceil(k * (fj - f0) * oneoveroneminusf0 - feastol);
726726
double aj = downaj + (pj / (k + 1));
727727
updateViolationAndNorm(j, aj, viol, sqrnorm);
728728
}
@@ -732,7 +732,7 @@ bool HighsCutGeneration::cmirCutGenerationHeuristic(double minEfficacy,
732732
} else {
733733
double efficacy = viol / sqrt(sqrnorm);
734734
// Use the strong CG cut instead of the CMIR if efficacy is larger
735-
if (efficacy < bestefficacy + 1e-6) {
735+
if (efficacy < bestefficacy + epsilon) {
736736
strongcg = false;
737737
} else {
738738
bestefficacy = efficacy;

0 commit comments

Comments
 (0)