@@ -1123,24 +1123,25 @@ TEST_CASE("mip-sub-solver-time", "[highs_test_mip_solver]") {
11231123 REQUIRE (h.getModelStatus () == HighsModelStatus::kOptimal );
11241124}
11251125
1126- void getFixedLpRun (Highs& h,
1127- const std::string& message,
1128- const HighsModelStatus required_model_status,
1129- const bool output_flag) {
1126+ void getFixedLpRun (Highs& h, const std::string& message,
1127+ const HighsModelStatus required_model_status,
1128+ const bool output_flag) {
11301129 h.setOptionValue (" output_flag" , output_flag);
1131- std:string presolve;
1130+ std:
1131+ string presolve;
11321132 h.getOptionValue (" presolve" , presolve);
11331133 if (output_flag)
1134- printf (" \n ============================================================"
1135- " \n %s: presolve = %s"
1136- " \n ============================================================\n " ,
1137- message.c_str (), presolve.c_str ());
1134+ printf (
1135+ " \n ============================================================"
1136+ " \n %s: presolve = %s"
1137+ " \n ============================================================\n " ,
1138+ message.c_str (), presolve.c_str ());
11381139 REQUIRE (h.run () == HighsStatus::kOk );
11391140 REQUIRE (h.getModelStatus () == required_model_status);
11401141 if (output_flag)
11411142 printf (" \n Simplex iteration count = %d\n " ,
1142- int (h.getInfo ().simplex_iteration_count ));
1143- h.setOptionValue (" output_flag" , dev_run);
1143+ int (h.getInfo ().simplex_iteration_count ));
1144+ h.setOptionValue (" output_flag" , dev_run);
11441145}
11451146
11461147TEST_CASE (" get-fixed-lp" , " [highs_test_mip_solver]" ) {
@@ -1163,9 +1164,8 @@ TEST_CASE("get-fixed-lp", "[highs_test_mip_solver]") {
11631164 REQUIRE (h.readModel (model_file) == HighsStatus::kOk );
11641165 REQUIRE (h.getFixedLp (fixed_lp) == HighsStatus::kError );
11651166
1166- getFixedLpRun (h, " Solving the original MIP" ,
1167- HighsModelStatus::kOptimal ,
1168- output_flag);
1167+ getFixedLpRun (h, " Solving the original MIP" , HighsModelStatus::kOptimal ,
1168+ output_flag);
11691169 double mip_optimal_objective = h.getInfo ().objective_function_value ;
11701170 HighsSolution solution = h.getSolution ();
11711171
@@ -1184,10 +1184,9 @@ TEST_CASE("get-fixed-lp", "[highs_test_mip_solver]") {
11841184 h.changeColsBounds (num_set_entries, col_set.data (), fixed_value.data (),
11851185 fixed_value.data ());
11861186 h.setOptionValue (" presolve" , kHighsOffString );
1187- getFixedLpRun (h,
1188- " Solving the externally fixed LP using the MIP solution as retained" ,
1189- HighsModelStatus::kOptimal ,
1190- output_flag);
1187+ getFixedLpRun (
1188+ h, " Solving the externally fixed LP using the MIP solution as retained" ,
1189+ HighsModelStatus::kOptimal , output_flag);
11911190 REQUIRE (objectiveOk (mip_optimal_objective,
11921191 h.getInfo ().objective_function_value , dev_run));
11931192 // In calling changeColsBounds, the incumbent solution was always
@@ -1206,51 +1205,42 @@ TEST_CASE("get-fixed-lp", "[highs_test_mip_solver]") {
12061205 // optimal, so no simplex iterations are required
12071206 h.clearSolver ();
12081207 h.setSolution (solution);
1209- getFixedLpRun (h,
1210- " Solving the externally fixed LP using the MIP solution as passed" ,
1211- HighsModelStatus::kOptimal ,
1212- output_flag);
1208+ getFixedLpRun (
1209+ h, " Solving the externally fixed LP using the MIP solution as passed" ,
1210+ HighsModelStatus::kOptimal , output_flag);
12131211 REQUIRE (objectiveOk (mip_optimal_objective,
12141212 h.getInfo ().objective_function_value , dev_run));
12151213 REQUIRE (h.getInfo ().simplex_iteration_count == 0 );
12161214
12171215 // Now re-load the MIP, re-solve, and get the fixed LP
12181216 REQUIRE (h.passModel (mip) == HighsStatus::kOk );
1219- getFixedLpRun (h,
1220- " Solving the original MIP" ,
1221- HighsModelStatus::kOptimal ,
1222- false );
1217+ getFixedLpRun (h, " Solving the original MIP" , HighsModelStatus::kOptimal ,
1218+ false );
12231219 REQUIRE (objectiveOk (mip_optimal_objective,
12241220 h.getInfo ().objective_function_value , dev_run));
12251221
12261222 // Get the fixed LP
12271223 REQUIRE (h.getFixedLp (fixed_lp) == HighsStatus::kOk );
12281224
12291225 REQUIRE (h.passModel (fixed_lp) == HighsStatus::kOk );
1230- getFixedLpRun (h,
1231- " Solving the extracted fixed LP from a logical basis" ,
1232- HighsModelStatus::kOptimal ,
1233- output_flag);
1226+ getFixedLpRun (h, " Solving the extracted fixed LP from a logical basis" ,
1227+ HighsModelStatus::kOptimal , output_flag);
12341228 REQUIRE (objectiveOk (mip_optimal_objective,
12351229 h.getInfo ().objective_function_value , dev_run));
12361230
12371231 h.clearSolver ();
12381232 h.setOptionValue (" presolve" , kHighsOnString );
1239- getFixedLpRun (h,
1240- " Solving the extracted fixed LP from a logical basis" ,
1241- HighsModelStatus::kOptimal ,
1242- output_flag);
1233+ getFixedLpRun (h, " Solving the extracted fixed LP from a logical basis" ,
1234+ HighsModelStatus::kOptimal , output_flag);
12431235 REQUIRE (objectiveOk (mip_optimal_objective,
12441236 h.getInfo ().objective_function_value , dev_run));
12451237 h.setOptionValue (" presolve" , kHighsOffString );
12461238
12471239 // Now run from saved solution (without presolve)
12481240 h.clearSolver ();
12491241 h.setSolution (solution);
1250- getFixedLpRun (h,
1251- " Solving the extracted fixed LP with saved solution" ,
1252- HighsModelStatus::kOptimal ,
1253- output_flag);
1242+ getFixedLpRun (h, " Solving the extracted fixed LP with saved solution" ,
1243+ HighsModelStatus::kOptimal , output_flag);
12541244 REQUIRE (objectiveOk (mip_optimal_objective,
12551245 h.getInfo ().objective_function_value , dev_run));
12561246 REQUIRE (h.getInfo ().simplex_iteration_count == 0 );
@@ -1262,21 +1252,17 @@ TEST_CASE("get-fixed-lp", "[highs_test_mip_solver]") {
12621252 std::vector<HighsVarType> integrality = h.getLp ().integrality_ ;
12631253 for (HighsInt iCol = 0 ; iCol < fixed_lp.num_col_ ; iCol++) {
12641254 if (integrality[iCol] != HighsVarType::kContinuous ) {
1265- solution.col_value [iCol] -= 0.01 ;
1266- break ;
1255+ solution.col_value [iCol] -= 0.01 ;
1256+ break ;
12671257 }
12681258 }
1269- getFixedLpRun (h,
1270- " Solving the original MIP so solution can be set" ,
1271- HighsModelStatus::kOptimal ,
1272- false );
1259+ getFixedLpRun (h, " Solving the original MIP so solution can be set" ,
1260+ HighsModelStatus::kOptimal , false );
12731261 h.setSolution (solution);
12741262 REQUIRE (h.getFixedLp (fixed_lp) == HighsStatus::kWarning );
12751263 REQUIRE (h.passModel (fixed_lp) == HighsStatus::kOk );
1276- getFixedLpRun (h,
1277- " Solving the extracted LP fixed to be infeasible" ,
1278- HighsModelStatus::kInfeasible ,
1279- output_flag);
1264+ getFixedLpRun (h, " Solving the extracted LP fixed to be infeasible" ,
1265+ HighsModelStatus::kInfeasible , output_flag);
12801266 REQUIRE (h.getModelStatus () == HighsModelStatus::kInfeasible );
12811267 }
12821268
0 commit comments