Skip to content

Commit 0a84909

Browse files
authored
Merge pull request #2831 from ERGO-Code/fix-2084
Unite test for #2084
2 parents 2a53ae8 + 998b217 commit 0a84909

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

check/TestMipSolver.cpp

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,58 @@ TEST_CASE("IP-with-fract-bounds-no-presolve", "[highs_test_mip_solver]") {
789789
highs.resetGlobalScheduler(true);
790790
}
791791

792+
/*
793+
TEST_CASE("MIP-2084", "[highs_test_mip_solver]") {
794+
// To be used to debug #2084
795+
Highs h;
796+
// No presolve
797+
h.setOptionValue("output_flag", dev_run);
798+
799+
// Minimize
800+
// 3x + y
801+
// Subject to
802+
// 47x + 19y = 10000000002226
803+
// 23x + 57y = 10000000013254
804+
// General
805+
// x y
806+
// End
807+
808+
HighsLp lp;
809+
lp.num_col_ = 2;
810+
lp.num_row_ = 2;
811+
lp.col_cost_ = {3, 1};
812+
lp.col_lower_ = {0, 0};
813+
lp.col_upper_ = {kHighsInf, kHighsInf};
814+
lp.integrality_ = {HighsVarType::kInteger, HighsVarType::kInteger};
815+
lp.row_lower_ = {10000000002226, 10000000013254};
816+
lp.row_upper_ = {10000000002226, 10000000013254};
817+
lp.a_matrix_.start_ = {0, 2, 4};
818+
lp.a_matrix_.index_ = {0, 1, 0, 1};
819+
lp.a_matrix_.value_ = {47, 23, 19, 57};
820+
821+
// Solve
822+
h.passModel(lp);
823+
h.setOptionValue("presolve", "off");
824+
h.run();
825+
HighsModelStatus require_model_status = h.getModelStatus();
826+
if (dev_run)
827+
printf("Solution is [%24.18g, %24.18g] with status %s\n",
828+
h.getSolution().col_value[0], h.getSolution().col_value[1],
829+
h.modelStatusToString(require_model_status).c_str());
830+
831+
h.clearSolver();
832+
833+
h.setOptionValue("presolve", "on");
834+
h.run();
835+
HighsModelStatus model_status = h.getModelStatus();
836+
if (dev_run)
837+
printf("Solution is [%24.18g, %24.18g] with status %s\n",
838+
h.getSolution().col_value[0], h.getSolution().col_value[1],
839+
h.modelStatusToString(model_status).c_str());
840+
REQUIRE(model_status == require_model_status);
841+
}
842+
*/
843+
792844
bool objectiveOk(const double optimal_objective,
793845
const double require_optimal_objective, const bool dev_run) {
794846
double error = std::fabs(optimal_objective - require_optimal_objective) /

0 commit comments

Comments
 (0)