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

Method unapplyScale

highs/lp_data/HighsLp.cpp:274–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274void HighsLp::unapplyScale() {
275 // Ensure that any scaling is not applied
276 const HighsScale& scale = this->scale_;
277 if (!this->is_scaled_) {
278 // Not scaled so return
279 return;
280 }
281 // Already scaled - so check that there is scaling
282 assert(scale.has_scaling);
283 // Unapply the scaling to the bounds, costs and matrix, and record
284 // that it has been unapplied
285 for (HighsInt iCol = 0; iCol < this->num_col_; iCol++) {
286 this->col_lower_[iCol] *= scale.col[iCol];
287 this->col_upper_[iCol] *= scale.col[iCol];
288 this->col_cost_[iCol] /= scale.col[iCol];
289 }
290 for (HighsInt iRow = 0; iRow < this->num_row_; iRow++) {
291 this->row_lower_[iRow] /= scale.row[iRow];
292 this->row_upper_[iRow] /= scale.row[iRow];
293 }
294 this->a_matrix_.unapplyScale(scale);
295 this->is_scaled_ = false;
296}
297
298void HighsLp::moveBackLpAndUnapplyScaling(HighsLp& lp) {
299 assert(this->is_moved_ == true);

Callers 4

clearScalingMethod · 0.95
considerScalingFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected