Skip to content

Commit 5b7e8e0

Browse files
committed
formatting
1 parent 0a1623c commit 5b7e8e0

File tree

2 files changed

+28
-22
lines changed

2 files changed

+28
-22
lines changed

highs/mip/HighsMipSolver.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -971,10 +971,13 @@ void HighsMipSolver::callbackGetCutPool() const {
971971
callback_->user_callback_data);
972972
}
973973

974-
bool HighsMipSolver::solutionFeasible(
975-
const HighsLp* lp, const std::vector<double>& col_value,
976-
const std::vector<double>* pass_row_value, double& bound_violation,
977-
double& row_violation, double& integrality_violation, HighsCDouble& obj) const {
974+
bool HighsMipSolver::solutionFeasible(const HighsLp* lp,
975+
const std::vector<double>& col_value,
976+
const std::vector<double>* pass_row_value,
977+
double& bound_violation,
978+
double& row_violation,
979+
double& integrality_violation,
980+
HighsCDouble& obj) const {
978981
bound_violation = 0;
979982
row_violation = 0;
980983
integrality_violation = 0;

highs/mip/HighsMipWorker.cpp

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ const HighsMipSolver& HighsMipWorker::getMipSolver() { return mipsolver_; }
7272
bool HighsMipWorker::addIncumbent(const std::vector<double>& sol, double solobj,
7373
const int solution_source,
7474
const bool print_display_line) {
75-
7675
const bool execute_mip_solution_callback = false;
7776

7877
// Determine whether the potential new incumbent should be
@@ -101,10 +100,10 @@ bool HighsMipWorker::addIncumbent(const std::vector<double>& sol, double solobj,
101100
upper_bound = solobj;
102101

103102
bool bound_change = upper_bound != prev_upper_bound;
104-
// todo:
103+
// todo:
105104
// if (!mipsolver_.submip && bound_change)
106-
// updatePrimalDualIntegral(lower_bound, lower_bound, prev_upper_bound,
107-
// upper_bound);
105+
// updatePrimalDualIntegral(lower_bound, lower_bound, prev_upper_bound,
106+
// upper_bound);
108107

109108
incumbent = sol;
110109

@@ -122,7 +121,8 @@ bool HighsMipWorker::addIncumbent(const std::vector<double>& sol, double solobj,
122121
// nodequeue.setOptimalityLimit(optimality_limit);
123122
// debugSolution.newIncumbentFound();
124123
// domain.propagate();
125-
// if (!domain.infeasible()) redcostfixing.propagateRootRedcost(mipsolver);
124+
// if (!domain.infeasible())
125+
// redcostfixing.propagateRootRedcost(mipsolver);
126126

127127
// // Two calls to printDisplayLine added for completeness,
128128
// // ensuring that when the root node has an integer solution, a
@@ -154,14 +154,14 @@ bool HighsMipWorker::addIncumbent(const std::vector<double>& sol, double solobj,
154154

155155
double HighsMipWorker::transformNewIntegerFeasibleSolution(
156156
const std::vector<double>& sol,
157-
const bool possibly_store_as_new_incumbent) {
158-
157+
const bool possibly_store_as_new_incumbent) {
159158
HighsSolution solution;
160159
solution.col_value = sol;
161160
solution.value_valid = true;
162161

163162
// Perform primal postsolve to get the original column values
164-
mipsolver_.mipdata_->postSolveStack.undoPrimal(*mipsolver_.options_mip_, solution);
163+
mipsolver_.mipdata_->postSolveStack.undoPrimal(*mipsolver_.options_mip_,
164+
solution);
165165

166166
// Determine the row values, as they aren't computed in primal
167167
// postsolve
@@ -198,7 +198,7 @@ double HighsMipWorker::transformNewIntegerFeasibleSolution(
198198
}
199199
}
200200

201-
// todo:
201+
// todo:
202202
// this->total_repair_lp++;
203203

204204
double time_available = std::max(
@@ -214,8 +214,9 @@ double HighsMipWorker::transformNewIntegerFeasibleSolution(
214214
// tmpSolver.setOptionValue("simplex_scale_strategy", 0);
215215
// tmpSolver.setOptionValue("presolve", kHighsOffString);
216216
tmpSolver.setOptionValue("time_limit", time_available);
217-
tmpSolver.setOptionValue("primal_feasibility_tolerance",
218-
mipsolver_.options_mip_->mip_feasibility_tolerance);
217+
tmpSolver.setOptionValue(
218+
"primal_feasibility_tolerance",
219+
mipsolver_.options_mip_->mip_feasibility_tolerance);
219220
// check if only root presolve is allowed
220221
if (mipsolver_.options_mip_->mip_root_presolve_only)
221222
tmpSolver.setOptionValue("presolve", kHighsOffString);
@@ -236,14 +237,15 @@ double HighsMipWorker::transformNewIntegerFeasibleSolution(
236237
}
237238
}
238239

239-
// todo:
240+
// todo:
240241
// Possible MIP solution callback
241242
// if (!mipsolver.submip && feasible && mipsolver.callback_->user_callback &&
242243
// mipsolver.callback_->active[kCallbackMipSolution]) {
243244
// mipsolver.callback_->clearHighsCallbackDataOut();
244245
// mipsolver.callback_->data_out.mip_solution = solution.col_value.data();
245246
// const bool interrupt = interruptFromCallbackWithData(
246-
// kCallbackMipSolution, mipsolver_objective_value, "Feasible solution");
247+
// kCallbackMipSolution, mipsolver_objective_value, "Feasible
248+
// solution");
247249
// assert(!interrupt);
248250
// }
249251

@@ -271,11 +273,12 @@ double HighsMipWorker::transformNewIntegerFeasibleSolution(
271273
solution_.row_violation_ <=
272274
mipsolver_.options_mip_->mip_feasibility_tolerance;
273275

274-
highsLogUser(mipsolver_.options_mip_->log_options, HighsLogType::kWarning,
275-
"WORKER Solution with objective %g has untransformed violations: "
276-
"bound = %.4g; integrality = %.4g; row = %.4g\n",
277-
mipsolver_objective_value, bound_violation_,
278-
integrality_violation_, row_violation_);
276+
highsLogUser(
277+
mipsolver_.options_mip_->log_options, HighsLogType::kWarning,
278+
"WORKER Solution with objective %g has untransformed violations: "
279+
"bound = %.4g; integrality = %.4g; row = %.4g\n",
280+
mipsolver_objective_value, bound_violation_, integrality_violation_,
281+
row_violation_);
279282
if (!currentFeasible) {
280283
// if the current incumbent is non existent or also not feasible we
281284
// still store the new one

0 commit comments

Comments
 (0)