@@ -347,15 +347,16 @@ HighsStatus solveUnconstrainedLp(const HighsOptions& options, const HighsLp& lp,
347347// determine the model coefficient ranges, assess it for values
348348// outside the [small, large] range, and give appropriate scaling
349349// recommendations
350- void assessCostBoundScaling (const HighsLogOptions log_options,
351- const HighsModel& model,
352- HighsUserScaleData& user_scale_data,
353- const bool excessive) {
350+ void assessExcessiveCostBoundScaling (const HighsLogOptions log_options,
351+ const HighsModel& model,
352+ HighsUserScaleData& user_scale_data) {
353+ const HighsLp& lp = model.lp_ ;
354+ if (lp.num_col_ == 0 || lp.num_row_ == 0 ) return ;
354355 const bool user_cost_or_bound_scale = user_scale_data.user_cost_scale || user_scale_data.user_bound_scale ;
355- const double small_cost = excessive ? kExcessivelySmallCostValue : kOkSmallCostValue ;
356- const double large_cost = excessive ? kExcessivelyLargeCostValue : kOkLargeCostValue ;
357- const double small_bound = excessive ? kExcessivelySmallBoundValue : kOkSmallBoundValue ;
358- const double large_bound = excessive ? kExcessivelyLargeBoundValue : kOkLargeBoundValue ;
356+ const double small_cost = kExcessivelySmallCostValue ;
357+ const double large_cost = kExcessivelyLargeCostValue ;
358+ const double small_bound = kExcessivelySmallBoundValue ;
359+ const double large_bound = kExcessivelyLargeBoundValue ;
359360 std::stringstream message;
360361 if (user_cost_or_bound_scale) {
361362 if (user_scale_data.user_cost_scale )
@@ -367,7 +368,7 @@ void assessCostBoundScaling(const HighsLogOptions log_options,
367368 user_scale_data.user_bound_scale );
368369 }
369370 highsLogUser (log_options, HighsLogType::kInfo ,
370- " Assessing excessive costs or bounds after applying%s\n " , message.str ().c_str ());
371+ " Assessing costs and bounds after applying%s\n " , message.str ().c_str ());
371372 }
372373 // Lambda for assessing a finite nonzero
373374 auto assessFiniteNonzero = [&](const double value, double & min_value,
@@ -378,7 +379,6 @@ void assessCostBoundScaling(const HighsLogOptions log_options,
378379 max_value = std::max (abs_value, max_value);
379380 }
380381 };
381- const HighsLp& lp = model.lp_ ;
382382 double min_continuous_col_cost = kHighsInf ;
383383 double min_noncontinuous_col_cost = kHighsInf ;
384384 double max_continuous_col_cost = -kHighsInf ;
@@ -481,14 +481,12 @@ void assessCostBoundScaling(const HighsLogOptions log_options,
481481 if (max_col_cost > large_cost)
482482 highsLogUser (log_options, HighsLogType::kWarning ,
483483 " %s has excessively large costs\n " , problem.c_str ());
484-
485484 if (0 < min_col_bound && min_col_bound < small_bound)
486485 highsLogUser (log_options, HighsLogType::kWarning ,
487486 " %s has excessively small column bounds\n " , problem.c_str ());
488487 if (max_col_bound > large_bound)
489488 highsLogUser (log_options, HighsLogType::kWarning ,
490489 " %s has excessively large column bounds\n " , problem.c_str ());
491-
492490 if (0 < min_row_bound && min_row_bound < small_bound)
493491 highsLogUser (log_options, HighsLogType::kWarning ,
494492 " %s has excessively small row bounds\n " , problem.c_str ());
@@ -500,17 +498,17 @@ void assessCostBoundScaling(const HighsLogOptions log_options,
500498 auto suggestScaling = [&](double min_value, double max_value, double small_value, double large_value) {
501499 double ratio = 1 ;
502500 if (min_value > large_value) {
503- // All scalable values are excessively large, so obviously suggest
501+ // All scalable values are large, so obviously suggest
504502 // scaling them down
505503 ratio = 1.0 / min_value;
506504 // assert(0 == 11);
507505 } else if (0 < max_value && max_value < small_value) {
508- // All scalable values are excessively small, so obviously suggest
506+ // All scalable values are small, so obviously suggest
509507 // scaling them up
510508 ratio = 1.0 / max_value;
511509 } else {
512510 if (max_value > large_value) {
513- // Max value is excessively large, so look to scale it down
511+ // Max value is large, so look to scale it down
514512 if (0 < min_value) {
515513 // Chance that small values may be scaled down below
516514 // small_value, so look for balance
@@ -525,7 +523,7 @@ void assessCostBoundScaling(const HighsLogOptions log_options,
525523 // assert(0 == 44);
526524 }
527525 } else if (0 < min_value && min_value < small_value) {
528- // Min value is excessively small, so look to scale it up,
526+ // Min value is small, so look to scale it up,
529527 if (0 < max_value) {
530528 // Chance that large values may be scaled up above
531529 // large_value, so look for balance
@@ -594,15 +592,15 @@ void assessCostBoundScaling(const HighsLogOptions log_options,
594592 !user_scale_data.user_cost_scale ;
595593 message.str (std::string ());
596594 if (order_of_magnitude_message)
597- message << highsFormatToString (" Consider scaling the costs by 1e%+1d" ,
595+ message << highsFormatToString (" Consider scaling the costs by 1e%+1d" ,
598596 int (suggested_cost_scale_order_of_magnitude));
599597 if (user_scale_data.suggested_user_cost_scale ) {
600598 if (!order_of_magnitude_message) {
601599 message << " Consider" ;
602600 } else {
603601 message << " , or" ;
604602 }
605- message << highsFormatToString (" setting the user_cost_scale option to %d\n " ,
603+ message << highsFormatToString (" setting the user_cost_scale option to %d" ,
606604 int (user_scale_data.suggested_user_cost_scale ));
607605 }
608606 if (order_of_magnitude_message || user_scale_data.suggested_user_cost_scale )
@@ -622,7 +620,7 @@ void assessCostBoundScaling(const HighsLogOptions log_options,
622620 } else {
623621 message << " , or" ;
624622 }
625- message << highsFormatToString (" setting the user_bound_scale option to %d\n " ,
623+ message << highsFormatToString (" setting the user_bound_scale option to %d" ,
626624 int (user_scale_data.suggested_user_bound_scale ));
627625 }
628626 if (order_of_magnitude_message || user_scale_data.suggested_user_bound_scale )
0 commit comments