@@ -16,6 +16,8 @@ void solve(Highs& highs, std::string presolve,
1616 const double require_iteration_count = -1 );
1717void distillationMIP (Highs& highs);
1818void rowlessMIP (Highs& highs);
19+ void rowlessMIP1 (Highs& highs);
20+ void rowlessMIP2 (Highs& highs);
1921
2022TEST_CASE (" MIP-distillation" , " [highs_test_mip_solver]" ) {
2123 Highs highs;
@@ -25,10 +27,25 @@ TEST_CASE("MIP-distillation", "[highs_test_mip_solver]") {
2527 highs.resetGlobalScheduler (true );
2628}
2729
28- TEST_CASE (" MIP-rowless" , " [highs_test_mip_solver]" ) {
30+ // Fails but the cases work separately in
31+ // MIP-rowless-1 and
32+ // MIP-rowless-2 below
33+ // TEST_CASE("MIP-rowless", "[highs_test_mip_solver]") {
34+ // Highs highs;
35+ // if (!dev_run) highs.setOptionValue("output_flag", false);
36+ // rowlessMIP(highs);
37+ // }
38+
39+ TEST_CASE (" MIP-rowless-1" , " [highs_test_mip_solver]" ) {
40+ Highs highs;
41+ if (!dev_run) highs.setOptionValue (" output_flag" , false );
42+ rowlessMIP1 (highs);
43+ }
44+
45+ TEST_CASE (" MIP-rowless-2" , " [highs_test_mip_solver]" ) {
2946 Highs highs;
3047 if (!dev_run) highs.setOptionValue (" output_flag" , false );
31- rowlessMIP (highs);
48+ rowlessMIP2 (highs);
3249}
3350
3451TEST_CASE (" MIP-solution-limit" , " [highs_test_mip_solver]" ) {
@@ -805,6 +822,51 @@ void rowlessMIP(Highs& highs) {
805822 solve (highs, kHighsOffString , require_model_status, optimal_objective);
806823}
807824
825+ void rowlessMIP1 (Highs& highs) {
826+ HighsLp lp;
827+ HighsModelStatus require_model_status;
828+ double optimal_objective;
829+ lp.num_col_ = 2 ;
830+ lp.num_row_ = 0 ;
831+ lp.col_cost_ = {1 , -1 };
832+ lp.col_lower_ = {0 , 0 };
833+ lp.col_upper_ = {1 , 1 };
834+ lp.a_matrix_ .start_ = {0 , 0 , 0 };
835+ lp.a_matrix_ .format_ = MatrixFormat::kColwise ;
836+ lp.sense_ = ObjSense::kMinimize ;
837+ lp.offset_ = 0 ;
838+ lp.integrality_ = {HighsVarType::kInteger , HighsVarType::kInteger };
839+ require_model_status = HighsModelStatus::kOptimal ;
840+ optimal_objective = -1.0 ;
841+ REQUIRE (highs.passModel (lp) == HighsStatus::kOk );
842+ // Presolve reduces the LP to empty
843+ solve (highs, kHighsOnString , require_model_status, optimal_objective);
844+ // solve(highs, kHighsOffString, require_model_status, optimal_objective);
845+ }
846+
847+
848+ void rowlessMIP2 (Highs& highs) {
849+ HighsLp lp;
850+ HighsModelStatus require_model_status;
851+ double optimal_objective;
852+ lp.num_col_ = 2 ;
853+ lp.num_row_ = 0 ;
854+ lp.col_cost_ = {1 , -1 };
855+ lp.col_lower_ = {0 , 0 };
856+ lp.col_upper_ = {1 , 1 };
857+ lp.a_matrix_ .start_ = {0 , 0 , 0 };
858+ lp.a_matrix_ .format_ = MatrixFormat::kColwise ;
859+ lp.sense_ = ObjSense::kMinimize ;
860+ lp.offset_ = 0 ;
861+ lp.integrality_ = {HighsVarType::kInteger , HighsVarType::kInteger };
862+ require_model_status = HighsModelStatus::kOptimal ;
863+ optimal_objective = -1.0 ;
864+ REQUIRE (highs.passModel (lp) == HighsStatus::kOk );
865+ // Presolve reduces the LP to empty
866+ // solve(highs, kHighsOnString, require_model_status, optimal_objective);
867+ solve (highs, kHighsOffString , require_model_status, optimal_objective);
868+ }
869+
808870TEST_CASE (" issue-2122" , " [highs_test_mip_solver]" ) {
809871 std::string filename = std::string (HIGHS_DIR) + " /check/instances/2122.lp" ;
810872 Highs highs;
0 commit comments