Skip to content

Commit a250ac6

Browse files
committed
Remove assert and some tabs
1 parent 586ca72 commit a250ac6

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

highs/ipm/ipx/lp_solver.cc

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace ipx {
1414

1515
Int LpSolver::LoadModel(Int num_var, const double offset,
16-
const double* obj, const double* lb,
16+
const double* obj, const double* lb,
1717
const double* ub, Int num_constr, const Int* Ap,
1818
const Int* Ai, const double* Ax, const double* rhs,
1919
const char* constr_type) {
@@ -57,24 +57,24 @@ Int LpSolver::Solve() {
5757
control_.hLog("IPX version 1.0\n");
5858
try {
5959
InteriorPointSolve();
60-
const bool run_crossover_on = control_.run_crossover() == 1;
61-
const bool run_crossover_choose = control_.run_crossover() == -1;
62-
const bool run_crossover_not_off = run_crossover_choose || run_crossover_on;
63-
const bool run_crossover =
64-
(info_.status_ipm == IPX_STATUS_optimal && run_crossover_on) ||
65-
(info_.status_ipm == IPX_STATUS_imprecise && run_crossover_not_off);
66-
// if ((info_.status_ipm == IPX_STATUS_optimal ||
67-
// info_.status_ipm == IPX_STATUS_imprecise) && run_crossover_on) {
68-
if (run_crossover) {
69-
if (run_crossover_on) {
70-
control_.hLog("Running crossover as requested\n");
71-
} else if (run_crossover_choose) {
72-
assert(info_.status_ipm == IPX_STATUS_imprecise);
73-
control_.hLog("Running crossover since IPX is imprecise\n");
74-
} else {
75-
assert(run_crossover_on || run_crossover_choose);
76-
}
77-
BuildCrossoverStartingPoint();
60+
const bool run_crossover_on = control_.run_crossover() == 1;
61+
const bool run_crossover_choose = control_.run_crossover() == -1;
62+
const bool run_crossover_not_off = run_crossover_choose || run_crossover_on;
63+
const bool run_crossover =
64+
(info_.status_ipm == IPX_STATUS_optimal && run_crossover_on) ||
65+
(info_.status_ipm == IPX_STATUS_imprecise && run_crossover_not_off);
66+
// if ((info_.status_ipm == IPX_STATUS_optimal ||
67+
// info_.status_ipm == IPX_STATUS_imprecise) && run_crossover_on) {
68+
if (run_crossover) {
69+
if (run_crossover_on) {
70+
control_.hLog("Running crossover as requested\n");
71+
} else if (run_crossover_choose) {
72+
assert(info_.status_ipm == IPX_STATUS_imprecise);
73+
control_.hLog("Running crossover since IPX is imprecise\n");
74+
} else {
75+
assert(run_crossover_on || run_crossover_choose);
76+
}
77+
BuildCrossoverStartingPoint();
7878
RunCrossover();
7979
}
8080
if (basis_) {
@@ -381,12 +381,10 @@ void LpSolver::InteriorPointSolve() {
381381
info_.rel_dresidual > control_.ipm_feasibility_tol())
382382
info_.status_ipm = IPX_STATUS_imprecise;
383383
}
384-
if (info_.centring_tried) {
385-
// Assess the success of analytic centre calculation
384+
// Assess the success of analytic centre calculation
385+
if (info_.centring_tried)
386386
info_.status_ipm = info_.centring_success ? IPX_STATUS_optimal : IPX_STATUS_imprecise;
387-
//assert(info_.status_ipm == IPX_STATUS_optimal);
388-
}
389-
}
387+
}
390388

391389
void LpSolver::RunIPM() {
392390
IPM ipm(control_);
@@ -527,7 +525,7 @@ void LpSolver::BuildStartingBasis() {
527525
StartingBasis(iterate_.get(), basis_.get(), &info_);
528526
if (info_.errflag == IPX_ERROR_user_interrupt) {
529527
info_.errflag = 0;
530-
info_.status_ipm = IPX_STATUS_user_interrupt;
528+
info_.status_ipm = IPX_STATUS_user_interrupt;
531529
return;
532530
} else if (info_.errflag == IPX_ERROR_time_interrupt) {
533531
info_.errflag = 0;

0 commit comments

Comments
 (0)