| 3091 | } |
| 3092 | |
| 3093 | HighsStatus Highs::userScale(HighsUserScaleData& data) { |
| 3094 | if (!options_.user_objective_scale && !options_.user_bound_scale) |
| 3095 | return HighsStatus::kOk; |
| 3096 | // User objective and bound scaling data are accumulated in the |
| 3097 | // HighsUserScaleData struct, in particular, there is a local copy |
| 3098 | // of the user objective and bound scaling options values, and |
| 3099 | // records of resulting extreme data values that prevent the user |
| 3100 | // objective and bound scaling from being applied. |
| 3101 | initialiseUserScaleData(this->options_, data); |
| 3102 | // Determine whether user scaling yields excessively large cost, |
| 3103 | // Hessian values, column/row bounds or matrix values. If not, |
| 3104 | // then apply the user scaling to the model... |
| 3105 | if (this->userScaleModel(data) == HighsStatus::kError) |
| 3106 | return HighsStatus::kError; |
| 3107 | // ... and the solution |
| 3108 | this->userScaleSolution(data); |
| 3109 | // Indicate that the scaling has been applied |
| 3110 | data.applied = true; |
| 3111 | return HighsStatus::kOk; |
| 3112 | } |
| 3113 | |
| 3114 | HighsStatus Highs::userUnscale(HighsUserScaleData& data) { |
| 3115 | if (!data.applied) return HighsStatus::kOk; |
no test coverage detected