44#include " Highs.h"
55#include " catch.hpp"
66
7- const bool dev_run = false ;
7+ const bool dev_run = true ; // false;
88const double inf = kHighsInf ;
99
1010bool doubleEqual0 (const double v0, const double v1) {
@@ -283,41 +283,57 @@ TEST_CASE("ill-scaled-model", "[highs_user_scale]") {
283283 h.run ();
284284 }
285285
286- const bool all_test = true ;
287- const bool lp_test = all_test || false ;
288- const bool mip_test = all_test || true ;
286+ const bool all_test = true ;// false;//
287+ const bool lp_test = all_test || true ;
288+ const bool mip_test = all_test || false ;
289289 const bool qp_test = all_test || false ;
290290
291+ const bool ok_test = all_test || false ;
291292 const double ok_cost = 1.0 ;
292293 const double ok_hessian = 1.0 ;
293294 const double ok_col_lower = 0.0 ;
294295 const double ok_bound = 1.0 ;
295296
296297 // If the costs are too small, it becomes a feasibility problem,
297298 // so don't get the same objective value in testUserScale
298- const bool small_cost_test = true ;
299+ const bool small_cost_test = all_test || false ;
299300 const double small_cost = 0.5e-4 ;
300301 const double small_hessian = 1e-4 ;
301302 const double small_col_lower = 1e-8 ;
303+ const double large_cost = 1e8 ;
304+ const double large_hessian = 1e4 ;
305+ const double large_bound = 1e8 ;
302306 if (lp_test) {
303- if (dev_run)
304- printf (
305- " \n ================\n ill-scaled-model: LP test\n ================\n " );
306- testLp (h, ok_cost, ok_col_lower, ok_bound);
307+ if (ok_test) {
308+ if (dev_run)
309+ printf (
310+ " \n ================\n ill-scaled-model: LP test\n ================\n " );
311+ testLp (h, ok_cost, ok_col_lower, ok_bound);
312+ }
307313 if (small_cost_test) {
308314 if (dev_run)
309315 printf (
310316 " \n ================\n ill-scaled-model: LP test - small costs and "
311317 " column LB\n ================\n " );
312318 testLp (h, small_cost, small_col_lower, ok_bound);
313319 }
320+ 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);
324+ 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);
314328 }
315329
316330 if (mip_test) {
317- if (dev_run)
318- printf (
319- " \n ================\n ill-scaled-model: MIP test\n ================\n " );
320- testMip (h, ok_cost, ok_col_lower, ok_bound);
331+ if (ok_test) {
332+ if (dev_run)
333+ printf (
334+ " \n ================\n ill-scaled-model: MIP test\n ================\n " );
335+ testMip (h, ok_cost, ok_col_lower, ok_bound);
336+ }
321337
322338 if (small_cost_test) {
323339 if (dev_run)
@@ -326,14 +342,32 @@ TEST_CASE("ill-scaled-model", "[highs_user_scale]") {
326342 " column LB\n ================\n " );
327343 testMip (h, small_cost, small_col_lower, ok_bound);
328344 }
345+ if (dev_run)
346+ printf (
347+ " \n ================\n ill-scaled-model: MIP test - large costs\n ================\n " );
348+ testMip (h, large_cost, small_col_lower, ok_bound);
349+ if (dev_run)
350+ printf (
351+ " \n ================\n ill-scaled-model: MIP test - large bounds\n ================\n " );
352+ testMip (h, ok_cost, small_col_lower, large_bound);
329353 }
330354
331355 if (qp_test) {
332- if (dev_run)
333- printf (
334- " \n ================\n ill-scaled-model: QP test\n ================\n " );
335- testQp (h, ok_cost, ok_hessian, ok_col_lower, ok_bound);
356+ if (ok_test) {
357+ if (dev_run)
358+ printf (
359+ " \n ================\n ill-scaled-model: QP test\n ================\n " );
360+ testQp (h, ok_cost, ok_hessian, ok_col_lower, ok_bound);
361+ }
336362 // QP solver can't handle small costs and Hessian
363+ if (dev_run)
364+ printf (
365+ " \n ================\n ill-scaled-model: QP test - large costs\n ================\n " );
366+ testQp (h, large_cost, ok_hessian, ok_col_lower, ok_bound);
367+ if (dev_run)
368+ printf (
369+ " \n ================\n ill-scaled-model: QP test - large bounds\n ================\n " );
370+ testQp (h, ok_cost, ok_hessian, small_col_lower, large_bound);
337371 }
338372
339373 h.resetGlobalScheduler (true );
0 commit comments