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

Method userScale

highs/lp_data/HighsInterface.cpp:3093–3112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3091}
3092
3093HighsStatus 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
3114HighsStatus Highs::userUnscale(HighsUserScaleData& data) {
3115 if (!data.applied) return HighsStatus::kOk;

Callers 1

runMethod · 0.95

Calls 3

userScaleModelMethod · 0.95
userScaleSolutionMethod · 0.95
initialiseUserScaleDataFunction · 0.85

Tested by

no test coverage detected