Skip to content

Commit

Permalink
Investigating
Browse files Browse the repository at this point in the history
  • Loading branch information
jajhall committed Nov 15, 2024
1 parent cccb716 commit 258c74c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion check/TestCheckSolution.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//#include <cstdio>
// #include <cstdio>
#include <iostream>

#include "HCheckConfig.h"
Expand Down
1 change: 1 addition & 0 deletions check/TestHighsIntegers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ TEST_CASE("HighsIntegers", "[util]") {
TEST_CASE("HighsCdouble-ceil", "[util]") {
// For fix-2041
HighsCDouble a = 1e-23;
a = 1e-12;
double ceil_a;
double double_a;
ceil_a = double(ceil(a));
Expand Down
8 changes: 4 additions & 4 deletions check/TestMipSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,16 +679,16 @@ TEST_CASE("IP-infeasible-unbounded", "[highs_test_mip_solver]") {
highs.run();
HighsModelStatus required_model_status;
if (k == 0) {
// Presolve off
// Presolve off
if (l == 0) {
// MIP solver proves infeasiblilty
// MIP solver proves infeasiblilty
required_model_status = HighsModelStatus::kInfeasible;
} else {
// Relaxation is unbounded, but origin is feasible
// Relaxation is unbounded, but origin is feasible
required_model_status = HighsModelStatus::kUnbounded;
}
} else {
// Presolve on, and identifies primal infeasible or unbounded
// Presolve on, and identifies primal infeasible or unbounded
required_model_status = HighsModelStatus::kUnboundedOrInfeasible;
}
REQUIRE(highs.getModelStatus() == required_model_status);
Expand Down
9 changes: 8 additions & 1 deletion src/util/HighsCDouble.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,14 @@ class HighsCDouble {
double ceil_x = std::ceil(double(x));
HighsCDouble res;

two_sum(res.hi, res.lo, ceil_x, std::ceil(double(x - ceil_x)));
HighsCDouble x_m_ceil_x = x - ceil_x;
double double_x_m_ceil_x = double(x_m_ceil_x);
double ceil_double_x_m_ceil_x = std::ceil(double_x_m_ceil_x);
HighsCDouble local_res;

two_sum(local_res.hi, local_res.lo, ceil_x, ceil_double_x_m_ceil_x);
res = local_res;
// two_sum(res.hi, res.lo, ceil_x, std::ceil(double(x - ceil_x)));
return res;
}

Expand Down

0 comments on commit 258c74c

Please sign in to comment.