MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / scaleError

Method scaleError

highs/lp_data/HighsLpUtils.cpp:3720–3783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3718}
3719
3720bool HighsUserScaleData::scaleError(std::string& message) const {
3721 if (this->num_infinite_costs + this->num_infinite_hessian_values +
3722 this->num_infinite_col_bounds + this->num_infinite_row_bounds +
3723 this->num_large_matrix_values ==
3724 0)
3725 return false;
3726 assert(this->user_objective_scale != 0 || this->user_bound_scale != 0);
3727 std::stringstream ss;
3728 ss.str(std::string());
3729 ss << "User scaling of";
3730 if (this->user_objective_scale != 0) {
3731 ss << " 2**(" << this->user_objective_scale << ") for costs";
3732 }
3733 if (this->user_bound_scale != 0) {
3734 if (this->user_objective_scale != 0) ss << " and";
3735 ss << " 2**(" << this->user_bound_scale << ") for bounds";
3736 }
3737 ss << " yields";
3738 if (this->num_infinite_costs) {
3739 ss << " " << this->num_infinite_costs << " infinite cost";
3740 if (this->num_infinite_costs > 1) ss << "s";
3741 }
3742 if (this->num_infinite_hessian_values) {
3743 if (this->num_infinite_costs) {
3744 if (this->num_infinite_col_bounds || this->num_infinite_row_bounds) {
3745 ss << ",";
3746 } else {
3747 ss << " and";
3748 }
3749 }
3750 ss << " " << this->num_infinite_hessian_values
3751 << " infinite Hessian values";
3752 if (this->num_infinite_hessian_values > 1) ss << "s";
3753 }
3754 if (this->num_infinite_col_bounds) {
3755 if (this->num_infinite_costs || this->num_infinite_hessian_values) {
3756 if (this->num_infinite_row_bounds) {
3757 ss << ",";
3758 } else {
3759 ss << " and";
3760 }
3761 }
3762 ss << " " << this->num_infinite_col_bounds << " infinite column bound";
3763 if (this->num_infinite_col_bounds > 1) ss << "s";
3764 }
3765 if (this->num_infinite_row_bounds) {
3766 if (this->num_infinite_costs || this->num_infinite_hessian_values ||
3767 this->num_infinite_col_bounds)
3768 ss << " and";
3769 ss << " " << this->num_infinite_row_bounds << " infinite row bound";
3770 if (this->num_infinite_row_bounds > 1) ss << "s";
3771 }
3772 if (this->num_large_matrix_values) {
3773 if (this->num_infinite_costs + this->num_infinite_hessian_values +
3774 this->num_infinite_col_bounds + this->num_infinite_row_bounds >
3775 0)
3776 ss << ", and";
3777 ss << " " << this->num_large_matrix_values << " large matrix value";

Callers 1

userScaleStatusFunction · 0.80

Calls 1

strMethod · 0.80

Tested by

no test coverage detected