| 7 | const bool dev_run = false; |
| 8 | |
| 9 | void testDualObjective(const std::string model) { |
| 10 | HighsStatus return_status; |
| 11 | |
| 12 | Highs highs; |
| 13 | highs.setOptionValue("output_flag", dev_run); |
| 14 | std::string model_file = |
| 15 | std::string(HIGHS_DIR) + "/check/instances/" + model + ".mps"; |
| 16 | highs.readModel(model_file); |
| 17 | return_status = highs.run(); |
| 18 | REQUIRE(return_status == HighsStatus::kOk); |
| 19 | double dual_objective; |
| 20 | return_status = highs.getDualObjectiveValue(dual_objective); |
| 21 | REQUIRE(return_status == HighsStatus::kOk); |
| 22 | double primal_objective = highs.getInfo().objective_function_value; |
| 23 | double relative_primal_dual_gap = |
| 24 | std::fabs(primal_objective - dual_objective) / |
| 25 | std::max(1.0, std::fabs(primal_objective)); |
| 26 | REQUIRE(relative_primal_dual_gap < 1e-12); |
| 27 | |
| 28 | highs.resetGlobalScheduler(true); |
| 29 | } |
| 30 | |
| 31 | TEST_CASE("mip-with-lp-solver", "[highs_lp_solver]") { |
| 32 | // When solving the relaxation of a MIP. Exposed #1406 |
no test coverage detected