@@ -57,24 +57,41 @@ void testPrimalDualObjective(Highs& h,
5757 REQUIRE (fabs (info.primal_dual_objective_error ) < optimality_tolerance);
5858}
5959
60- /*
6160TEST_CASE (" qp-unbounded" , " [qpsolver]" ) {
6261 std::string filename;
6362 filename = std::string (HIGHS_DIR ) + " /check/instances/qpunbounded.lp" ;
64-
63+ // Maximize
64+ // obj: x2 + [ - x1^2 ]/2
65+ // Bounds
66+ // 0 <= x1 <= 40
67+ // End
6568 Highs highs;
6669 highs.setOptionValue (" output_flag" , dev_run);
6770 REQUIRE (highs.readModel (filename) == HighsStatus::kOk );
6871
69- for (auto& solver : solvers) {
70- highs.setOptionValue("solver", solver);
71- REQUIRE(highs.run() == HighsStatus::kOk);
72- REQUIRE(highs.getModelStatus() == unboundedStatus(solver));
72+ for (HighsInt k = 0 ; k < 2 ; k++) {
73+ for (auto & solver : solvers) {
74+ highs.setOptionValue (" solver" , solver);
75+ REQUIRE (highs.run () == HighsStatus::kOk );
76+ REQUIRE (highs.getModelStatus () == unboundedStatus (solver));
77+ // Test the oracle Hessian
78+ highs.setOptionValue (" test_qp_oracle" , true );
79+ REQUIRE (highs.run () == HighsStatus::kOk );
80+ REQUIRE (highs.getModelStatus () == unboundedStatus (solver));
81+ highs.setOptionValue (" test_qp_oracle" , false );
82+ }
83+ // Now flip the cost and bounds of x2 (which has index 0 since it
84+ // appears first in LP file objective) for code coverage
85+ REQUIRE (highs.changeColCost (0 , -highs.getLp ().col_cost_ [0 ]) ==
86+ HighsStatus::kOk );
87+ REQUIRE (highs.changeColBounds (0 , -highs.getLp ().col_upper_ [0 ],
88+ -highs.getLp ().col_lower_ [0 ]) ==
89+ HighsStatus::kOk );
90+ highs.clearSolver ();
7391 }
7492
7593 highs.resetGlobalScheduler (true );
7694}
77- */
7895
7996TEST_CASE (" qp-infeasible" , " [qpsolver]" ) {
8097 std::string filename;
@@ -216,7 +233,6 @@ TEST_CASE("qpsolver", "[qpsolver]") {
216233 highs.resetGlobalScheduler (true );
217234}
218235
219- /*
220236TEST_CASE (" test-qod" , " [qpsolver]" ) {
221237 HighsStatus return_status;
222238 HighsModelStatus model_status;
@@ -225,6 +241,7 @@ TEST_CASE("test-qod", "[qpsolver]") {
225241 double required_x1;
226242
227243 Highs highs;
244+ highs.setOptionValue (" output_flag" , dev_run);
228245
229246 for (auto & solver : solvers) {
230247 HighsModel local_model;
@@ -250,7 +267,6 @@ TEST_CASE("test-qod", "[qpsolver]") {
250267 hessian.index_ = {0 };
251268 hessian.value_ = {2.0 };
252269
253- highs.setOptionValue("output_flag", dev_run);
254270 const HighsInfo& info = highs.getInfo ();
255271 const HighsSolution& solution = highs.getSolution ();
256272 const double & objective_function_value = info.objective_function_value ;
@@ -369,7 +385,6 @@ TEST_CASE("test-qod", "[qpsolver]") {
369385
370386 highs.resetGlobalScheduler (true );
371387}
372- */
373388
374389TEST_CASE (" test-qjh" , " [qpsolver]" ) {
375390 // Test passing/reading and solving the problem qjh
@@ -382,6 +397,7 @@ TEST_CASE("test-qjh", "[qpsolver]") {
382397 double required_objective_function_value;
383398
384399 Highs highs;
400+ highs.setOptionValue (" output_flag" , dev_run);
385401
386402 for (auto & solver : solvers) {
387403 HighsModel local_model;
@@ -408,7 +424,6 @@ TEST_CASE("test-qjh", "[qpsolver]") {
408424 hessian.index_ = {0 , 2 , 1 , 2 };
409425 hessian.value_ = {2.0 , -1.0 , 0.2 , 2.0 };
410426
411- highs.setOptionValue (" output_flag" , dev_run);
412427 highs.setOptionValue (" solver" , solver);
413428 const HighsInfo& info = highs.getInfo ();
414429 const double & objective_function_value = info.objective_function_value ;
0 commit comments