44#include " Highs.h"
55#include " catch.hpp"
66
7- const bool dev_run = true ; // false;
7+ const bool dev_run = false ;
88const double inf = kHighsInf ;
99
1010bool doubleEqual0 (const double v0, const double v1) {
@@ -67,7 +67,7 @@ TEST_CASE("user-small-cost-scale", "[highs_user_scale]") {
6767 Highs highs;
6868 const HighsInfo& info = highs.getInfo ();
6969 const HighsSolution& solution = highs.getSolution ();
70- // highs.setOptionValue("output_flag", dev_run);
70+ highs.setOptionValue (" output_flag" , dev_run);
7171 highs.setOptionValue (" presolve" , kHighsOffString );
7272 HighsLp lp;
7373 lp.num_col_ = 2 ;
@@ -283,7 +283,7 @@ TEST_CASE("ill-scaled-model", "[highs_user_scale]") {
283283 h.run ();
284284 }
285285
286- const bool all_test = true ;// false;//
286+ const bool all_test = true ; // false;//
287287 const bool lp_test = all_test || true ;
288288 const bool mip_test = all_test || false ;
289289 const bool qp_test = all_test || false ;
@@ -306,8 +306,9 @@ TEST_CASE("ill-scaled-model", "[highs_user_scale]") {
306306 if (lp_test) {
307307 if (ok_test) {
308308 if (dev_run)
309- printf (
310- " \n ================\n ill-scaled-model: LP test\n ================\n " );
309+ printf (
310+ " \n ================\n ill-scaled-model: LP "
311+ " test\n ================\n " );
311312 testLp (h, ok_cost, ok_col_lower, ok_bound);
312313 }
313314 if (small_cost_test) {
@@ -318,24 +319,28 @@ TEST_CASE("ill-scaled-model", "[highs_user_scale]") {
318319 testLp (h, small_cost, small_col_lower, ok_bound);
319320 }
320321 if (dev_run)
321- printf (
322- " \n ================\n ill-scaled-model: LP test - large costs\n ================\n " );
323- testLp (h, large_cost, small_col_lower, ok_bound);
322+ printf (
323+ " \n ================\n ill-scaled-model: LP test - large "
324+ " costs\n ================\n " );
325+ testLp (h, large_cost, small_col_lower, ok_bound);
324326 if (dev_run)
325- printf (
326- " \n ================\n ill-scaled-model: LP test - large bounds\n ================\n " );
327- testLp (h, ok_cost, small_col_lower, large_bound);
327+ printf (
328+ " \n ================\n ill-scaled-model: LP test - large "
329+ " bounds\n ================\n " );
330+ testLp (h, ok_cost, small_col_lower, large_bound);
328331 if (dev_run)
329- printf (
330- " \n ================\n ill-scaled-model: LP test - large costs and bounds\n ================\n " );
331- testLp (h, large_cost, small_col_lower, large_bound);
332+ printf (
333+ " \n ================\n ill-scaled-model: LP test - large costs and "
334+ " bounds\n ================\n " );
335+ testLp (h, large_cost, small_col_lower, large_bound);
332336 }
333337
334338 if (mip_test) {
335339 if (ok_test) {
336340 if (dev_run)
337- printf (
338- " \n ================\n ill-scaled-model: MIP test\n ================\n " );
341+ printf (
342+ " \n ================\n ill-scaled-model: MIP "
343+ " test\n ================\n " );
339344 testMip (h, ok_cost, ok_col_lower, ok_bound);
340345 }
341346
@@ -347,31 +352,46 @@ TEST_CASE("ill-scaled-model", "[highs_user_scale]") {
347352 testMip (h, small_cost, small_col_lower, ok_bound);
348353 }
349354 if (dev_run)
350- printf (
351- " \n ================\n ill-scaled-model: MIP test - large costs\n ================\n " );
352- testMip (h, large_cost, small_col_lower, ok_bound);
355+ printf (
356+ " \n ================\n ill-scaled-model: MIP test - large "
357+ " costs\n ================\n " );
358+ testMip (h, large_cost, small_col_lower, ok_bound);
353359 if (dev_run)
354- printf (
355- " \n ================\n ill-scaled-model: MIP test - large bounds\n ================\n " );
356- testMip (h, ok_cost, small_col_lower, large_bound);
360+ printf (
361+ " \n ================\n ill-scaled-model: MIP test - large "
362+ " bounds\n ================\n " );
363+ testMip (h, ok_cost, small_col_lower, large_bound);
364+ if (dev_run)
365+ printf (
366+ " \n ================\n ill-scaled-model: MIP test - large costs and "
367+ " bounds\n ================\n " );
368+ testMip (h, large_cost, small_col_lower, large_bound);
357369 }
358370
359371 if (qp_test) {
360372 if (ok_test) {
361373 if (dev_run)
362- printf (
363- " \n ================\n ill-scaled-model: QP test\n ================\n " );
374+ printf (
375+ " \n ================\n ill-scaled-model: QP "
376+ " test\n ================\n " );
364377 testQp (h, ok_cost, ok_hessian, ok_col_lower, ok_bound);
365378 }
366379 // QP solver can't handle small costs and Hessian
367380 if (dev_run)
368- printf (
369- " \n ================\n ill-scaled-model: QP test - large costs\n ================\n " );
370- testQp (h, large_cost, ok_hessian, ok_col_lower, ok_bound);
381+ printf (
382+ " \n ================\n ill-scaled-model: QP test - large "
383+ " costs\n ================\n " );
384+ testQp (h, large_cost, ok_hessian, ok_col_lower, ok_bound);
371385 if (dev_run)
372- printf (
373- " \n ================\n ill-scaled-model: QP test - large bounds\n ================\n " );
374- testQp (h, ok_cost, ok_hessian, small_col_lower, large_bound);
386+ printf (
387+ " \n ================\n ill-scaled-model: QP test - large "
388+ " bounds\n ================\n " );
389+ testQp (h, ok_cost, ok_hessian, small_col_lower, large_bound);
390+ if (dev_run)
391+ printf (
392+ " \n ================\n ill-scaled-model: QP test - large costs and "
393+ " bounds\n ================\n " );
394+ testQp (h, large_cost, large_hessian, small_col_lower, large_bound);
375395 }
376396
377397 h.resetGlobalScheduler (true );
0 commit comments