@@ -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]" ) {
@@ -784,6 +801,28 @@ void distillationMIP(Highs& highs) {
784801}
785802
786803void rowlessMIP (Highs& highs) {
804+ HighsLp lp;
805+ HighsModelStatus require_model_status;
806+ double optimal_objective;
807+ lp.num_col_ = 2 ;
808+ lp.num_row_ = 0 ;
809+ lp.col_cost_ = {1 , -1 };
810+ lp.col_lower_ = {0 , 0 };
811+ lp.col_upper_ = {1 , 1 };
812+ lp.a_matrix_ .start_ = {0 , 0 , 0 };
813+ lp.a_matrix_ .format_ = MatrixFormat::kColwise ;
814+ lp.sense_ = ObjSense::kMinimize ;
815+ lp.offset_ = 0 ;
816+ lp.integrality_ = {HighsVarType::kInteger , HighsVarType::kInteger };
817+ require_model_status = HighsModelStatus::kOptimal ;
818+ optimal_objective = -1.0 ;
819+ REQUIRE (highs.passModel (lp) == HighsStatus::kOk );
820+ // Presolve reduces the LP to empty
821+ solve (highs, kHighsOnString , require_model_status, optimal_objective);
822+ solve (highs, kHighsOffString , require_model_status, optimal_objective);
823+ }
824+
825+ void rowlessMIP1 (Highs& highs) {
787826 HighsLp lp;
788827 HighsModelStatus require_model_status;
789828 double optimal_objective;
@@ -805,17 +844,40 @@ void rowlessMIP(Highs& highs) {
805844 // solve(highs, kHighsOffString, require_model_status, optimal_objective);
806845}
807846
808- // TEST_CASE("issue-2122", "[highs_test_mip_solver]") {
809- // std::string filename = std::string(HIGHS_DIR) + "/check/instances/2122.lp";
810- // Highs highs;
811- // highs.setOptionValue("output_flag", dev_run);
812- // highs.setOptionValue("mip_rel_gap", 0);
813- // highs.setOptionValue("mip_abs_gap", 0);
814- // highs.readModel(filename);
815- // const HighsModelStatus require_model_status = HighsModelStatus::kOptimal;
816- // const double optimal_objective = -187612.944194;
817- // solve(highs, kHighsOnString, require_model_status, optimal_objective);
818- // }
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+
870+ TEST_CASE (" issue-2122" , " [highs_test_mip_solver]" ) {
871+ std::string filename = std::string (HIGHS_DIR) + " /check/instances/2122.lp" ;
872+ Highs highs;
873+ highs.setOptionValue (" output_flag" , dev_run);
874+ highs.setOptionValue (" mip_rel_gap" , 0 );
875+ highs.setOptionValue (" mip_abs_gap" , 0 );
876+ highs.readModel (filename);
877+ const HighsModelStatus require_model_status = HighsModelStatus::kOptimal ;
878+ const double optimal_objective = -187612.944194 ;
879+ solve (highs, kHighsOnString , require_model_status, optimal_objective);
880+ }
819881
820882TEST_CASE (" issue-2171" , " [highs_test_mip_solver]" ) {
821883 std::string filename = std::string (HIGHS_DIR) + " /check/instances/2171.mps" ;
0 commit comments