Skip to content

Commit a41699e

Browse files
committed
Modified calls to getKktErrors in Highs::presolve to gather residual information
1 parent f1df936 commit a41699e

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

highs/lp_data/Highs.cpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4159,8 +4159,12 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
41594159
HighsLp& lp = this->model_.lp_;
41604160
this->info_.objective_function_value =
41614161
computeObjectiveValue(lp, this->solution_);
4162-
getKktFailures(this->options_, this->model_, this->solution_,
4163-
this->basis_, this->info_);
4162+
const bool is_qp = this->model_.isQp();
4163+
assert(!is_qp);
4164+
const bool get_residuals = true;
4165+
getKktFailures(this->options_, is_qp, this->model_.lp_,
4166+
this->model_.lp_.col_cost_, this->solution_, this->info_,
4167+
get_residuals);
41644168
double& max_integrality_violation = this->info_.max_integrality_violation;
41654169
max_integrality_violation = 0;
41664170
for (HighsInt iCol = 0; iCol < lp.num_col_; iCol++) {
@@ -4261,17 +4265,29 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
42614265
return_status, "callSolveLp");
42624266
// Recover the options
42634267
options_ = save_options;
4268+
HighsPrimalDualErrors primal_dual_errors;
4269+
const bool is_qp = this->model_.isQp();
4270+
assert(!is_qp);
4271+
const bool get_residuals = true;
4272+
getKktFailures(this->options_, is_qp, this->model_.lp_,
4273+
this->model_.lp_.col_cost_, this->solution_, this->info_,
4274+
get_residuals);
42644275
if (return_status == HighsStatus::kError) {
42654276
// Set undo_mods = false, since passing models requiring
42664277
// modification to Highs::presolve is illegal
42674278
const bool undo_mods = false;
42684279
return returnFromOptimizeModel(return_status, undo_mods);
42694280
}
42704281
} else {
4271-
basis_.clear();
4282+
this->basis_.clear();
42724283
info_.objective_function_value =
42734284
model_.lp_.objectiveValue(solution_.col_value);
4274-
getLpKktFailures(options_, model_.lp_, solution_, basis_, info_);
4285+
const bool is_qp = this->model_.isQp();
4286+
assert(!is_qp);
4287+
const bool get_residuals = true;
4288+
getKktFailures(this->options_, is_qp, this->model_.lp_,
4289+
this->model_.lp_.col_cost_, this->solution_, this->info_,
4290+
get_residuals);
42754291
if (info_.num_primal_infeasibilities == 0 &&
42764292
info_.num_dual_infeasibilities == 0) {
42774293
model_status_ = HighsModelStatus::kOptimal;

0 commit comments

Comments
 (0)