Skip to content

Commit 89e7186

Browse files
committed
Removed HighsOptions::cost_scale
1 parent 9fa8db6 commit 89e7186

File tree

4 files changed

+4
-32
lines changed

4 files changed

+4
-32
lines changed

highs/lp_data/HighsOptions.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,6 @@ struct HighsOptionsStruct {
400400
bool mps_parser_type_free;
401401
bool use_warm_start;
402402
HighsInt keep_n_rows;
403-
HighsInt cost_scale_factor;
404403
HighsInt allowed_matrix_scale_factor;
405404
HighsInt allowed_cost_scale_factor;
406405
HighsInt ipx_dualize_strategy;
@@ -561,7 +560,6 @@ struct HighsOptionsStruct {
561560
mps_parser_type_free(false),
562561
use_warm_start(true),
563562
keep_n_rows(0),
564-
cost_scale_factor(0),
565563
allowed_matrix_scale_factor(0),
566564
allowed_cost_scale_factor(0),
567565
ipx_dualize_strategy(0),
@@ -1385,11 +1383,6 @@ class HighsOptions : public HighsOptionsStruct {
13851383
kKeepNRowsDeleteRows, kKeepNRowsKeepRows);
13861384
records.push_back(record_int);
13871385

1388-
record_int =
1389-
new OptionRecordInt("cost_scale_factor", "Scaling factor for costs",
1390-
advanced, &cost_scale_factor, -20, 0, 20);
1391-
records.push_back(record_int);
1392-
13931386
record_int = new OptionRecordInt(
13941387
"allowed_matrix_scale_factor",
13951388
"Largest power-of-two factor permitted when "
@@ -1401,7 +1394,8 @@ class HighsOptions : public HighsOptionsStruct {
14011394
record_int = new OptionRecordInt(
14021395
"allowed_cost_scale_factor",
14031396
"Largest power-of-two factor permitted when scaling the costs",
1404-
advanced, &allowed_cost_scale_factor, 0, 0, 20);
1397+
advanced, &allowed_cost_scale_factor, 0,
1398+
kDefaultAllowedMatrixPow2Scale, kMaxAllowedMatrixPow2Scale);
14051399
records.push_back(record_int);
14061400

14071401
record_int = new OptionRecordInt(

highs/simplex/HApp.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,6 @@ inline HighsStatus solveLpSimplex(HighsLpSolverObject& solver_object) {
228228
ekk_instance.undualize();
229229
assert(!ekk_instance.status_.is_permuted &&
230230
!ekk_instance.status_.is_dualized);
231-
if (options.cost_scale_factor) {
232-
double cost_scale_factor = pow(2.0, -options.cost_scale_factor);
233-
highsLogDev(options.log_options, HighsLogType::kInfo,
234-
"Objective = %11.4g\n",
235-
cost_scale_factor * ekk_instance.info_.dual_objective_value);
236-
ekk_instance.model_status_ = HighsModelStatus::kNotset;
237-
return_status = HighsStatus::kError;
238-
}
239-
//
240231
} else {
241232
// Indicate that there is no (current) need to refine the solution
242233
// by solving the unscaled LP with scaled NLA
@@ -256,15 +247,6 @@ inline HighsStatus solveLpSimplex(HighsLpSolverObject& solver_object) {
256247
ekk_instance.undualize();
257248
assert(!ekk_instance.status_.is_permuted &&
258249
!ekk_instance.status_.is_dualized);
259-
//
260-
if (options.cost_scale_factor) {
261-
double cost_scale_factor = pow(2.0, -options.cost_scale_factor);
262-
highsLogDev(
263-
options.log_options, HighsLogType::kInfo, "Objective = %11.4g\n",
264-
cost_scale_factor * ekk_instance.info_.dual_objective_value);
265-
ekk_instance.model_status_ = HighsModelStatus::kNotset;
266-
return_status = HighsStatus::kError;
267-
}
268250
if (return_status == HighsStatus::kError) {
269251
incumbent_lp.moveBackLpAndUnapplyScaling(ekk_lp);
270252
return returnFromSolveLpSimplex(solver_object, return_status);

highs/simplex/HEkk.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2663,10 +2663,8 @@ void HEkk::initialiseBound(const SimplexAlgorithm algorithm,
26632663
}
26642664

26652665
void HEkk::initialiseLpColCost() {
2666-
double cost_scale_factor = pow(2.0, options_->cost_scale_factor);
26672666
for (HighsInt iCol = 0; iCol < lp_.num_col_; iCol++) {
2668-
info_.workCost_[iCol] =
2669-
(HighsInt)lp_.sense_ * cost_scale_factor * lp_.col_cost_[iCol];
2667+
info_.workCost_[iCol] = HighsInt(lp_.sense_) * lp_.col_cost_[iCol];
26702668
info_.workShift_[iCol] = 0;
26712669
}
26722670
}

highs/simplex/HEkkDual.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,8 +1310,6 @@ void HEkkDual::iterateTasks() {
13101310
}
13111311

13121312
void HEkkDual::iterationAnalysisData() {
1313-
double cost_scale_factor =
1314-
pow(2.0, -ekk_instance_.options_->cost_scale_factor);
13151313
HighsSimplexInfo& info = ekk_instance_.info_;
13161314
analysis->simplex_strategy = info.simplex_strategy;
13171315
analysis->edge_weight_mode = edge_weight_mode;
@@ -1327,7 +1325,7 @@ void HEkkDual::iterationAnalysisData() {
13271325
analysis->edge_weight = 0;
13281326
analysis->primal_delta = delta_primal;
13291327
analysis->primal_step = theta_primal;
1330-
analysis->dual_step = theta_dual * cost_scale_factor;
1328+
analysis->dual_step = theta_dual;
13311329
analysis->pivot_value_from_column = alpha_col;
13321330
analysis->pivot_value_from_row = alpha_row;
13331331
analysis->factor_pivot_threshold = info.factor_pivot_threshold;

0 commit comments

Comments
 (0)